[PATCH] D19210: Teach poison value tracking that certain calls always terminate

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 00:13:09 PDT 2016


sanjoy added inline comments.

================
Comment at: lib/Analysis/ValueTracking.cpp:3289
@@ +3288,3 @@
+    // assumption (e.g. we will DCE readnone and readonly calls).
+    return CS.doesNotThrow() && CS.onlyReadsMemory();
+
----------------
majnemer wrote:
> Couldn't this just be `!I->mayHaveSideEffects()` ?
Yeah, but I didn't want to write it that way -- IMO it is only "incidental" that `mayHaveSideEffects` and what I'm computing here are the same implementation.  IOW, the predicate in the two cases (`mayHaveSideEffects` vs. "guaranteed to transfer control flow to successor") are quite different, even if they have the same implementation.


http://reviews.llvm.org/D19210





More information about the llvm-commits mailing list