aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/DemandedBits.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-02-18 22:29:19 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-02-19 12:35:40 +0100
commit2f17ed294fcd8cde505b93c9c5bbab06ba59051c (patch)
treee3bad6fe386edcbee8a70a58f4ed25c6fb018965 /llvm/lib/Analysis/DemandedBits.cpp
parent529f71811b0475995f2d9cf766f18d897eec574c (diff)
downloadllvm-2f17ed294fcd8cde505b93c9c5bbab06ba59051c.zip
llvm-2f17ed294fcd8cde505b93c9c5bbab06ba59051c.tar.gz
llvm-2f17ed294fcd8cde505b93c9c5bbab06ba59051c.tar.bz2
[DCE] Don't remove non-willreturn calls
In both ADCE and BDCE (via DemandedBits) we should not remove instructions that are not guaranteed to return. This issue was pointed out by fhahn in the recent llvm-dev thread. Differential Revision: https://reviews.llvm.org/D96993
Diffstat (limited to 'llvm/lib/Analysis/DemandedBits.cpp')
-rw-r--r--llvm/lib/Analysis/DemandedBits.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DemandedBits.cpp b/llvm/lib/Analysis/DemandedBits.cpp
index 461fd72..dd11b0b 100644
--- a/llvm/lib/Analysis/DemandedBits.cpp
+++ b/llvm/lib/Analysis/DemandedBits.cpp
@@ -80,7 +80,7 @@ void DemandedBitsWrapperPass::print(raw_ostream &OS, const Module *M) const {
static bool isAlwaysLive(Instruction *I) {
return I->isTerminator() || isa<DbgInfoIntrinsic>(I) || I->isEHPad() ||
- I->mayHaveSideEffects();
+ I->mayHaveSideEffects() || !I->willReturn();
}
void DemandedBits::determineLiveOperandBits(