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

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 06:11:12 PST 2018


nemanjai 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
----------------
efriedma wrote:
> 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.
OK, thanks. I'll try to switch to DenseSet.

This is called from TTI during `InlineCost` calculations.


Repository:
  rL LLVM

https://reviews.llvm.org/D41029





More information about the llvm-commits mailing list