A combination of GlobalISel and MachineCombiner can end up creating SUB xrz, (MOVI -2105098) instructions which have not been constant folded. The AArch64MIPeepholeOpt pass will then attempt to create ADD xzr, 513, lsl 12, which is not a valid instruction. This adds a bail out of the transform if the register is xzr/wzr.
Details
Details
Diff Detail
Diff Detail
Event Timeline
llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp | ||
---|---|---|
326 | Is the transform assuming that the immediate is on the RHS (operand index 2)? If so, could you update the comment describing the transform to note that explicitly? Otherwise, it isn't really clear why operand index 1 is special. |
llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp | ||
---|---|---|
326 | Yep that could do with a better comment. Will do, thanks. |
Is the transform assuming that the immediate is on the RHS (operand index 2)? If so, could you update the comment describing the transform to note that explicitly? Otherwise, it isn't really clear why operand index 1 is special.