[PATCH] D41029: [JumpTables][PowerPC] Let targets decide which switch instructions are suitable for jump tables

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 12:55:53 PST 2017


efriedma added inline comments.


================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:1178
+                                               uint64_t Range) const {
+  static std::set<const SwitchInst*> KnownNoJTSwitches;
+  if (!TargetLoweringBase::isSuitableForJumpTable(SI, NumCases, Range))
----------------
Not thread-safe.  (We support using multiple LLVMContexts at the same time in a process.)


================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:1204
+    }
+    if (mightUseCTR(It.getCaseSuccessor())) {
+      NumSwitchesNotSuitableForJT++;
----------------
This is worst-case quadratic (N switches times M instructions in the successor); you might need to cache the mightUseCTR computation.


Repository:
  rL LLVM

https://reviews.llvm.org/D41029





More information about the llvm-commits mailing list