mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Mark the SSE and MMX load instructions that
X86InstrInfo::isReallyTriviallyReMaterializable knows how to handle with the isReMaterializable flag so that it is given a chance to handle them. Without hoisting constant-pool loads from loops this isn't very visible, though it does keep CodeGen/X86/constant-pool-remat-0.ll from making a copy of the constant pool on the stack. llvm-svn: 40736
This commit is contained in:
parent
0111f62050
commit
a599a813d5
@ -157,6 +157,7 @@ def MMX_FEMMS : MMXI<0x0E, RawFrm, (outs), (ins), "femms", [(int_x86_mmx_femms)]
|
||||
// Data Transfer Instructions
|
||||
def MMX_MOVD64rr : MMXI<0x6E, MRMSrcReg, (outs VR64:$dst), (ins GR32:$src),
|
||||
"movd\t{$src, $dst|$dst, $src}", []>;
|
||||
let isReMaterializable = 1 in
|
||||
def MMX_MOVD64rm : MMXI<0x6E, MRMSrcMem, (outs VR64:$dst), (ins i32mem:$src),
|
||||
"movd\t{$src, $dst|$dst, $src}", []>;
|
||||
def MMX_MOVD64mr : MMXI<0x7E, MRMDestMem, (outs), (ins i32mem:$dst, VR64:$src),
|
||||
@ -167,6 +168,7 @@ def MMX_MOVD64to64rr : MMXRI<0x6E, MRMSrcReg, (outs VR64:$dst), (ins GR64:$src),
|
||||
|
||||
def MMX_MOVQ64rr : MMXI<0x6F, MRMSrcReg, (outs VR64:$dst), (ins VR64:$src),
|
||||
"movq\t{$src, $dst|$dst, $src}", []>;
|
||||
let isReMaterializable = 1 in
|
||||
def MMX_MOVQ64rm : MMXI<0x6F, MRMSrcMem, (outs VR64:$dst), (ins i64mem:$src),
|
||||
"movq\t{$src, $dst|$dst, $src}",
|
||||
[(set VR64:$dst, (load_mmx addr:$src))]>;
|
||||
|
@ -280,6 +280,7 @@ let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler.
|
||||
// Move Instructions
|
||||
def MOVSSrr : SSI<0x10, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src),
|
||||
"movss\t{$src, $dst|$dst, $src}", []>;
|
||||
let isReMaterializable = 1 in
|
||||
def MOVSSrm : SSI<0x10, MRMSrcMem, (outs FR32:$dst), (ins f32mem:$src),
|
||||
"movss\t{$src, $dst|$dst, $src}",
|
||||
[(set FR32:$dst, (loadf32 addr:$src))]>;
|
||||
@ -569,6 +570,7 @@ defm MIN : sse1_fp_binop_rm<0x5D, "min", X86fmin,
|
||||
// Move Instructions
|
||||
def MOVAPSrr : PSI<0x28, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
|
||||
"movaps\t{$src, $dst|$dst, $src}", []>;
|
||||
let isReMaterializable = 1 in
|
||||
def MOVAPSrm : PSI<0x28, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
|
||||
"movaps\t{$src, $dst|$dst, $src}",
|
||||
[(set VR128:$dst, (alignedloadv4f32 addr:$src))]>;
|
||||
@ -936,6 +938,7 @@ def MOVZSS2PSrm : SSI<0x10, MRMSrcMem, (outs VR128:$dst), (ins f32mem:$src),
|
||||
// Move Instructions
|
||||
def MOVSDrr : SDI<0x10, MRMSrcReg, (outs FR64:$dst), (ins FR64:$src),
|
||||
"movsd\t{$src, $dst|$dst, $src}", []>;
|
||||
let isReMaterializable = 1 in
|
||||
def MOVSDrm : SDI<0x10, MRMSrcMem, (outs FR64:$dst), (ins f64mem:$src),
|
||||
"movsd\t{$src, $dst|$dst, $src}",
|
||||
[(set FR64:$dst, (loadf64 addr:$src))]>;
|
||||
@ -1228,6 +1231,7 @@ defm MIN : sse2_fp_binop_rm<0x5D, "min", X86fmin,
|
||||
// Move Instructions
|
||||
def MOVAPDrr : PDI<0x28, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
|
||||
"movapd\t{$src, $dst|$dst, $src}", []>;
|
||||
let isReMaterializable = 1 in
|
||||
def MOVAPDrm : PDI<0x28, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src),
|
||||
"movapd\t{$src, $dst|$dst, $src}",
|
||||
[(set VR128:$dst, (alignedloadv2f64 addr:$src))]>;
|
||||
|
10
test/CodeGen/X86/constant-pool-remat-0.ll
Normal file
10
test/CodeGen/X86/constant-pool-remat-0.ll
Normal file
@ -0,0 +1,10 @@
|
||||
; RUN: llvm-as < %s | llc -march=x86-64 | grep LCPI | wc -l | grep 3
|
||||
|
||||
declare float @qux(float %y)
|
||||
|
||||
define float @array(float %a) {
|
||||
%n = mul float %a, 9.0
|
||||
%m = call float @qux(float %n)
|
||||
%o = mul float %m, 9.0
|
||||
ret float %o
|
||||
}
|
Loading…
Reference in New Issue
Block a user