Please review: Fixed X86 DAG lowering: lowerVectorIntExtend

Nadav Rotem nrotem at apple.com
Wed Feb 13 22:17:22 PST 2013


This is the current documentation:

""" // (bitcast (sclr2vec (ext_vec_elt x))) -> (bitcast x) """

Please update the docs to reflect the fact that you optimization can now generate extract_subvector. 

+        (!ISD::isNormalLoad(V.getNode()) || !V.hasOneUse())) {
+      if (V.getValueSizeInBits() > V1.getValueSizeInBits()) {
+        // Extract subvector from V
+        unsigned ratio = V.getValueSizeInBits() / V1.getValueSizeInBits();

ratio -> Ratio. 

+        EVT FullVT = V.getValueType();
+        EVT SubVecVT = EVT::getVectorVT(*DAG.getContext(), 


Please move DAG.getContext() into a variable. It is used 3 times in this function. 


+                                        FullVT.getVectorElementType(),
+                                        FullVT.getVectorNumElements()/ratio);
+        V = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, SubVecVT, V, 
+                        DAG.getIntPtrConstant(0));
+      }
       V1 = DAG.getNode(ISD::BITCAST, DL, V1.getValueType(), V);
+    }
   }
 


LGTM. Please commit. 



More information about the llvm-commits mailing list