[PATCH] D11566: Fix FlattenCFG to invert test when different index is encountered, and add one more operator to invert.

Jan Sjödin via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 12:01:29 PDT 2015


jsjodin added inline comments.

================
Comment at: lib/Transforms/Utils/FlattenCFG.cpp:202
@@ -201,3 +201,3 @@
       Idx = CIdx;
-    else if (CIdx != Idx)
-      return false;
+    else if (CIdx != Idx) {
+      bool EverChanged = false;
----------------
hfinkel wrote:
> I think that I'm missing something here: We currently might perform this change when CIdx == Idx, and with this patch, we only ever do it when CIdx != Idx. Don't you want to do it in both cases?
> 
I'm not sure why branch inversion should done when CIdx == Idx. It shouldn't matter which block jumps into the other from the last CondBlock, and if branch inversion is done, then the indices will no longer be the same and the optimization does not apply anymore.


http://reviews.llvm.org/D11566





More information about the llvm-commits mailing list