diff options
author | Simon Wallis <simon.wallis2@arm.com> | 2020-09-08 08:04:52 +0100 |
---|---|---|
committer | Simon Wallis <simon.wallis2@arm.com> | 2020-09-08 08:04:52 +0100 |
commit | 8ee1419ab688ee2da2ac2cb0cf19db03f4c4742e (patch) | |
tree | 8fbecd613cd71edd2d0bf911e91dae30bcbbc35e /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | ea795304ec073a63c3c5b4fd0c5579e667201dad (diff) | |
download | llvm-8ee1419ab688ee2da2ac2cb0cf19db03f4c4742e.zip llvm-8ee1419ab688ee2da2ac2cb0cf19db03f4c4742e.tar.gz llvm-8ee1419ab688ee2da2ac2cb0cf19db03f4c4742e.tar.bz2 |
[AARCH64][RegisterCoalescer] clang miscompiles zero-extension to long long
Implement AArch64 variant of shouldCoalesce() to detect a known failing case
and prevent the coalescing of a 32-bit copy into a 64-bit sign-extending load.
Do not coalesce in the following case:
COPY where source is bottom 32 bits of a 64-register,
and destination is a 32-bit subregister of a 64-bit register,
ie it causes the rest of the register to be implicitly set to zero.
A mir test has been added.
In the test case, the 32-bit copy implements a 32 to 64 bit zero extension
and relies on the upper 32 bits being zeroed.
Coalescing to the result of the 64-bit load meant overwriting
the upper 32 bits incorrectly when the loaded byte was negative.
Reviewed By: john.brawn
Differential Revision: https://reviews.llvm.org/D85956
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions