[PATCH] D36592: [BDCE] clear poison generators after turning a value into zero (PR33695, PR34037)

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 19:50:37 PDT 2017

hfinkel added inline comments.

Comment at: lib/Transforms/Scalar/BDCE.cpp:50
+  for (User *U : I->users()) {
+    if (auto *UserInst = dyn_cast<Instruction>(U)) {
+      // NSW/NUW and exact are based on operands that might have changed.
Just to make this a little better: if any of the users are a store, call, invoke, atomicrmw, atomiccmpxchg, or return - anything that will make the value externally observable, we can stop recursing to clear the flags.

Comment at: lib/Transforms/Scalar/BDCE.cpp:54
+      // FIXME: llvm.assume and metadata may also be invalid now.
I can't think of any current metadata that would be invalidated, but assumes might indeed be.


More information about the llvm-commits mailing list