This is mostly a straight port from SelectionDAG. We re-use the actual bit-test analysis part from SwitchLoweringUtils, which was factored out earlier to support jump-tables.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
---|---|---|
723 | Should just change the insert point for the existing one? This loses the CSEInfo | |
732 | Don't need the {} | |
738 | Why depend on "legal" types? The concept should mostly be going away | |
751 | This loses the address space, and I'm not sure why you would ever be avoiding the pointer type. Also, in general you should never need to call getPointerTy, since you can just re-use the type of the thing you already have | |
770 | Don't need getReg | |
784 | Same as above | |
789 | Don't need = 0 | |
934 | Missing newline |
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
---|---|---|
778 | Move Doxygen comment to IRTranslator.h? Also this comment isn't super useful. |
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
---|---|---|
763 | Still have the .getReg not that it really matters |
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
---|---|---|
763 | I'll remove it before commit. |
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-switch-bittest.ll | ||
---|---|---|
132 | Can you add a few degenerate cases with 1 and 2 switch cases (and 0 if that's even accepted). I also don't think any of these hit the omit-branch-to-next block case |
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-switch-bittest.ll | ||
---|---|---|
132 | I'll add a test to check for a single BT cluster, but 1 or 2 switch cases by themselves won't trigger this optimization, it'll just use a simple equality check. |
Add another test case for just a single BT cluster. This test also falls through instead of generating a G_BR.
Should just change the insert point for the existing one? This loses the CSEInfo