forked from OSchip/llvm-project
[InstCombine] Fix a code-sinking bug after D73832/f1a9efabcb9b
- UserParent = PN->getIncomingBlock(*I->use_begin()); + UserParent = PN->getIncomingBlock(*SingleUse); The first use of I may be droppable (llvm.assume). When compiling llvm/lib/IR/AutoUpgrade.cpp with a bootstrapped clang with ThinLTO with minimized bitcode files, I see such a case in the function _ZN4llvm20UpgradeIntrinsicCallEPNS_8CallInstEPNS_8FunctionE clang -c -fthinlto-index=AutoUpgrade.o.thinlto.bc AutoUpgrade.bc -O3 Unfortunately it is really difficult to get a minimized reproduce.
This commit is contained in:
parent
d264f02c6f
commit
4c52d51e78
|
@ -3505,7 +3505,7 @@ bool InstCombiner::run() {
|
|||
|
||||
// Get the block the use occurs in.
|
||||
if (PHINode *PN = dyn_cast<PHINode>(UserInst))
|
||||
UserParent = PN->getIncomingBlock(*I->use_begin());
|
||||
UserParent = PN->getIncomingBlock(*SingleUse);
|
||||
else
|
||||
UserParent = UserInst->getParent();
|
||||
|
||||
|
|
Loading…
Reference in New Issue