[all-commits] [llvm/llvm-project] 162f3f: [Aarch64] Correct register class for pseudo instru...
Jameson Nash via All-commits
all-commits at lists.llvm.org
Tue Nov 9 21:00:55 PST 2021
Branch: refs/heads/release/13.x
Home: https://github.com/llvm/llvm-project
Commit: 162f3f18c9454f93b71451f2792f348928c84a2f
https://github.com/llvm/llvm-project/commit/162f3f18c9454f93b71451f2792f348928c84a2f
Author: Jameson Nash <vtjnash at gmail.com>
Date: 2021-11-09 (Tue, 09 Nov 2021)
Changed paths:
M llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
M llvm/lib/Target/AArch64/AArch64InstrInfo.td
M llvm/test/CodeGen/AArch64/GlobalISel/select-add-low.mir
M llvm/test/CodeGen/AArch64/GlobalISel/select-blockaddress.mir
M llvm/test/CodeGen/AArch64/GlobalISel/select-gv-with-offset.mir
M llvm/test/CodeGen/AArch64/GlobalISel/select-jump-table-brjt-constrain.mir
M llvm/test/CodeGen/AArch64/GlobalISel/select-jump-table-brjt.mir
M llvm/test/CodeGen/AArch64/GlobalISel/select-static.mir
M llvm/test/CodeGen/AArch64/GlobalISel/select.mir
M llvm/test/CodeGen/AArch64/elim-dead-mi.mir
M llvm/test/CodeGen/AArch64/loop-sink.mir
Log Message:
-----------
[Aarch64] Correct register class for pseudo instructions
This constrains the Mov* and similar pseudo instruction to take
GPR64common register classes rather than GPR64. GPR64 includs XZR
which is invalid here, because this pseudo instructions expands
into an adrp/add pair sharing a destination register. XZR is invalid
on add and attempting to encode it will instead increment the stack
pointer causing crashes (downstream report at [1]). The test case
there reproduces on LLVM11, but I do not have a test case that
reaches this code path on main, since it is being masked by
improved dead code elimination introduced in D91513. Nevertheless,
this seems like a good thing to fix in case there are other cases
that dead code elimination doesn't clean up (e.g. if `optnone` is
used and the optimization is skipped).
I think it would be worth auditing uses of GPR64 in pseudo
instructions to see if there are any similar issues, but I do not
have a high enough view of the backend or knowledge of the
Aarch64 architecture to do this quickly.
[1] https://github.com/JuliaLang/julia/issues/39818
Reviewed By: t.p.northover
Differential Revision: https://reviews.llvm.org/D97435
(cherry picked from commit e20f69f612dd678f68473e3f111ee891f7d2d108)
More information about the All-commits
mailing list