[PATCH] D24759: [RFC][StaticAnalyser] fix unreachable code false positives when block numbers mismatch

Daniel Marjamäki via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 05:07:17 PDT 2016


danielmarjamaki added inline comments.

================
Comment at: lib/Analysis/CFG.cpp:2986
@@ -2985,3 +2985,1 @@
 
-    if (!KnownVal.isFalse()) {
-      // Add an intermediate block between the BodyBlock and the
----------------
dcoughlin wrote:
> You need to keep this check so that the optimized CFG still removes edges that are trivially known to be false.
Thanks

================
Comment at: lib/Analysis/CFG.cpp:2994
@@ -2993,3 @@
-      Succ = BodyBlock;
-      CFGBlock *LoopBackBlock = createBlock();
-      LoopBackBlock->setLoopTarget(D);
----------------
dcoughlin wrote:
> To keep the unoptimized and optimized blocks in sync, this block creation needs to be done regardless of whether the branch condition is known to be false. My advice would be to hoist the creation (and the FIXME comments)  to above the check for whether KnownVal is false.
Thanks


https://reviews.llvm.org/D24759





More information about the cfe-commits mailing list