[PATCH] D24462: [ARM] Don't convert switches to lookup tables of pointers with ROPI/RWPI

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 16:29:35 PDT 2016


hans added inline comments.

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4435
@@ +4434,3 @@
+  if (!TTI.shouldBuildLookupTablesForConstant(C))
+    return false;
+
----------------
It would seem more natural to do all the target-independent checks first, and then defer to TTI for the rest.

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:5151
@@ -5145,1 +5150,3 @@
+      if (!TTI.shouldBuildLookupTablesForConstant(Value))
+        return false;
       if (!ResultLists.count(PHI))
----------------
efriedma wrote:
> Should we be calling ValidLookupTableConstant here instead of calling shouldBuildLookupTablesForConstant directly?
Isn't this check now already done in GetCaseResults?


Repository:
  rL LLVM

https://reviews.llvm.org/D24462





More information about the llvm-commits mailing list