[llvm] 75ca712 - [NFC] Use new canCreatePoison to make code intent more clear in PoisonChecking
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 15 14:49:05 PDT 2020
Author: Philip Reames
Date: 2020-04-15T14:48:53-07:00
New Revision: 75ca7127bc1111c8ef7ef68c8c1e7e48bea666f2
URL: https://github.com/llvm/llvm-project/commit/75ca7127bc1111c8ef7ef68c8c1e7e48bea666f2
DIFF: https://github.com/llvm/llvm-project/commit/75ca7127bc1111c8ef7ef68c8c1e7e48bea666f2.diff
LOG: [NFC] Use new canCreatePoison to make code intent more clear in PoisonChecking
Added:
Modified:
llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp b/llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
index f25b05724198..a86d57a38071 100644
--- a/llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
@@ -192,6 +192,8 @@ static Value* generatePoisonChecks(Instruction &I) {
// Handle non-binops seperately
switch (I.getOpcode()) {
default:
+ // Note there are a couple of missing cases here, once implemented, this
+ // should become an llvm_unreachable.
break;
case Instruction::ExtractElement: {
Value *Vec = I.getOperand(0);
@@ -296,8 +298,9 @@ static bool rewrite(Function &F) {
for (Value *V : I.operands())
Checks.push_back(getPoisonFor(ValToPoison, V));
- if (auto *Check = generatePoisonChecks(I))
- Checks.push_back(Check);
+ if (canCreatePoison(&I))
+ if (auto *Check = generatePoisonChecks(I))
+ Checks.push_back(Check);
ValToPoison[&I] = buildOrChain(B, Checks);
}
More information about the llvm-commits
mailing list