[PATCH] D33257: [JumpThreading] Replace uses of Condition safely

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 06:36:51 PDT 2017


anna marked 4 inline comments as done.
anna added inline comments.


================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:268
+  // We can unconditionally replace all uses in non-local blocks (i.e. those
+  // strictly dominated by BB), since LVI information is true from the
+  // terminator of BB.
----------------
sanjoy wrote:
> The non-local blocks need not be strictly dominated by BB, but the uses we replace will be.  The non-local blocks will not be strictly dominated in case of PHI nodes uses:
> 
> ```
> bb1:
>   br label %x
> 
> bb0:
>   assume(%cond)
>   br i1 %cond, label %x, label %y
> 
> x:
>   %v = phi i1 [ %cond, %bb0 ], [ %other_cond, %bb1 ]
> ```
> 
> I.e. the code is correct, but the comment can be more accurate.
good point! 


Repository:
  rL LLVM

https://reviews.llvm.org/D33257





More information about the llvm-commits mailing list