forked from OSchip/llvm-project
Teach PreprocessISelDAG to be aware of vector types and to not process them.
llvm-svn: 136653
This commit is contained in:
parent
bd30a4b584
commit
616fe60548
|
@ -59,8 +59,8 @@ public:
|
|||
explicit X86FastISel(FunctionLoweringInfo &funcInfo) : FastISel(funcInfo) {
|
||||
Subtarget = &TM.getSubtarget<X86Subtarget>();
|
||||
StackPtr = Subtarget->is64Bit() ? X86::RSP : X86::ESP;
|
||||
X86ScalarSSEf64 = Subtarget->hasSSE2();
|
||||
X86ScalarSSEf32 = Subtarget->hasSSE1();
|
||||
X86ScalarSSEf64 = Subtarget->hasSSE2() || Subtarget->hasAVX();
|
||||
X86ScalarSSEf32 = Subtarget->hasSSE1() || Subtarget->hasAVX();
|
||||
}
|
||||
|
||||
virtual bool TargetSelectInstruction(const Instruction *I);
|
||||
|
|
|
@ -474,10 +474,15 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
|
|||
if (N->getOpcode() != ISD::FP_ROUND && N->getOpcode() != ISD::FP_EXTEND)
|
||||
continue;
|
||||
|
||||
// If the source and destination are SSE registers, then this is a legal
|
||||
// conversion that should not be lowered.
|
||||
EVT SrcVT = N->getOperand(0).getValueType();
|
||||
EVT DstVT = N->getValueType(0);
|
||||
|
||||
// If any of the sources are vectors, no fp stack involved.
|
||||
if (SrcVT.isVector() || DstVT.isVector())
|
||||
continue;
|
||||
|
||||
// If the source and destination are SSE registers, then this is a legal
|
||||
// conversion that should not be lowered.
|
||||
bool SrcIsSSE = X86Lowering.isScalarFPTypeInSSEReg(SrcVT);
|
||||
bool DstIsSSE = X86Lowering.isScalarFPTypeInSSEReg(DstVT);
|
||||
if (SrcIsSSE && DstIsSSE)
|
||||
|
|
|
@ -168,8 +168,8 @@ static TargetLoweringObjectFile *createTLOF(X86TargetMachine &TM) {
|
|||
X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
|
||||
: TargetLowering(TM, createTLOF(TM)) {
|
||||
Subtarget = &TM.getSubtarget<X86Subtarget>();
|
||||
X86ScalarSSEf64 = Subtarget->hasXMMInt();
|
||||
X86ScalarSSEf32 = Subtarget->hasXMM();
|
||||
X86ScalarSSEf64 = Subtarget->hasXMMInt() || Subtarget->hasAVX();
|
||||
X86ScalarSSEf32 = Subtarget->hasXMM() || Subtarget->hasAVX();
|
||||
X86StackPtr = Subtarget->is64Bit() ? X86::RSP : X86::ESP;
|
||||
|
||||
RegInfo = TM.getRegisterInfo();
|
||||
|
|
Loading…
Reference in New Issue