[PATCH] D23939: IfConversion: Fix branch predication bug.
    David Li via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Aug 26 15:21:36 PDT 2016
    
    
  
davidxl added inline comments.
================
Comment at: lib/CodeGen/IfConversion.cpp:1807
@@ -1807,1 +1806,3 @@
+    DI2++;
+  }
   while (NumDups2 != 0) {
----------------
iteratee wrote:
> davidxl wrote:
> > Why  skipping debug value here? Does that affect the NumDups2 adjustment below?
> > Does that affect the NumDups2 adjustment below?
> No. NumDups2 doesn't count debug values.
> 
> Would it be clearer if it read (DI2->isBranch() || DI2->isDebugValue())?
> 
> The goal is to skip all the branch instructions, because they have been checked to match MBB1 and don't need to predicated.
> This is where the actual crash was occurring. We were attempting to predicate the branch instruction when we didn't need to.
Ok. Can you add some comments?
Can you also add assertion to make sure that the instructions from two blocks are indeed common? 
Repository:
  rL LLVM
https://reviews.llvm.org/D23939
    
    
More information about the llvm-commits
mailing list