mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
become more strict about when it's safe to use X86ISD::MOVLPS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112799 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f58741aab
commit
d00bfe1f8d
@ -5082,10 +5082,10 @@ SDValue getMOVLP(SDValue &Op, DebugLoc &dl, SelectionDAG &DAG, bool HasSSE2) {
|
|||||||
SDValue TmpV1 = V1;
|
SDValue TmpV1 = V1;
|
||||||
SDValue TmpV2 = V2;
|
SDValue TmpV2 = V2;
|
||||||
|
|
||||||
// Trivial case, when V2 is a load.
|
// Trivial case, when V2 comes from a load.
|
||||||
if (TmpV2.getOpcode() == ISD::BIT_CONVERT)
|
if (TmpV2.hasOneUse() && TmpV2.getOpcode() == ISD::BIT_CONVERT)
|
||||||
TmpV2 = TmpV2.getOperand(0);
|
TmpV2 = TmpV2.getOperand(0);
|
||||||
if (TmpV2.getOpcode() == ISD::SCALAR_TO_VECTOR)
|
if (TmpV2.hasOneUse() && TmpV2.getOpcode() == ISD::SCALAR_TO_VECTOR)
|
||||||
TmpV2 = TmpV2.getOperand(0);
|
TmpV2 = TmpV2.getOperand(0);
|
||||||
if (MayFoldLoad(TmpV2))
|
if (MayFoldLoad(TmpV2))
|
||||||
CanFoldLoad = true;
|
CanFoldLoad = true;
|
||||||
@ -5095,9 +5095,9 @@ SDValue getMOVLP(SDValue &Op, DebugLoc &dl, SelectionDAG &DAG, bool HasSSE2) {
|
|||||||
// turns into:
|
// turns into:
|
||||||
// (MOVLPSmr addr:$src1, VR128:$src2)
|
// (MOVLPSmr addr:$src1, VR128:$src2)
|
||||||
// So, recognize this potential and also use MOVLPS or MOVLPD
|
// So, recognize this potential and also use MOVLPS or MOVLPD
|
||||||
if (TmpV1.getOpcode() == ISD::BIT_CONVERT)
|
if (TmpV1.hasOneUse() && TmpV1.getOpcode() == ISD::BIT_CONVERT)
|
||||||
TmpV1 = TmpV1.getOperand(0);
|
TmpV1 = TmpV1.getOperand(0);
|
||||||
if (MayFoldLoad(TmpV1))
|
if (MayFoldLoad(TmpV1) && MayFoldIntoStore(Op))
|
||||||
CanFoldLoad = true;
|
CanFoldLoad = true;
|
||||||
|
|
||||||
if (CanFoldLoad) {
|
if (CanFoldLoad) {
|
||||||
|
@ -5829,6 +5829,13 @@ def : Pat<(v4i32 (X86Movss VR128:$src1, VR128:$src2)),
|
|||||||
def : Pat<(v4f32 (X86Movss VR128:$src1, VR128:$src2)),
|
def : Pat<(v4f32 (X86Movss VR128:$src1, VR128:$src2)),
|
||||||
(MOVSSrr (v4f32 VR128:$src1),
|
(MOVSSrr (v4f32 VR128:$src1),
|
||||||
(EXTRACT_SUBREG (v4f32 VR128:$src2), sub_ss))>;
|
(EXTRACT_SUBREG (v4f32 VR128:$src2), sub_ss))>;
|
||||||
|
// FIXME: Instead of a X86Movss there should be a X86Movlps here, the problem
|
||||||
|
// is during lowering, where it's not possible to recognize the load fold cause
|
||||||
|
// it has two uses through a bitcast. One use disappears at isel time and the
|
||||||
|
// fold opportunity reappears.
|
||||||
|
def : Pat<(X86Movss VR128:$src1,
|
||||||
|
(bc_v4i32 (v2i64 (load addr:$src2)))),
|
||||||
|
(MOVLPSrm VR128:$src1, addr:$src2)>;
|
||||||
|
|
||||||
// Shuffle with MOVSD
|
// Shuffle with MOVSD
|
||||||
def : Pat<(v2f64 (X86Movsd VR128:$src1, (scalar_to_vector FR64:$src2))),
|
def : Pat<(v2f64 (X86Movsd VR128:$src1, (scalar_to_vector FR64:$src2))),
|
||||||
@ -5909,9 +5916,6 @@ def : Pat<(v4i32 (X86Movlps VR128:$src1, (load addr:$src2))),
|
|||||||
def : Pat<(X86Movlps VR128:$src1,
|
def : Pat<(X86Movlps VR128:$src1,
|
||||||
(bc_v4f32 (v2f64 (scalar_to_vector (loadf64 addr:$src2))))),
|
(bc_v4f32 (v2f64 (scalar_to_vector (loadf64 addr:$src2))))),
|
||||||
(MOVLPSrm VR128:$src1, addr:$src2)>;
|
(MOVLPSrm VR128:$src1, addr:$src2)>;
|
||||||
def : Pat<(X86Movlps VR128:$src1,
|
|
||||||
(bc_v4i32 (v2i64 (load addr:$src2)))),
|
|
||||||
(MOVLPSrm VR128:$src1, addr:$src2)>;
|
|
||||||
|
|
||||||
// Shuffle with MOVLPD
|
// Shuffle with MOVLPD
|
||||||
def : Pat<(v2f64 (X86Movlpd VR128:$src1, (load addr:$src2))),
|
def : Pat<(v2f64 (X86Movlpd VR128:$src1, (load addr:$src2))),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user