ARM64: disable printing of LDUR -> LDR aliases

We accept "ldr w3, [x1, #-1]" as a convenience, but we should still print the
canonical "ldur" form.

This will be tested when the TableGen "should I print this Alias" heuristic is
fixed (very soon).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover 2014-05-16 09:41:12 +00:00
parent 93185d186c
commit fba407a3b8

View File

@ -1500,13 +1500,13 @@ def am_unscaled_fb128 : Operand<i64> {
let ParserMatchClass = MemoryUnscaledFB128Operand; let ParserMatchClass = MemoryUnscaledFB128Operand;
let MIOperandInfo = (ops GPR64sp:$base, i64imm:$offset); let MIOperandInfo = (ops GPR64sp:$base, i64imm:$offset);
} }
def : InstAlias<"ldr $Rt, $addr", (LDURXi GPR64:$Rt, am_unscaled_fb64:$addr)>; def : InstAlias<"ldr $Rt, $addr", (LDURXi GPR64:$Rt, am_unscaled_fb64:$addr), 0>;
def : InstAlias<"ldr $Rt, $addr", (LDURWi GPR32:$Rt, am_unscaled_fb32:$addr)>; def : InstAlias<"ldr $Rt, $addr", (LDURWi GPR32:$Rt, am_unscaled_fb32:$addr), 0>;
def : InstAlias<"ldr $Rt, $addr", (LDURBi FPR8:$Rt, am_unscaled_fb8:$addr)>; def : InstAlias<"ldr $Rt, $addr", (LDURBi FPR8:$Rt, am_unscaled_fb8:$addr), 0>;
def : InstAlias<"ldr $Rt, $addr", (LDURHi FPR16:$Rt, am_unscaled_fb16:$addr)>; def : InstAlias<"ldr $Rt, $addr", (LDURHi FPR16:$Rt, am_unscaled_fb16:$addr), 0>;
def : InstAlias<"ldr $Rt, $addr", (LDURSi FPR32:$Rt, am_unscaled_fb32:$addr)>; def : InstAlias<"ldr $Rt, $addr", (LDURSi FPR32:$Rt, am_unscaled_fb32:$addr), 0>;
def : InstAlias<"ldr $Rt, $addr", (LDURDi FPR64:$Rt, am_unscaled_fb64:$addr)>; def : InstAlias<"ldr $Rt, $addr", (LDURDi FPR64:$Rt, am_unscaled_fb64:$addr), 0>;
def : InstAlias<"ldr $Rt, $addr", (LDURQi FPR128:$Rt, am_unscaled_fb128:$addr)>; def : InstAlias<"ldr $Rt, $addr", (LDURQi FPR128:$Rt, am_unscaled_fb128:$addr), 0>;
// zextload -> i64 // zextload -> i64
def : Pat<(i64 (zextloadi8 am_unscaled8:$addr)), def : Pat<(i64 (zextloadi8 am_unscaled8:$addr)),
@ -1536,13 +1536,20 @@ def LDURSWi
[(set GPR64:$Rt, (sextloadi32 am_unscaled32:$addr))]>; [(set GPR64:$Rt, (sextloadi32 am_unscaled32:$addr))]>;
// zero and sign extending aliases from generic LDR* mnemonics to LDUR*. // zero and sign extending aliases from generic LDR* mnemonics to LDUR*.
def : InstAlias<"ldrb $Rt, $addr", (LDURBBi GPR32:$Rt, am_unscaled_fb8:$addr)>; def : InstAlias<"ldrb $Rt, $addr",
def : InstAlias<"ldrh $Rt, $addr", (LDURHHi GPR32:$Rt, am_unscaled_fb16:$addr)>; (LDURBBi GPR32:$Rt, am_unscaled_fb8:$addr), 0>;
def : InstAlias<"ldrsb $Rt, $addr", (LDURSBWi GPR32:$Rt, am_unscaled_fb8:$addr)>; def : InstAlias<"ldrh $Rt, $addr",
def : InstAlias<"ldrsb $Rt, $addr", (LDURSBXi GPR64:$Rt, am_unscaled_fb8:$addr)>; (LDURHHi GPR32:$Rt, am_unscaled_fb16:$addr), 0>;
def : InstAlias<"ldrsh $Rt, $addr", (LDURSHWi GPR32:$Rt, am_unscaled_fb16:$addr)>; def : InstAlias<"ldrsb $Rt, $addr",
def : InstAlias<"ldrsh $Rt, $addr", (LDURSHXi GPR64:$Rt, am_unscaled_fb16:$addr)>; (LDURSBWi GPR32:$Rt, am_unscaled_fb8:$addr), 0>;
def : InstAlias<"ldrsw $Rt, $addr", (LDURSWi GPR64:$Rt, am_unscaled_fb32:$addr)>; def : InstAlias<"ldrsb $Rt, $addr",
(LDURSBXi GPR64:$Rt, am_unscaled_fb8:$addr), 0>;
def : InstAlias<"ldrsh $Rt, $addr",
(LDURSHWi GPR32:$Rt, am_unscaled_fb16:$addr), 0>;
def : InstAlias<"ldrsh $Rt, $addr",
(LDURSHXi GPR64:$Rt, am_unscaled_fb16:$addr), 0>;
def : InstAlias<"ldrsw $Rt, $addr",
(LDURSWi GPR64:$Rt, am_unscaled_fb32:$addr), 0>;
// Pre-fetch. // Pre-fetch.
def PRFUMi : PrefetchUnscaled<0b11, 0, 0b10, "prfum", def PRFUMi : PrefetchUnscaled<0b11, 0, 0b10, "prfum",
@ -1889,16 +1896,25 @@ def : Pat<(truncstorei8 GPR64:$Rt, am_unscaled8:$addr),
//--- //---
// STR mnemonics fall back to STUR for negative or unaligned offsets. // STR mnemonics fall back to STUR for negative or unaligned offsets.
def : InstAlias<"str $Rt, $addr", (STURXi GPR64:$Rt, am_unscaled_fb64:$addr)>; def : InstAlias<"str $Rt, $addr",
def : InstAlias<"str $Rt, $addr", (STURWi GPR32:$Rt, am_unscaled_fb32:$addr)>; (STURXi GPR64:$Rt, am_unscaled_fb64:$addr), 0>;
def : InstAlias<"str $Rt, $addr", (STURBi FPR8:$Rt, am_unscaled_fb8:$addr)>; def : InstAlias<"str $Rt, $addr",
def : InstAlias<"str $Rt, $addr", (STURHi FPR16:$Rt, am_unscaled_fb16:$addr)>; (STURWi GPR32:$Rt, am_unscaled_fb32:$addr), 0>;
def : InstAlias<"str $Rt, $addr", (STURSi FPR32:$Rt, am_unscaled_fb32:$addr)>; def : InstAlias<"str $Rt, $addr",
def : InstAlias<"str $Rt, $addr", (STURDi FPR64:$Rt, am_unscaled_fb64:$addr)>; (STURBi FPR8:$Rt, am_unscaled_fb8:$addr), 0>;
def : InstAlias<"str $Rt, $addr", (STURQi FPR128:$Rt, am_unscaled_fb128:$addr)>; def : InstAlias<"str $Rt, $addr",
(STURHi FPR16:$Rt, am_unscaled_fb16:$addr), 0>;
def : InstAlias<"str $Rt, $addr",
(STURSi FPR32:$Rt, am_unscaled_fb32:$addr), 0>;
def : InstAlias<"str $Rt, $addr",
(STURDi FPR64:$Rt, am_unscaled_fb64:$addr), 0>;
def : InstAlias<"str $Rt, $addr",
(STURQi FPR128:$Rt, am_unscaled_fb128:$addr), 0>;
def : InstAlias<"strb $Rt, $addr", (STURBBi GPR32:$Rt, am_unscaled_fb8:$addr)>; def : InstAlias<"strb $Rt, $addr",
def : InstAlias<"strh $Rt, $addr", (STURHHi GPR32:$Rt, am_unscaled_fb16:$addr)>; (STURBBi GPR32:$Rt, am_unscaled_fb8:$addr), 0>;
def : InstAlias<"strh $Rt, $addr",
(STURHHi GPR32:$Rt, am_unscaled_fb16:$addr), 0>;
//--- //---
// (unscaled immediate, unprivileged) // (unscaled immediate, unprivileged)