diff options
| author | Eli Friedman <efriedma@quicinc.com> | 2019-03-25 21:25:28 +0000 |
|---|---|---|
| committer | Eli Friedman <efriedma@quicinc.com> | 2019-03-25 21:25:28 +0000 |
| commit | 92d0d133661f6c1bcc3dd37c7a6435a2c0733f81 (patch) | |
| tree | fd283e47226841aa0869a6b7827c6c2f475db7a3 /llvm/lib | |
| parent | 4dcf3acce6d7455fd079d8e57441906ca2bad254 (diff) | |
| download | bcm5719-llvm-92d0d133661f6c1bcc3dd37c7a6435a2c0733f81.tar.gz bcm5719-llvm-92d0d133661f6c1bcc3dd37c7a6435a2c0733f81.zip | |
[AArch64] Prefer "mov" over "orr" to materialize constants.
This is generally more readable due to the way the assembler aliases
work.
(This causes a lot of test changes, but it's not really as scary as it
looks at first glance; it's just mechanically changing a bunch of checks
for orr to check for mov instead.)
Differential Revision: https://reviews.llvm.org/D59720
llvm-svn: 356954
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64ExpandImm.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ExpandImm.cpp b/llvm/lib/Target/AArch64/AArch64ExpandImm.cpp index c8602dabcd5..c764af80eb8 100644 --- a/llvm/lib/Target/AArch64/AArch64ExpandImm.cpp +++ b/llvm/lib/Target/AArch64/AArch64ExpandImm.cpp @@ -318,8 +318,11 @@ void expandMOVImm(uint64_t Imm, unsigned BitSize, ZeroChunks++; } - // FIXME: Prefer MOVZ/MOVN over ORR because of the rules for the "mov" - // alias. + // Prefer MOVZ/MOVN over ORR because of the rules for the "mov" alias. + if ((BitSize / 16) - OneChunks <= 1 || (BitSize / 16) - ZeroChunks <= 1) { + expandMOVImmSimple(Imm, BitSize, OneChunks, ZeroChunks, Insn); + return; + } // Try a single ORR. uint64_t UImm = Imm << (64 - BitSize) >> (64 - BitSize); |

