summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-06-13 19:27:56 +0000
committerPhilip Reames <listmail@philipreames.com>2019-06-13 19:27:56 +0000
commit038e01dc9a728bdb299953c5839196f697f3f79b (patch)
tree973b87c9b3810bfb87f40e58e532caaf4021d697 /llvm/lib/Analysis/ValueTracking.cpp
parent79ec1a29572e178c117221d55da2e98caccfcc7a (diff)
downloadbcm5719-llvm-038e01dc9a728bdb299953c5839196f697f3f79b.tar.gz
bcm5719-llvm-038e01dc9a728bdb299953c5839196f697f3f79b.zip
Add a clarifying comment about branching on poison
I recently got this wrong (again), and I'm sure I'm not the only one. Put a comment in the logical place someone would look to "fix" the obvious "missed optimization" which arrises based on the common misunderstanding. Hopefully, this will save others time. :) llvm-svn: 363318
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index be6efba3db0..bfea8fc3c50 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -4388,6 +4388,10 @@ const Value *llvm::getGuaranteedNonFullPoisonOp(const Instruction *I) {
return I->getOperand(1);
default:
+ // Note: It's really tempting to think that a conditional branch or
+ // switch should be listed here, but that's incorrect. It's not
+ // branching off of poison which is UB, it is executing a side effecting
+ // instruction which follows the branch.
return nullptr;
}
}
OpenPOWER on IntegriCloud