aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/IR/Instruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/IR/Instruction.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/IR/Instruction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/IR/Instruction.cpp b/contrib/llvm-project/llvm/lib/IR/Instruction.cpp
index 36a20679863b..bf76c89f26ca 100644
--- a/contrib/llvm-project/llvm/lib/IR/Instruction.cpp
+++ b/contrib/llvm-project/llvm/lib/IR/Instruction.cpp
@@ -492,6 +492,9 @@ static bool haveSameSpecialState(const Instruction *I1, const Instruction *I2,
if (const ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(I1))
return SVI->getShuffleMask() ==
cast<ShuffleVectorInst>(I2)->getShuffleMask();
+ if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I1))
+ return GEP->getSourceElementType() ==
+ cast<GetElementPtrInst>(I2)->getSourceElementType();
return true;
}
@@ -695,7 +698,7 @@ bool Instruction::mayHaveSideEffects() const {
bool Instruction::isSafeToRemove() const {
return (!isa<CallInst>(this) || !this->mayHaveSideEffects()) &&
- !this->isTerminator();
+ !this->isTerminator() && !this->isEHPad();
}
bool Instruction::willReturn() const {