[PATCH] D109771: [AArch64][GlobalISel] Ensure atomic loads always get assigned GPR destinations

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 10:08:17 PDT 2021


paquette created this revision.
paquette added reviewers: aemerson, t.p.northover, jroelofs.
Herald added subscribers: hiraditya, kristof.beyls, rovka.
paquette requested review of this revision.
Herald added a project: LLVM.

The default register bank selection code for G_LOAD assumes that we ought to use a FPR when the load is casted to a float/double.

For atomics, this isn't true; we should always use GPRs.

Without this patch, we crash in the following example:

https://godbolt.org/z/MThjas441

Also make the code a little more stylistically consistent while we're here.

Also test some other weird cast combinations as well.


https://reviews.llvm.org/D109771

Files:
  llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109771.372506.patch
Type: text/x-patch
Size: 6514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210914/661bf58e/attachment-0001.bin>


More information about the llvm-commits mailing list