OSDN Git Service

[X86] Simplify the AVX512 code in LowerTruncate a little.
authorCraig Topper <craig.topper@intel.com>
Mon, 19 Mar 2018 21:58:02 +0000 (21:58 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 19 Mar 2018 21:58:02 +0000 (21:58 +0000)
We don't need to create an ISD::TRUNCATE node to return, we started with one and can return it. Also remove the call to getExtendInVec, the result is just going to be a getNode of that value passed in.

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

lib/Target/X86/X86ISelLowering.cpp

index 3ef0a18..a445bc8 100644 (file)
@@ -16976,10 +16976,9 @@ SDValue X86TargetLowering::LowerTRUNCATE(SDValue Op, SelectionDAG &DAG) const {
       // Make sure we're allowed to promote 512-bits.
       if (Subtarget.canExtendTo512DQ())
         return DAG.getNode(ISD::TRUNCATE, DL, VT,
-                           getExtendInVec(X86ISD::VSEXT, DL, MVT::v16i32, In,
-                                          DAG));
+                           DAG.getNode(X86ISD::VSEXT, DL, MVT::v16i32, In));
     } else {
-      return DAG.getNode(ISD::TRUNCATE, DL, VT, In);
+      return Op;
     }
   }