Don't attempt to create VZEXT_LOAD out of an extload. This an issue where the
authorNate Begeman <natebegeman@mac.com>
Wed, 28 May 2008 00:24:25 +0000 (00:24 +0000)
committerNate Begeman <natebegeman@mac.com>
Wed, 28 May 2008 00:24:25 +0000 (00:24 +0000)
code generator would do something like this:

f64 = load f32 <anyext>, f32mem
v2f64 = insertelt undef, %0, 0
v2f64 = insertelt %1, 0.0, 1

into

v2f64 = vzext_load f32mem

which on x86 is movsd, when you really wanted a cvtss2sd/movsd pair.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51624 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 2a9cef1223fa374ea3b7d23d5215df7e82f6d3f1..5343971d34b3560798f568c7a1e65992cb874a33 100644 (file)
@@ -6324,6 +6324,11 @@ static SDOperand PerformBuildVectorCombine(SDNode *N, SelectionDAG &DAG,
 
   // Transform it into VZEXT_LOAD addr.
   LoadSDNode *LD = cast<LoadSDNode>(Base);
+  
+  // Load must not be an extload.
+  if (LD->getExtensionType() != ISD::NON_EXTLOAD)
+    return SDOperand();
+  
   return DAG.getNode(X86ISD::VZEXT_LOAD, VT, LD->getChain(), LD->getBasePtr());
 }