This was a GISel vs SDAG regression that showed up at -Os in:
SingleSource/Benchmarks/Adobe-C++/simple_types_constant_folding.test on aarch64
Details
- Reviewers
aemerson paquette arsenm - Commits
- rGa2ab765029dd: [GISel] Eliminate redundant bitmasking
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Target/GlobalISel/Combine.td | ||
---|---|---|
660 | Probably shouldn't be in this group since it doesn't use KnownBits? | |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
3008 | This doesn't use KnownBits? (If this was yoinked from somewhere else, then we probably need to update a combine. GISelKnownBits supports vectors nowadays last time I checked.) | |
3025 | Minor stylistic suggestion: if (C1 & C2) { B.buildAnd(...); return; } B.buildCopy(...); Is it actually necessary to emit the copy at all though? You could do Dst = G_CONSTANT iN 0 right? | |
llvm/test/CodeGen/AArch64/GlobalISel/opt-overlapping-and.ll | ||
1 ↗ | (On Diff #348565) | Can this be a MIR test? |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3025 | With G_AND (and other generic opcodes) we can be certain that we only have vregs. (You have to be careful with COPY instructions, but in this case, we don't have to worry.) |
llvm/test/CodeGen/AArch64/GlobalISel/opt-overlapping-and.mir | ||
---|---|---|
4 |
LGTM with some minor comments
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3022 | I think you can just do B.buildConstant(Dst, 0); and omit the replaceRegWith (similar to the buildAnd case above.) | |
llvm/test/CodeGen/AArch64/GlobalISel/opt-overlapping-and.mir | ||
44 | You shouldn't need the registers section in any of the tests here. You can also drop
(Technically you can drop tracksRegLiveness too, but it's useful if you want to test the pipeline beyond the combiner.) |
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
3022 | When I tried it that way, it wasn't RAUW-ing Dst appropriately, and then the verifier complains: *** Bad machine code: Reading virtual register without a def *** - function: bitmask_no_overlap - basic block: %bb.0 (0x7fe69b06d6c8) - instruction: $w0 = COPY %4:_(s32) - operand 1: %4:_ |
Probably shouldn't be in this group since it doesn't use KnownBits?