[PATCH] D143475: [AArch64] Fix creation of invalid instructions with XZR register

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 00:56:28 PST 2023


dmgreen created this revision.
dmgreen added reviewers: jaykang10, efriedma, red1bluelost, bipmis.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D143475

Files:
  llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp
  llvm/test/CodeGen/AArch64/addsub-24bit-imm.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143475.495405.patch
Type: text/x-patch
Size: 5749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230207/81e8364e/attachment.bin>


More information about the llvm-commits mailing list