SparsePropagation.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- SparsePropagation.h - Sparse Conditional Property Propagation ------===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file implements an abstract sparse conditional propagation algorithm,
  15. // modeled after SCCP, but with a customizable lattice function.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_ANALYSIS_SPARSEPROPAGATION_H
  19. #define LLVM_ANALYSIS_SPARSEPROPAGATION_H
  20. #include "llvm/ADT/SmallPtrSet.h"
  21. #include "llvm/IR/Instructions.h"
  22. #include "llvm/Support/Debug.h"
  23. #include <set>
  24. #define DEBUG_TYPE "sparseprop"
  25. namespace llvm {
  26. /// A template for translating between LLVM Values and LatticeKeys. Clients must
  27. /// provide a specialization of LatticeKeyInfo for their LatticeKey type.
  28. template <class LatticeKey> struct LatticeKeyInfo {
  29. // static inline Value *getValueFromLatticeKey(LatticeKey Key);
  30. // static inline LatticeKey getLatticeKeyFromValue(Value *V);
  31. };
  32. template <class LatticeKey, class LatticeVal,
  33. class KeyInfo = LatticeKeyInfo<LatticeKey>>
  34. class SparseSolver;
  35. /// AbstractLatticeFunction - This class is implemented by the dataflow instance
  36. /// to specify what the lattice values are and how they handle merges etc. This
  37. /// gives the client the power to compute lattice values from instructions,
  38. /// constants, etc. The current requirement is that lattice values must be
  39. /// copyable. At the moment, nothing tries to avoid copying. Additionally,
  40. /// lattice keys must be able to be used as keys of a mapping data structure.
  41. /// Internally, the generic solver currently uses a DenseMap to map lattice keys
  42. /// to lattice values. If the lattice key is a non-standard type, a
  43. /// specialization of DenseMapInfo must be provided.
  44. template <class LatticeKey, class LatticeVal> class AbstractLatticeFunction {
  45. private:
  46. LatticeVal UndefVal, OverdefinedVal, UntrackedVal;
  47. public:
  48. AbstractLatticeFunction(LatticeVal undefVal, LatticeVal overdefinedVal,
  49. LatticeVal untrackedVal) {
  50. UndefVal = undefVal;
  51. OverdefinedVal = overdefinedVal;
  52. UntrackedVal = untrackedVal;
  53. }
  54. virtual ~AbstractLatticeFunction() = default;
  55. LatticeVal getUndefVal() const { return UndefVal; }
  56. LatticeVal getOverdefinedVal() const { return OverdefinedVal; }
  57. LatticeVal getUntrackedVal() const { return UntrackedVal; }
  58. /// IsUntrackedValue - If the specified LatticeKey is obviously uninteresting
  59. /// to the analysis (i.e., it would always return UntrackedVal), this
  60. /// function can return true to avoid pointless work.
  61. virtual bool IsUntrackedValue(LatticeKey Key) { return false; }
  62. /// ComputeLatticeVal - Compute and return a LatticeVal corresponding to the
  63. /// given LatticeKey.
  64. virtual LatticeVal ComputeLatticeVal(LatticeKey Key) {
  65. return getOverdefinedVal();
  66. }
  67. /// IsSpecialCasedPHI - Given a PHI node, determine whether this PHI node is
  68. /// one that the we want to handle through ComputeInstructionState.
  69. virtual bool IsSpecialCasedPHI(PHINode *PN) { return false; }
  70. /// MergeValues - Compute and return the merge of the two specified lattice
  71. /// values. Merging should only move one direction down the lattice to
  72. /// guarantee convergence (toward overdefined).
  73. virtual LatticeVal MergeValues(LatticeVal X, LatticeVal Y) {
  74. return getOverdefinedVal(); // always safe, never useful.
  75. }
  76. /// ComputeInstructionState - Compute the LatticeKeys that change as a result
  77. /// of executing instruction \p I. Their associated LatticeVals are store in
  78. /// \p ChangedValues.
  79. virtual void
  80. ComputeInstructionState(Instruction &I,
  81. DenseMap<LatticeKey, LatticeVal> &ChangedValues,
  82. SparseSolver<LatticeKey, LatticeVal> &SS) = 0;
  83. /// PrintLatticeVal - Render the given LatticeVal to the specified stream.
  84. virtual void PrintLatticeVal(LatticeVal LV, raw_ostream &OS);
  85. /// PrintLatticeKey - Render the given LatticeKey to the specified stream.
  86. virtual void PrintLatticeKey(LatticeKey Key, raw_ostream &OS);
  87. /// GetValueFromLatticeVal - If the given LatticeVal is representable as an
  88. /// LLVM value, return it; otherwise, return nullptr. If a type is given, the
  89. /// returned value must have the same type. This function is used by the
  90. /// generic solver in attempting to resolve branch and switch conditions.
  91. virtual Value *GetValueFromLatticeVal(LatticeVal LV, Type *Ty = nullptr) {
  92. return nullptr;
  93. }
  94. };
  95. /// SparseSolver - This class is a general purpose solver for Sparse Conditional
  96. /// Propagation with a programmable lattice function.
  97. template <class LatticeKey, class LatticeVal, class KeyInfo>
  98. class SparseSolver {
  99. /// LatticeFunc - This is the object that knows the lattice and how to
  100. /// compute transfer functions.
  101. AbstractLatticeFunction<LatticeKey, LatticeVal> *LatticeFunc;
  102. /// ValueState - Holds the LatticeVals associated with LatticeKeys.
  103. DenseMap<LatticeKey, LatticeVal> ValueState;
  104. /// BBExecutable - Holds the basic blocks that are executable.
  105. SmallPtrSet<BasicBlock *, 16> BBExecutable;
  106. /// ValueWorkList - Holds values that should be processed.
  107. SmallVector<Value *, 64> ValueWorkList;
  108. /// BBWorkList - Holds basic blocks that should be processed.
  109. SmallVector<BasicBlock *, 64> BBWorkList;
  110. using Edge = std::pair<BasicBlock *, BasicBlock *>;
  111. /// KnownFeasibleEdges - Entries in this set are edges which have already had
  112. /// PHI nodes retriggered.
  113. std::set<Edge> KnownFeasibleEdges;
  114. public:
  115. explicit SparseSolver(
  116. AbstractLatticeFunction<LatticeKey, LatticeVal> *Lattice)
  117. : LatticeFunc(Lattice) {}
  118. SparseSolver(const SparseSolver &) = delete;
  119. SparseSolver &operator=(const SparseSolver &) = delete;
  120. /// Solve - Solve for constants and executable blocks.
  121. void Solve();
  122. void Print(raw_ostream &OS) const;
  123. /// getExistingValueState - Return the LatticeVal object corresponding to the
  124. /// given value from the ValueState map. If the value is not in the map,
  125. /// UntrackedVal is returned, unlike the getValueState method.
  126. LatticeVal getExistingValueState(LatticeKey Key) const {
  127. auto I = ValueState.find(Key);
  128. return I != ValueState.end() ? I->second : LatticeFunc->getUntrackedVal();
  129. }
  130. /// getValueState - Return the LatticeVal object corresponding to the given
  131. /// value from the ValueState map. If the value is not in the map, its state
  132. /// is initialized.
  133. LatticeVal getValueState(LatticeKey Key);
  134. /// isEdgeFeasible - Return true if the control flow edge from the 'From'
  135. /// basic block to the 'To' basic block is currently feasible. If
  136. /// AggressiveUndef is true, then this treats values with unknown lattice
  137. /// values as undefined. This is generally only useful when solving the
  138. /// lattice, not when querying it.
  139. bool isEdgeFeasible(BasicBlock *From, BasicBlock *To,
  140. bool AggressiveUndef = false);
  141. /// isBlockExecutable - Return true if there are any known feasible
  142. /// edges into the basic block. This is generally only useful when
  143. /// querying the lattice.
  144. bool isBlockExecutable(BasicBlock *BB) const {
  145. return BBExecutable.count(BB);
  146. }
  147. /// MarkBlockExecutable - This method can be used by clients to mark all of
  148. /// the blocks that are known to be intrinsically live in the processed unit.
  149. void MarkBlockExecutable(BasicBlock *BB);
  150. private:
  151. /// UpdateState - When the state of some LatticeKey is potentially updated to
  152. /// the given LatticeVal, this function notices and adds the LLVM value
  153. /// corresponding the key to the work list, if needed.
  154. void UpdateState(LatticeKey Key, LatticeVal LV);
  155. /// markEdgeExecutable - Mark a basic block as executable, adding it to the BB
  156. /// work list if it is not already executable.
  157. void markEdgeExecutable(BasicBlock *Source, BasicBlock *Dest);
  158. /// getFeasibleSuccessors - Return a vector of booleans to indicate which
  159. /// successors are reachable from a given terminator instruction.
  160. void getFeasibleSuccessors(Instruction &TI, SmallVectorImpl<bool> &Succs,
  161. bool AggressiveUndef);
  162. void visitInst(Instruction &I);
  163. void visitPHINode(PHINode &I);
  164. void visitTerminator(Instruction &TI);
  165. };
  166. //===----------------------------------------------------------------------===//
  167. // AbstractLatticeFunction Implementation
  168. //===----------------------------------------------------------------------===//
  169. template <class LatticeKey, class LatticeVal>
  170. void AbstractLatticeFunction<LatticeKey, LatticeVal>::PrintLatticeVal(
  171. LatticeVal V, raw_ostream &OS) {
  172. if (V == UndefVal)
  173. OS << "undefined";
  174. else if (V == OverdefinedVal)
  175. OS << "overdefined";
  176. else if (V == UntrackedVal)
  177. OS << "untracked";
  178. else
  179. OS << "unknown lattice value";
  180. }
  181. template <class LatticeKey, class LatticeVal>
  182. void AbstractLatticeFunction<LatticeKey, LatticeVal>::PrintLatticeKey(
  183. LatticeKey Key, raw_ostream &OS) {
  184. OS << "unknown lattice key";
  185. }
  186. //===----------------------------------------------------------------------===//
  187. // SparseSolver Implementation
  188. //===----------------------------------------------------------------------===//
  189. template <class LatticeKey, class LatticeVal, class KeyInfo>
  190. LatticeVal
  191. SparseSolver<LatticeKey, LatticeVal, KeyInfo>::getValueState(LatticeKey Key) {
  192. auto I = ValueState.find(Key);
  193. if (I != ValueState.end())
  194. return I->second; // Common case, in the map
  195. if (LatticeFunc->IsUntrackedValue(Key))
  196. return LatticeFunc->getUntrackedVal();
  197. LatticeVal LV = LatticeFunc->ComputeLatticeVal(Key);
  198. // If this value is untracked, don't add it to the map.
  199. if (LV == LatticeFunc->getUntrackedVal())
  200. return LV;
  201. return ValueState[Key] = std::move(LV);
  202. }
  203. template <class LatticeKey, class LatticeVal, class KeyInfo>
  204. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::UpdateState(LatticeKey Key,
  205. LatticeVal LV) {
  206. auto I = ValueState.find(Key);
  207. if (I != ValueState.end() && I->second == LV)
  208. return; // No change.
  209. // Update the state of the given LatticeKey and add its corresponding LLVM
  210. // value to the work list.
  211. ValueState[Key] = std::move(LV);
  212. if (Value *V = KeyInfo::getValueFromLatticeKey(Key))
  213. ValueWorkList.push_back(V);
  214. }
  215. template <class LatticeKey, class LatticeVal, class KeyInfo>
  216. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::MarkBlockExecutable(
  217. BasicBlock *BB) {
  218. if (!BBExecutable.insert(BB).second)
  219. return;
  220. LLVM_DEBUG(dbgs() << "Marking Block Executable: " << BB->getName() << "\n");
  221. BBWorkList.push_back(BB); // Add the block to the work list!
  222. }
  223. template <class LatticeKey, class LatticeVal, class KeyInfo>
  224. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::markEdgeExecutable(
  225. BasicBlock *Source, BasicBlock *Dest) {
  226. if (!KnownFeasibleEdges.insert(Edge(Source, Dest)).second)
  227. return; // This edge is already known to be executable!
  228. LLVM_DEBUG(dbgs() << "Marking Edge Executable: " << Source->getName()
  229. << " -> " << Dest->getName() << "\n");
  230. if (BBExecutable.count(Dest)) {
  231. // The destination is already executable, but we just made an edge
  232. // feasible that wasn't before. Revisit the PHI nodes in the block
  233. // because they have potentially new operands.
  234. for (BasicBlock::iterator I = Dest->begin(); isa<PHINode>(I); ++I)
  235. visitPHINode(*cast<PHINode>(I));
  236. } else {
  237. MarkBlockExecutable(Dest);
  238. }
  239. }
  240. template <class LatticeKey, class LatticeVal, class KeyInfo>
  241. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::getFeasibleSuccessors(
  242. Instruction &TI, SmallVectorImpl<bool> &Succs, bool AggressiveUndef) {
  243. Succs.resize(TI.getNumSuccessors());
  244. if (TI.getNumSuccessors() == 0)
  245. return;
  246. if (BranchInst *BI = dyn_cast<BranchInst>(&TI)) {
  247. if (BI->isUnconditional()) {
  248. Succs[0] = true;
  249. return;
  250. }
  251. LatticeVal BCValue;
  252. if (AggressiveUndef)
  253. BCValue =
  254. getValueState(KeyInfo::getLatticeKeyFromValue(BI->getCondition()));
  255. else
  256. BCValue = getExistingValueState(
  257. KeyInfo::getLatticeKeyFromValue(BI->getCondition()));
  258. if (BCValue == LatticeFunc->getOverdefinedVal() ||
  259. BCValue == LatticeFunc->getUntrackedVal()) {
  260. // Overdefined condition variables can branch either way.
  261. Succs[0] = Succs[1] = true;
  262. return;
  263. }
  264. // If undefined, neither is feasible yet.
  265. if (BCValue == LatticeFunc->getUndefVal())
  266. return;
  267. Constant *C =
  268. dyn_cast_or_null<Constant>(LatticeFunc->GetValueFromLatticeVal(
  269. std::move(BCValue), BI->getCondition()->getType()));
  270. if (!C || !isa<ConstantInt>(C)) {
  271. // Non-constant values can go either way.
  272. Succs[0] = Succs[1] = true;
  273. return;
  274. }
  275. // Constant condition variables mean the branch can only go a single way
  276. Succs[C->isNullValue()] = true;
  277. return;
  278. }
  279. if (TI.isExceptionalTerminator() ||
  280. TI.isIndirectTerminator()) {
  281. Succs.assign(Succs.size(), true);
  282. return;
  283. }
  284. SwitchInst &SI = cast<SwitchInst>(TI);
  285. LatticeVal SCValue;
  286. if (AggressiveUndef)
  287. SCValue = getValueState(KeyInfo::getLatticeKeyFromValue(SI.getCondition()));
  288. else
  289. SCValue = getExistingValueState(
  290. KeyInfo::getLatticeKeyFromValue(SI.getCondition()));
  291. if (SCValue == LatticeFunc->getOverdefinedVal() ||
  292. SCValue == LatticeFunc->getUntrackedVal()) {
  293. // All destinations are executable!
  294. Succs.assign(TI.getNumSuccessors(), true);
  295. return;
  296. }
  297. // If undefined, neither is feasible yet.
  298. if (SCValue == LatticeFunc->getUndefVal())
  299. return;
  300. Constant *C = dyn_cast_or_null<Constant>(LatticeFunc->GetValueFromLatticeVal(
  301. std::move(SCValue), SI.getCondition()->getType()));
  302. if (!C || !isa<ConstantInt>(C)) {
  303. // All destinations are executable!
  304. Succs.assign(TI.getNumSuccessors(), true);
  305. return;
  306. }
  307. SwitchInst::CaseHandle Case = *SI.findCaseValue(cast<ConstantInt>(C));
  308. Succs[Case.getSuccessorIndex()] = true;
  309. }
  310. template <class LatticeKey, class LatticeVal, class KeyInfo>
  311. bool SparseSolver<LatticeKey, LatticeVal, KeyInfo>::isEdgeFeasible(
  312. BasicBlock *From, BasicBlock *To, bool AggressiveUndef) {
  313. SmallVector<bool, 16> SuccFeasible;
  314. Instruction *TI = From->getTerminator();
  315. getFeasibleSuccessors(*TI, SuccFeasible, AggressiveUndef);
  316. for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
  317. if (TI->getSuccessor(i) == To && SuccFeasible[i])
  318. return true;
  319. return false;
  320. }
  321. template <class LatticeKey, class LatticeVal, class KeyInfo>
  322. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::visitTerminator(
  323. Instruction &TI) {
  324. SmallVector<bool, 16> SuccFeasible;
  325. getFeasibleSuccessors(TI, SuccFeasible, true);
  326. BasicBlock *BB = TI.getParent();
  327. // Mark all feasible successors executable...
  328. for (unsigned i = 0, e = SuccFeasible.size(); i != e; ++i)
  329. if (SuccFeasible[i])
  330. markEdgeExecutable(BB, TI.getSuccessor(i));
  331. }
  332. template <class LatticeKey, class LatticeVal, class KeyInfo>
  333. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::visitPHINode(PHINode &PN) {
  334. // The lattice function may store more information on a PHINode than could be
  335. // computed from its incoming values. For example, SSI form stores its sigma
  336. // functions as PHINodes with a single incoming value.
  337. if (LatticeFunc->IsSpecialCasedPHI(&PN)) {
  338. DenseMap<LatticeKey, LatticeVal> ChangedValues;
  339. LatticeFunc->ComputeInstructionState(PN, ChangedValues, *this);
  340. for (auto &ChangedValue : ChangedValues)
  341. if (ChangedValue.second != LatticeFunc->getUntrackedVal())
  342. UpdateState(std::move(ChangedValue.first),
  343. std::move(ChangedValue.second));
  344. return;
  345. }
  346. LatticeKey Key = KeyInfo::getLatticeKeyFromValue(&PN);
  347. LatticeVal PNIV = getValueState(Key);
  348. LatticeVal Overdefined = LatticeFunc->getOverdefinedVal();
  349. // If this value is already overdefined (common) just return.
  350. if (PNIV == Overdefined || PNIV == LatticeFunc->getUntrackedVal())
  351. return; // Quick exit
  352. // Super-extra-high-degree PHI nodes are unlikely to ever be interesting,
  353. // and slow us down a lot. Just mark them overdefined.
  354. if (PN.getNumIncomingValues() > 64) {
  355. UpdateState(Key, Overdefined);
  356. return;
  357. }
  358. // Look at all of the executable operands of the PHI node. If any of them
  359. // are overdefined, the PHI becomes overdefined as well. Otherwise, ask the
  360. // transfer function to give us the merge of the incoming values.
  361. for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) {
  362. // If the edge is not yet known to be feasible, it doesn't impact the PHI.
  363. if (!isEdgeFeasible(PN.getIncomingBlock(i), PN.getParent(), true))
  364. continue;
  365. // Merge in this value.
  366. LatticeVal OpVal =
  367. getValueState(KeyInfo::getLatticeKeyFromValue(PN.getIncomingValue(i)));
  368. if (OpVal != PNIV)
  369. PNIV = LatticeFunc->MergeValues(PNIV, OpVal);
  370. if (PNIV == Overdefined)
  371. break; // Rest of input values don't matter.
  372. }
  373. // Update the PHI with the compute value, which is the merge of the inputs.
  374. UpdateState(Key, PNIV);
  375. }
  376. template <class LatticeKey, class LatticeVal, class KeyInfo>
  377. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::visitInst(Instruction &I) {
  378. // PHIs are handled by the propagation logic, they are never passed into the
  379. // transfer functions.
  380. if (PHINode *PN = dyn_cast<PHINode>(&I))
  381. return visitPHINode(*PN);
  382. // Otherwise, ask the transfer function what the result is. If this is
  383. // something that we care about, remember it.
  384. DenseMap<LatticeKey, LatticeVal> ChangedValues;
  385. LatticeFunc->ComputeInstructionState(I, ChangedValues, *this);
  386. for (auto &ChangedValue : ChangedValues)
  387. if (ChangedValue.second != LatticeFunc->getUntrackedVal())
  388. UpdateState(ChangedValue.first, ChangedValue.second);
  389. if (I.isTerminator())
  390. visitTerminator(I);
  391. }
  392. template <class LatticeKey, class LatticeVal, class KeyInfo>
  393. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::Solve() {
  394. // Process the work lists until they are empty!
  395. while (!BBWorkList.empty() || !ValueWorkList.empty()) {
  396. // Process the value work list.
  397. while (!ValueWorkList.empty()) {
  398. Value *V = ValueWorkList.pop_back_val();
  399. LLVM_DEBUG(dbgs() << "\nPopped off V-WL: " << *V << "\n");
  400. // "V" got into the work list because it made a transition. See if any
  401. // users are both live and in need of updating.
  402. for (User *U : V->users())
  403. if (Instruction *Inst = dyn_cast<Instruction>(U))
  404. if (BBExecutable.count(Inst->getParent())) // Inst is executable?
  405. visitInst(*Inst);
  406. }
  407. // Process the basic block work list.
  408. while (!BBWorkList.empty()) {
  409. BasicBlock *BB = BBWorkList.pop_back_val();
  410. LLVM_DEBUG(dbgs() << "\nPopped off BBWL: " << *BB);
  411. // Notify all instructions in this basic block that they are newly
  412. // executable.
  413. for (Instruction &I : *BB)
  414. visitInst(I);
  415. }
  416. }
  417. }
  418. template <class LatticeKey, class LatticeVal, class KeyInfo>
  419. void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::Print(
  420. raw_ostream &OS) const {
  421. if (ValueState.empty())
  422. return;
  423. LatticeKey Key;
  424. LatticeVal LV;
  425. OS << "ValueState:\n";
  426. for (auto &Entry : ValueState) {
  427. std::tie(Key, LV) = Entry;
  428. if (LV == LatticeFunc->getUntrackedVal())
  429. continue;
  430. OS << "\t";
  431. LatticeFunc->PrintLatticeVal(LV, OS);
  432. OS << ": ";
  433. LatticeFunc->PrintLatticeKey(Key, OS);
  434. OS << "\n";
  435. }
  436. }
  437. } // end namespace llvm
  438. #undef DEBUG_TYPE
  439. #endif // LLVM_ANALYSIS_SPARSEPROPAGATION_H
  440. #ifdef __GNUC__
  441. #pragma GCC diagnostic pop
  442. #endif