[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
Wed Jan 31 11:19:01 PST 2018


efriedma added inline comments.


================
Comment at: lib/Target/PowerPC/PPCISelLowering.h:567
+    mutable std::set<JTCallBack> BlocksKnownToUseCTR;
+    mutable std::set<JTCallBack> BlocksKnownNotToUseCTR;
+    // The threshold for the number of cases a switch should have for jump
----------------
nemanjai wrote:
> I wasn't able to make `SmallPtrSet` work for my wrapper to `CallbackVH`. I think I would need to specialize pointer type traits in order to do this - if someone can point me to information about this, I'd appreciate it.
Your CallbackVH isn't a pointer, so SmallPtrSet won't work.  You could probably use DenseSet, though.  (See http://llvm.org/docs/ProgrammersManual.html#set-like-containers-std-set-smallset-setvector-etc )

Although, I'm sort of surprised you're running into issues with values getting deleted; we should only be calling this during isel.


Repository:
  rL LLVM

https://reviews.llvm.org/D41029





More information about the llvm-commits mailing list