[PATCH] [SelectionDAG] Allow targets to specify legality of extloads' result type (in addition to the memory type)

Ahmed Bougacha ahmed.bougacha at gmail.com
Fri Dec 5 10:07:08 PST 2014


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:2982-2983
@@ -2982,1 +2981,4 @@
+  if (TLI &&
+      !TLI->isLoadExtLegal(LType, TLI->getValueType(I->getType()),
+                           TLI->getValueType(LI->getType())))
     return false;
----------------
arsenm wrote:
> Using a variable for TLI->getValueType(I->getType()) above would avoid this ugly wrapping (and would also be usable above)
Good point, r223491 for the variables only.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:888-889
@@ -886,6 +887,4 @@
 
-    // N.b. ISD::EXTLOAD legality is basically ignored except for i1-like types,
-    // we have to deal with them whether we ask for Expansion or not. Setting
-    // Expand causes its own optimisation problems though, so leave them legal.
-    if (VT.getVectorElementType() == MVT::i1)
-      setLoadExtAction(ISD::EXTLOAD, VT, Expand);
+      setLoadExtAction(ISD::SEXTLOAD, (MVT::SimpleValueType)InnerVT, VT,
+                       Expand);
+      setLoadExtAction(ISD::ZEXTLOAD, (MVT::SimpleValueType)InnerVT, VT,
----------------
arsenm wrote:
> Variable for the cast would avoid wrapping
Right, as I was changing these I added iterator ranges in D6537; reviews welcome!

http://reviews.llvm.org/D6532






More information about the llvm-commits mailing list