diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-11-06 21:26:32 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-11-06 21:26:32 +0000 |
commit | 7204cff0a121ebc770cf81f7f94679ae7324daae (patch) | |
tree | 05c31a6bb4c2795d9bccd8a17da44149082152c2 /llvm/lib/Transforms | |
parent | d9f87b46420998bc932bacce5f9e29b98b61fb55 (diff) | |
download | bcm5719-llvm-7204cff0a121ebc770cf81f7f94679ae7324daae.tar.gz bcm5719-llvm-7204cff0a121ebc770cf81f7f94679ae7324daae.zip |
[InstCombine] Don't RAUW tokens with undef
Let SimplifyCFG remove unreachable BBs which define token instructions.
llvm-svn: 252343
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index ac535f97bb1..f024ab1795e 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -3012,7 +3012,7 @@ static bool prepareICWorklistFromFunction(Function &F, const DataLayout &DL, while (EndInst != BB->begin()) { // Delete the next to last instruction. Instruction *Inst = &*--EndInst->getIterator(); - if (!Inst->use_empty()) + if (!Inst->use_empty() && !Inst->getType()->isTokenTy()) Inst->replaceAllUsesWith(UndefValue::get(Inst->getType())); if (Inst->isEHPad()) { EndInst = Inst; @@ -3022,7 +3022,8 @@ static bool prepareICWorklistFromFunction(Function &F, const DataLayout &DL, ++NumDeadInst; MadeIRChange = true; } - Inst->eraseFromParent(); + if (!Inst->getType()->isTokenTy()) + Inst->eraseFromParent(); } } |