Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
---|---|---|
4462 | Since there are only two cases, an if/else is sufficient here. |
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
---|---|---|
4462 | I'm planning to expand this to support the overflowing ops later, so it will be 10 cases eventually. Should I just change it to a switch when I start adding those other cases? |
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
---|---|---|
4462 | In that case stick with the switch. |
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
---|---|---|
4450 | This is what the existing code did. Re-reading it more closely, I'm beginning to think that the existing code didn't work for vectors at all—it ends up scalarizing the adds, and then doing carries between the lanes? Running the whole LLVM test suite (with at least AMDGPU, AArch64, and X86 enabled), nothing seems to ever use the vector code path. I think the right course here might be to remove support for vectors here, and someone can add them back properly later if they actually plan to use them. |
Add a default case assertion, mark vectors as unsupported, cleanups
Existing code seemed to not support vectors correctly. I removed vector support
and re-ran the test suite on AArch64, AMDGPU, and X86, and nothing tested the
behavior of narrowScalar on a vector add, so I think the correct course of
action is to remove support here and add it back again once someone is using
it.
Moved unreachable case to bottom of switch
(I think it ends up being more readable later.)
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
---|---|---|
4450 | I didn't realize this was just moving it. Should probably just move the code into the separate function, and separately address these other concerns |
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
---|---|---|
4450 | It's already more than just moving it because it has to change stuff to merge the add/sub case which were both written a bit differently despite doing the exact same thing, so I'm not sure where the line is exactly. |
Re-add the vector code to make it more properly an NFC commit
Putting up the little change removing the vector support in a different patch.
ping, are there any changes this still needs? I think the existing comments are sufficiently addressed given that the goal is to make this an NFC change and fix them up separately.
This is ignoring vectors