aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorJuneyoung Lee <aqjune@gmail.com>2020-07-22 09:30:42 +0900
committerJuneyoung Lee <aqjune@gmail.com>2020-07-22 09:31:16 +0900
commitace0bf749099c104ad50252988097c9495df7ccd (patch)
tree12223667a64e28d069cf4de5cea52eda6b22a63b /llvm/lib/Analysis/ValueTracking.cpp
parent18581fd2c441eac052a25e4cbe9bd74d6ff605ad (diff)
downloadllvm-ace0bf749099c104ad50252988097c9495df7ccd.zip
llvm-ace0bf749099c104ad50252988097c9495df7ccd.tar.gz
llvm-ace0bf749099c104ad50252988097c9495df7ccd.tar.bz2
[ValueTracking] Fix incorrect handling of canCreateUndefOrPoison
.. in isGuaranteedNotToBeUndefOrPoison. This caused early exit of isGuaranteedNotToBeUndefOrPoison, making it return imprecise result. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D84251
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index ed22718..12abe34 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -4824,10 +4824,7 @@ bool llvm::isGuaranteedNotToBeUndefOrPoison(const Value *V,
return true;
}
- if (canCreateUndefOrPoison(Opr))
- return false;
-
- if (all_of(Opr->operands(), OpCheck))
+ if (!canCreateUndefOrPoison(Opr) && all_of(Opr->operands(), OpCheck))
return true;
}