Kill off the old SimplifyInstruction API by converting remaining users.
llvm-svn: 301673
This commit is contained in:
@@ -2231,7 +2231,7 @@ static bool FoldCondBranchOnPHI(BranchInst *BI, const DataLayout &DL,
|
||||
}
|
||||
|
||||
// Check for trivial simplification.
|
||||
if (Value *V = SimplifyInstruction(N, DL)) {
|
||||
if (Value *V = SimplifyInstruction(N, {DL, nullptr, nullptr, AC})) {
|
||||
if (!BBI->use_empty())
|
||||
TranslateMap[&*BBI] = V;
|
||||
if (!N->mayHaveSideEffects()) {
|
||||
@@ -2307,7 +2307,7 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetTransformInfo &TTI,
|
||||
|
||||
for (BasicBlock::iterator II = BB->begin(); isa<PHINode>(II);) {
|
||||
PHINode *PN = cast<PHINode>(II++);
|
||||
if (Value *V = SimplifyInstruction(PN, DL)) {
|
||||
if (Value *V = SimplifyInstruction(PN, {DL, PN})) {
|
||||
PN->replaceAllUsesWith(V);
|
||||
PN->eraseFromParent();
|
||||
continue;
|
||||
@@ -3545,7 +3545,7 @@ static bool TryToSimplifyUncondBranchWithICmpInIt(
|
||||
assert(VVal && "Should have a unique destination value");
|
||||
ICI->setOperand(0, VVal);
|
||||
|
||||
if (Value *V = SimplifyInstruction(ICI, DL)) {
|
||||
if (Value *V = SimplifyInstruction(ICI, {DL, ICI})) {
|
||||
ICI->replaceAllUsesWith(V);
|
||||
ICI->eraseFromParent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user