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

Matt Arsenault Matthew.Arsenault at amd.com
Thu Dec 4 11:12:39 PST 2014


Thanks for working on this, this has been bothering me for a long time. This LGTM besides few formatting nits where using a variable would avoid ugly line wrappings.

I have a bunch of R600 tests for this lying around somewhere where I was hacking around this problem for extloads to i64

================
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;
----------------
Using a variable for TLI->getValueType(I->getType()) above would avoid this ugly wrapping (and would also be usable above)

================
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,
----------------
Variable for the cast would avoid wrapping

http://reviews.llvm.org/D6532






More information about the llvm-commits mailing list