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 | ||
---|---|---|
729 | Should just change the insert point for the existing one? This loses the CSEInfo | |
738 | Don't need the {} | |
744 | Why depend on "legal" types? The concept should mostly be going away | |
757 | 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 | |
776 | Don't need getReg | |
790 | Same as above | |
795 | Don't need = 0 | |
940 | Missing newline |
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
---|---|---|
784 | Move Doxygen comment to IRTranslator.h? Also this comment isn't super useful. |
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
---|---|---|
769 | Still have the .getReg not that it really matters |
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | ||
---|---|---|
769 | I'll remove it before commit. |
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-switch-bittest.ll | ||
---|---|---|
133 | 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 | ||
---|---|---|
133 | 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