1 //===-- ConstraintElimination.cpp - Eliminate conds using constraints. ----===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // Eliminate conditions based on constraints collected from dominating 10 // conditions. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #include "llvm/Transforms/Scalar/ConstraintElimination.h" 15 #include "llvm/ADT/STLExtras.h" 16 #include "llvm/ADT/ScopeExit.h" 17 #include "llvm/ADT/SmallVector.h" 18 #include "llvm/ADT/Statistic.h" 19 #include "llvm/Analysis/ConstraintSystem.h" 20 #include "llvm/Analysis/GlobalsModRef.h" 21 #include "llvm/Analysis/ValueTracking.h" 22 #include "llvm/IR/DataLayout.h" 23 #include "llvm/IR/Dominators.h" 24 #include "llvm/IR/Function.h" 25 #include "llvm/IR/Instructions.h" 26 #include "llvm/IR/PatternMatch.h" 27 #include "llvm/InitializePasses.h" 28 #include "llvm/Pass.h" 29 #include "llvm/Support/Debug.h" 30 #include "llvm/Support/DebugCounter.h" 31 #include "llvm/Transforms/Scalar.h" 32 33 #include <string> 34 35 using namespace llvm; 36 using namespace PatternMatch; 37 38 #define DEBUG_TYPE "constraint-elimination" 39 40 STATISTIC(NumCondsRemoved, "Number of instructions removed"); 41 DEBUG_COUNTER(EliminatedCounter, "conds-eliminated", 42 "Controls which conditions are eliminated"); 43 44 static int64_t MaxConstraintValue = std::numeric_limits<int64_t>::max(); 45 46 namespace { 47 struct ConstraintTy { 48 SmallVector<int64_t, 8> Coefficients; 49 50 ConstraintTy(SmallVector<int64_t, 8> Coefficients) 51 : Coefficients(Coefficients) {} 52 53 unsigned size() const { return Coefficients.size(); } 54 }; 55 56 /// Struct to manage a list of constraints. 57 struct ConstraintListTy { 58 SmallVector<ConstraintTy, 4> Constraints; 59 60 ConstraintListTy() {} 61 62 ConstraintListTy(const SmallVector<ConstraintTy, 4> &Constraints) 63 : Constraints(Constraints) {} 64 65 void mergeIn(const ConstraintListTy &Other) { 66 append_range(Constraints, Other.Constraints); 67 } 68 69 unsigned size() const { return Constraints.size(); } 70 71 unsigned empty() const { return Constraints.empty(); } 72 73 /// Returns true if any constraint has a non-zero coefficient for any of the 74 /// newly added indices. Zero coefficients for new indices are removed. If it 75 /// returns true, no new variable need to be added to the system. 76 bool needsNewIndices(const DenseMap<Value *, unsigned> &NewIndices) { 77 assert(size() == 1); 78 for (unsigned I = 0; I < NewIndices.size(); ++I) { 79 int64_t Last = get(0).Coefficients.pop_back_val(); 80 if (Last != 0) 81 return true; 82 } 83 return false; 84 } 85 86 ConstraintTy &get(unsigned I) { return Constraints[I]; } 87 }; 88 89 } // namespace 90 91 // Decomposes \p V into a vector of pairs of the form { c, X } where c * X. The 92 // sum of the pairs equals \p V. The first pair is the constant-factor and X 93 // must be nullptr. If the expression cannot be decomposed, returns an empty 94 // vector. 95 static SmallVector<std::pair<int64_t, Value *>, 4> decompose(Value *V) { 96 if (auto *CI = dyn_cast<ConstantInt>(V)) { 97 if (CI->isNegative() || CI->uge(MaxConstraintValue)) 98 return {}; 99 return {{CI->getSExtValue(), nullptr}}; 100 } 101 auto *GEP = dyn_cast<GetElementPtrInst>(V); 102 if (GEP && GEP->getNumOperands() == 2 && GEP->isInBounds()) { 103 Value *Op0, *Op1; 104 ConstantInt *CI; 105 106 // If the index is zero-extended, it is guaranteed to be positive. 107 if (match(GEP->getOperand(GEP->getNumOperands() - 1), 108 m_ZExt(m_Value(Op0)))) { 109 if (match(Op0, m_NUWShl(m_Value(Op1), m_ConstantInt(CI)))) 110 return {{0, nullptr}, 111 {1, GEP->getPointerOperand()}, 112 {std::pow(int64_t(2), CI->getSExtValue()), Op1}}; 113 if (match(Op0, m_NSWAdd(m_Value(Op1), m_ConstantInt(CI)))) 114 return {{CI->getSExtValue(), nullptr}, 115 {1, GEP->getPointerOperand()}, 116 {1, Op1}}; 117 return {{0, nullptr}, {1, GEP->getPointerOperand()}, {1, Op0}}; 118 } 119 120 if (match(GEP->getOperand(GEP->getNumOperands() - 1), m_ConstantInt(CI)) && 121 !CI->isNegative()) 122 return {{CI->getSExtValue(), nullptr}, {1, GEP->getPointerOperand()}}; 123 124 SmallVector<std::pair<int64_t, Value *>, 4> Result; 125 if (match(GEP->getOperand(GEP->getNumOperands() - 1), 126 m_NUWShl(m_Value(Op0), m_ConstantInt(CI)))) 127 Result = {{0, nullptr}, 128 {1, GEP->getPointerOperand()}, 129 {std::pow(int64_t(2), CI->getSExtValue()), Op0}}; 130 else if (match(GEP->getOperand(GEP->getNumOperands() - 1), 131 m_NSWAdd(m_Value(Op0), m_ConstantInt(CI)))) 132 Result = {{CI->getSExtValue(), nullptr}, 133 {1, GEP->getPointerOperand()}, 134 {1, Op0}}; 135 else { 136 Op0 = GEP->getOperand(GEP->getNumOperands() - 1); 137 Result = {{0, nullptr}, {1, GEP->getPointerOperand()}, {1, Op0}}; 138 } 139 return Result; 140 } 141 142 Value *Op0; 143 if (match(V, m_ZExt(m_Value(Op0)))) 144 V = Op0; 145 146 Value *Op1; 147 ConstantInt *CI; 148 if (match(V, m_NUWAdd(m_Value(Op0), m_ConstantInt(CI)))) 149 return {{CI->getSExtValue(), nullptr}, {1, Op0}}; 150 if (match(V, m_NUWAdd(m_Value(Op0), m_Value(Op1)))) 151 return {{0, nullptr}, {1, Op0}, {1, Op1}}; 152 153 if (match(V, m_NUWSub(m_Value(Op0), m_ConstantInt(CI)))) 154 return {{-1 * CI->getSExtValue(), nullptr}, {1, Op0}}; 155 if (match(V, m_NUWSub(m_Value(Op0), m_Value(Op1)))) 156 return {{0, nullptr}, {1, Op0}, {-1, Op1}}; 157 158 return {{0, nullptr}, {1, V}}; 159 } 160 161 /// Turn a condition \p CmpI into a vector of constraints, using indices from \p 162 /// Value2Index. Additional indices for newly discovered values are added to \p 163 /// NewIndices. 164 static ConstraintListTy 165 getConstraint(CmpInst::Predicate Pred, Value *Op0, Value *Op1, 166 const DenseMap<Value *, unsigned> &Value2Index, 167 DenseMap<Value *, unsigned> &NewIndices) { 168 int64_t Offset1 = 0; 169 int64_t Offset2 = 0; 170 171 // First try to look up \p V in Value2Index and NewIndices. Otherwise add a 172 // new entry to NewIndices. 173 auto GetOrAddIndex = [&Value2Index, &NewIndices](Value *V) -> unsigned { 174 auto V2I = Value2Index.find(V); 175 if (V2I != Value2Index.end()) 176 return V2I->second; 177 auto NewI = NewIndices.find(V); 178 if (NewI != NewIndices.end()) 179 return NewI->second; 180 auto Insert = 181 NewIndices.insert({V, Value2Index.size() + NewIndices.size() + 1}); 182 return Insert.first->second; 183 }; 184 185 if (Pred == CmpInst::ICMP_UGT || Pred == CmpInst::ICMP_UGE) 186 return getConstraint(CmpInst::getSwappedPredicate(Pred), Op1, Op0, 187 Value2Index, NewIndices); 188 189 if (Pred == CmpInst::ICMP_EQ) { 190 if (match(Op1, m_Zero())) 191 return getConstraint(CmpInst::ICMP_ULE, Op0, Op1, Value2Index, 192 NewIndices); 193 194 auto A = 195 getConstraint(CmpInst::ICMP_UGE, Op0, Op1, Value2Index, NewIndices); 196 auto B = 197 getConstraint(CmpInst::ICMP_ULE, Op0, Op1, Value2Index, NewIndices); 198 A.mergeIn(B); 199 return A; 200 } 201 202 if (Pred == CmpInst::ICMP_NE && match(Op1, m_Zero())) { 203 return getConstraint(CmpInst::ICMP_UGT, Op0, Op1, Value2Index, NewIndices); 204 } 205 206 // Only ULE and ULT predicates are supported at the moment. 207 if (Pred != CmpInst::ICMP_ULE && Pred != CmpInst::ICMP_ULT) 208 return {}; 209 210 auto ADec = decompose(Op0->stripPointerCastsSameRepresentation()); 211 auto BDec = decompose(Op1->stripPointerCastsSameRepresentation()); 212 // Skip if decomposing either of the values failed. 213 if (ADec.empty() || BDec.empty()) 214 return {}; 215 216 // Skip trivial constraints without any variables. 217 if (ADec.size() == 1 && BDec.size() == 1) 218 return {}; 219 220 Offset1 = ADec[0].first; 221 Offset2 = BDec[0].first; 222 Offset1 *= -1; 223 224 // Create iterator ranges that skip the constant-factor. 225 auto VariablesA = llvm::drop_begin(ADec); 226 auto VariablesB = llvm::drop_begin(BDec); 227 228 // Make sure all variables have entries in Value2Index or NewIndices. 229 for (const auto &KV : 230 concat<std::pair<int64_t, Value *>>(VariablesA, VariablesB)) 231 GetOrAddIndex(KV.second); 232 233 // Build result constraint, by first adding all coefficients from A and then 234 // subtracting all coefficients from B. 235 SmallVector<int64_t, 8> R(Value2Index.size() + NewIndices.size() + 1, 0); 236 for (const auto &KV : VariablesA) 237 R[GetOrAddIndex(KV.second)] += KV.first; 238 239 for (const auto &KV : VariablesB) 240 R[GetOrAddIndex(KV.second)] -= KV.first; 241 242 R[0] = Offset1 + Offset2 + (Pred == CmpInst::ICMP_ULT ? -1 : 0); 243 return {{R}}; 244 } 245 246 static ConstraintListTy 247 getConstraint(CmpInst *Cmp, const DenseMap<Value *, unsigned> &Value2Index, 248 DenseMap<Value *, unsigned> &NewIndices) { 249 return getConstraint(Cmp->getPredicate(), Cmp->getOperand(0), 250 Cmp->getOperand(1), Value2Index, NewIndices); 251 } 252 253 namespace { 254 /// Represents either a condition that holds on entry to a block or a basic 255 /// block, with their respective Dominator DFS in and out numbers. 256 struct ConstraintOrBlock { 257 unsigned NumIn; 258 unsigned NumOut; 259 bool IsBlock; 260 bool Not; 261 union { 262 BasicBlock *BB; 263 CmpInst *Condition; 264 }; 265 266 ConstraintOrBlock(DomTreeNode *DTN) 267 : NumIn(DTN->getDFSNumIn()), NumOut(DTN->getDFSNumOut()), IsBlock(true), 268 BB(DTN->getBlock()) {} 269 ConstraintOrBlock(DomTreeNode *DTN, CmpInst *Condition, bool Not) 270 : NumIn(DTN->getDFSNumIn()), NumOut(DTN->getDFSNumOut()), IsBlock(false), 271 Not(Not), Condition(Condition) {} 272 }; 273 274 struct StackEntry { 275 unsigned NumIn; 276 unsigned NumOut; 277 CmpInst *Condition; 278 bool IsNot; 279 280 StackEntry(unsigned NumIn, unsigned NumOut, CmpInst *Condition, bool IsNot) 281 : NumIn(NumIn), NumOut(NumOut), Condition(Condition), IsNot(IsNot) {} 282 }; 283 } // namespace 284 285 #ifndef NDEBUG 286 static void dumpWithNames(ConstraintTy &C, 287 DenseMap<Value *, unsigned> &Value2Index) { 288 SmallVector<std::string> Names(Value2Index.size(), ""); 289 for (auto &KV : Value2Index) { 290 Names[KV.second - 1] = std::string("%") + KV.first->getName().str(); 291 } 292 ConstraintSystem CS; 293 CS.addVariableRowFill(C.Coefficients); 294 CS.dump(Names); 295 } 296 #endif 297 298 static bool eliminateConstraints(Function &F, DominatorTree &DT) { 299 bool Changed = false; 300 DT.updateDFSNumbers(); 301 ConstraintSystem CS; 302 303 SmallVector<ConstraintOrBlock, 64> WorkList; 304 305 // First, collect conditions implied by branches and blocks with their 306 // Dominator DFS in and out numbers. 307 for (BasicBlock &BB : F) { 308 if (!DT.getNode(&BB)) 309 continue; 310 WorkList.emplace_back(DT.getNode(&BB)); 311 312 // True as long as long as the current instruction is guaranteed to execute. 313 bool GuaranteedToExecute = true; 314 // Scan BB for assume calls. 315 // TODO: also use this scan to queue conditions to simplify, so we can 316 // interleave facts from assumes and conditions to simplify in a single 317 // basic block. And to skip another traversal of each basic block when 318 // simplifying. 319 for (Instruction &I : BB) { 320 Value *Cond; 321 // For now, just handle assumes with a single compare as condition. 322 if (match(&I, m_Intrinsic<Intrinsic::assume>(m_Value(Cond))) && 323 isa<CmpInst>(Cond)) { 324 if (GuaranteedToExecute) { 325 // The assume is guaranteed to execute when BB is entered, hence Cond 326 // holds on entry to BB. 327 WorkList.emplace_back(DT.getNode(&BB), cast<CmpInst>(Cond), false); 328 } else { 329 // Otherwise the condition only holds in the successors. 330 for (BasicBlock *Succ : successors(&BB)) 331 WorkList.emplace_back(DT.getNode(Succ), cast<CmpInst>(Cond), false); 332 } 333 } 334 GuaranteedToExecute &= isGuaranteedToTransferExecutionToSuccessor(&I); 335 } 336 337 auto *Br = dyn_cast<BranchInst>(BB.getTerminator()); 338 if (!Br || !Br->isConditional()) 339 continue; 340 341 // Returns true if we can add a known condition from BB to its successor 342 // block Succ. Each predecessor of Succ can either be BB or be dominated by 343 // Succ (e.g. the case when adding a condition from a pre-header to a loop 344 // header). 345 auto CanAdd = [&BB, &DT](BasicBlock *Succ) { 346 assert(isa<BranchInst>(BB.getTerminator())); 347 return any_of(successors(&BB), 348 [Succ](const BasicBlock *S) { return S != Succ; }) && 349 all_of(predecessors(Succ), [&BB, &DT, Succ](BasicBlock *Pred) { 350 return Pred == &BB || DT.dominates(Succ, Pred); 351 }); 352 }; 353 // If the condition is an OR of 2 compares and the false successor only has 354 // the current block as predecessor, queue both negated conditions for the 355 // false successor. 356 Value *Op0, *Op1; 357 if (match(Br->getCondition(), m_LogicalOr(m_Value(Op0), m_Value(Op1))) && 358 match(Op0, m_Cmp()) && match(Op1, m_Cmp())) { 359 BasicBlock *FalseSuccessor = Br->getSuccessor(1); 360 if (CanAdd(FalseSuccessor)) { 361 WorkList.emplace_back(DT.getNode(FalseSuccessor), cast<CmpInst>(Op0), 362 true); 363 WorkList.emplace_back(DT.getNode(FalseSuccessor), cast<CmpInst>(Op1), 364 true); 365 } 366 continue; 367 } 368 369 // If the condition is an AND of 2 compares and the true successor only has 370 // the current block as predecessor, queue both conditions for the true 371 // successor. 372 if (match(Br->getCondition(), m_LogicalAnd(m_Value(Op0), m_Value(Op1))) && 373 match(Op0, m_Cmp()) && match(Op1, m_Cmp())) { 374 BasicBlock *TrueSuccessor = Br->getSuccessor(0); 375 if (CanAdd(TrueSuccessor)) { 376 WorkList.emplace_back(DT.getNode(TrueSuccessor), cast<CmpInst>(Op0), 377 false); 378 WorkList.emplace_back(DT.getNode(TrueSuccessor), cast<CmpInst>(Op1), 379 false); 380 } 381 continue; 382 } 383 384 auto *CmpI = dyn_cast<CmpInst>(Br->getCondition()); 385 if (!CmpI) 386 continue; 387 if (CanAdd(Br->getSuccessor(0))) 388 WorkList.emplace_back(DT.getNode(Br->getSuccessor(0)), CmpI, false); 389 if (CanAdd(Br->getSuccessor(1))) 390 WorkList.emplace_back(DT.getNode(Br->getSuccessor(1)), CmpI, true); 391 } 392 393 // Next, sort worklist by dominance, so that dominating blocks and conditions 394 // come before blocks and conditions dominated by them. If a block and a 395 // condition have the same numbers, the condition comes before the block, as 396 // it holds on entry to the block. 397 sort(WorkList, [](const ConstraintOrBlock &A, const ConstraintOrBlock &B) { 398 return std::tie(A.NumIn, A.IsBlock) < std::tie(B.NumIn, B.IsBlock); 399 }); 400 401 // Finally, process ordered worklist and eliminate implied conditions. 402 SmallVector<StackEntry, 16> DFSInStack; 403 DenseMap<Value *, unsigned> Value2Index; 404 for (ConstraintOrBlock &CB : WorkList) { 405 // First, pop entries from the stack that are out-of-scope for CB. Remove 406 // the corresponding entry from the constraint system. 407 while (!DFSInStack.empty()) { 408 auto &E = DFSInStack.back(); 409 LLVM_DEBUG(dbgs() << "Top of stack : " << E.NumIn << " " << E.NumOut 410 << "\n"); 411 LLVM_DEBUG(dbgs() << "CB: " << CB.NumIn << " " << CB.NumOut << "\n"); 412 assert(E.NumIn <= CB.NumIn); 413 if (CB.NumOut <= E.NumOut) 414 break; 415 LLVM_DEBUG(dbgs() << "Removing " << *E.Condition << " " << E.IsNot 416 << "\n"); 417 DFSInStack.pop_back(); 418 CS.popLastConstraint(); 419 } 420 421 LLVM_DEBUG({ 422 dbgs() << "Processing "; 423 if (CB.IsBlock) 424 dbgs() << *CB.BB; 425 else 426 dbgs() << *CB.Condition; 427 dbgs() << "\n"; 428 }); 429 430 // For a block, check if any CmpInsts become known based on the current set 431 // of constraints. 432 if (CB.IsBlock) { 433 for (Instruction &I : *CB.BB) { 434 auto *Cmp = dyn_cast<CmpInst>(&I); 435 if (!Cmp) 436 continue; 437 438 DenseMap<Value *, unsigned> NewIndices; 439 auto R = getConstraint(Cmp, Value2Index, NewIndices); 440 if (R.size() != 1) 441 continue; 442 443 if (R.needsNewIndices(NewIndices)) 444 continue; 445 446 if (CS.isConditionImplied(R.get(0).Coefficients)) { 447 if (!DebugCounter::shouldExecute(EliminatedCounter)) 448 continue; 449 450 LLVM_DEBUG(dbgs() << "Condition " << *Cmp 451 << " implied by dominating constraints\n"); 452 LLVM_DEBUG({ 453 for (auto &E : reverse(DFSInStack)) 454 dbgs() << " C " << *E.Condition << " " << E.IsNot << "\n"; 455 }); 456 Cmp->replaceUsesWithIf( 457 ConstantInt::getTrue(F.getParent()->getContext()), [](Use &U) { 458 // Conditions in an assume trivially simplify to true. Skip uses 459 // in assume calls to not destroy the available information. 460 auto *II = dyn_cast<IntrinsicInst>(U.getUser()); 461 return !II || II->getIntrinsicID() != Intrinsic::assume; 462 }); 463 NumCondsRemoved++; 464 Changed = true; 465 } 466 if (CS.isConditionImplied( 467 ConstraintSystem::negate(R.get(0).Coefficients))) { 468 if (!DebugCounter::shouldExecute(EliminatedCounter)) 469 continue; 470 471 LLVM_DEBUG(dbgs() << "Condition !" << *Cmp 472 << " implied by dominating constraints\n"); 473 LLVM_DEBUG({ 474 for (auto &E : reverse(DFSInStack)) 475 dbgs() << " C " << *E.Condition << " " << E.IsNot << "\n"; 476 }); 477 Cmp->replaceAllUsesWith( 478 ConstantInt::getFalse(F.getParent()->getContext())); 479 NumCondsRemoved++; 480 Changed = true; 481 } 482 } 483 continue; 484 } 485 486 // Set up a function to restore the predicate at the end of the scope if it 487 // has been negated. Negate the predicate in-place, if required. 488 auto *CI = dyn_cast<CmpInst>(CB.Condition); 489 auto PredicateRestorer = make_scope_exit([CI, &CB]() { 490 if (CB.Not && CI) 491 CI->setPredicate(CI->getInversePredicate()); 492 }); 493 if (CB.Not) { 494 if (CI) { 495 CI->setPredicate(CI->getInversePredicate()); 496 } else { 497 LLVM_DEBUG(dbgs() << "Can only negate compares so far.\n"); 498 continue; 499 } 500 } 501 502 // Otherwise, add the condition to the system and stack, if we can transform 503 // it into a constraint. 504 DenseMap<Value *, unsigned> NewIndices; 505 auto R = getConstraint(CB.Condition, Value2Index, NewIndices); 506 if (R.empty()) 507 continue; 508 509 for (auto &KV : NewIndices) 510 Value2Index.insert(KV); 511 512 LLVM_DEBUG(dbgs() << "Adding " << *CB.Condition << " " << CB.Not << "\n"); 513 bool Added = false; 514 for (auto &C : R.Constraints) { 515 auto Coeffs = C.Coefficients; 516 LLVM_DEBUG({ 517 dbgs() << " constraint: "; 518 dumpWithNames(C, Value2Index); 519 }); 520 Added |= CS.addVariableRowFill(Coeffs); 521 // If R has been added to the system, queue it for removal once it goes 522 // out-of-scope. 523 if (Added) 524 DFSInStack.emplace_back(CB.NumIn, CB.NumOut, CB.Condition, CB.Not); 525 } 526 } 527 528 assert(CS.size() == DFSInStack.size() && 529 "updates to CS and DFSInStack are out of sync"); 530 return Changed; 531 } 532 533 PreservedAnalyses ConstraintEliminationPass::run(Function &F, 534 FunctionAnalysisManager &AM) { 535 auto &DT = AM.getResult<DominatorTreeAnalysis>(F); 536 if (!eliminateConstraints(F, DT)) 537 return PreservedAnalyses::all(); 538 539 PreservedAnalyses PA; 540 PA.preserve<DominatorTreeAnalysis>(); 541 PA.preserveSet<CFGAnalyses>(); 542 return PA; 543 } 544 545 namespace { 546 547 class ConstraintElimination : public FunctionPass { 548 public: 549 static char ID; 550 551 ConstraintElimination() : FunctionPass(ID) { 552 initializeConstraintEliminationPass(*PassRegistry::getPassRegistry()); 553 } 554 555 bool runOnFunction(Function &F) override { 556 auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree(); 557 return eliminateConstraints(F, DT); 558 } 559 560 void getAnalysisUsage(AnalysisUsage &AU) const override { 561 AU.setPreservesCFG(); 562 AU.addRequired<DominatorTreeWrapperPass>(); 563 AU.addPreserved<GlobalsAAWrapperPass>(); 564 AU.addPreserved<DominatorTreeWrapperPass>(); 565 } 566 }; 567 568 } // end anonymous namespace 569 570 char ConstraintElimination::ID = 0; 571 572 INITIALIZE_PASS_BEGIN(ConstraintElimination, "constraint-elimination", 573 "Constraint Elimination", false, false) 574 INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) 575 INITIALIZE_PASS_DEPENDENCY(LazyValueInfoWrapperPass) 576 INITIALIZE_PASS_END(ConstraintElimination, "constraint-elimination", 577 "Constraint Elimination", false, false) 578 579 FunctionPass *llvm::createConstraintEliminationPass() { 580 return new ConstraintElimination(); 581 } 582