Add a combine to transform op undef, x to 0. Support only G_SHL for now.
Diff Detail
Event Timeline
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | ||
---|---|---|
1858 | MO.getReg() may cause a crash without that check. This shouldn't a problem for this case, but I'd like to keep it as this function might be used by other combines too. |
llvm/test/CodeGen/AArch64/GlobalISel/combine-shl.mir | ||
---|---|---|
5 | A testcase where the G_IMPLICIT_DEF has more than one use would be good? |
llvm/test/CodeGen/AArch64/GlobalISel/combine-shl.mir | ||
---|---|---|
5 | Another user wouldn't have any impact on this case. Could you explain why that would be good? |
LGTM now that I realized I just misread the code here
llvm/test/CodeGen/AArch64/GlobalISel/combine-shl.mir | ||
---|---|---|
5 | Oh, I misread the code. I thought you were replacing the G_IMPLICIT_DEF for some reason when I first read this. :P |
The isReg check should be unnecessary