[PATCH] D24147: Lower consecutive select instructions correctly.

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 12:16:09 PDT 2016


davidxl added inline comments.

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4601
@@ +4600,3 @@
+
+  // Increment the current iterator to skip all the rest of select instructions
+  // because they will be either "not lowered" or "all lowered" to branch.
----------------
Perhaps use a local var LastSI to be ASI.back() ?

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4715
@@ +4714,3 @@
+  INS.insert(ASI.begin(), ASI.end());
+  for (auto It = ASI.rbegin(); It != ASI.rend(); ++It) {
+    SelectInst *SI = *It;
----------------
Add a comment about using reverse iterator.

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4722
@@ +4721,3 @@
+    Value *FI = SI->getFalseValue();
+    for (SelectInst *TSI = dyn_cast<SelectInst>(TI); TSI && INS.count(TSI);
+         TSI = dyn_cast<SelectInst>(TI))
----------------
Add a comment here describing the situation.


https://reviews.llvm.org/D24147





More information about the llvm-commits mailing list