[PATCH] D157202: [AArch64][GISel] Fix selection of G_CONSTANT_FOLD_BARRIER

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 6 00:07:42 PDT 2023

dmgreen created this revision.
dmgreen added reviewers: aemerson, paquette, arsenm.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

As far as I understand - When lowering a G_CONSTANT_FOLD_BARRIER we replace the DstReg with SrcReg, and need to check that the register class is equivalent when doing so for the replacement to be legal. During lowering we could end up visiting nodes in an odd order, leaving a G_CONSTANT_FOLD_BARRIER with a known regclass for the src, but only a regbank for the dst. Providing the Regbank contains the regclass, the replacement should still be safe.

This fixes an assert seen in the llvm-test-suite when lowering hoisted constants, relaxing the assert to account for the difference in visiting order.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157202.547488.patch
Type: text/x-patch
Size: 10116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230806/f3a5f000/attachment.bin>

More information about the llvm-commits mailing list