[X86] Disable custom widening of signed/unsigned add/sub saturation intrinsics under...
authorCraig Topper <craig.topper@intel.com>
Thu, 20 Dec 2018 01:32:06 +0000 (01:32 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 20 Dec 2018 01:32:06 +0000 (01:32 +0000)
Generic legalization should take care of this.

llvm-svn: 349714

llvm/lib/Target/X86/X86ISelLowering.cpp

index e381d0c..10d9613 100644 (file)
@@ -837,13 +837,16 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
     setOperationAction(ISD::SADDSAT,            MVT::v8i16, Legal);
     setOperationAction(ISD::USUBSAT,            MVT::v8i16, Legal);
     setOperationAction(ISD::SSUBSAT,            MVT::v8i16, Legal);
-    // Use widening instead of promotion.
-    for (auto VT : { MVT::v8i8, MVT::v4i8, MVT::v2i8,
-                     MVT::v4i16, MVT::v2i16 }) {
-      setOperationAction(ISD::UADDSAT, VT, Custom);
-      setOperationAction(ISD::SADDSAT, VT, Custom);
-      setOperationAction(ISD::USUBSAT, VT, Custom);
-      setOperationAction(ISD::SSUBSAT, VT, Custom);
+
+    if (!ExperimentalVectorWideningLegalization) {
+      // Use widening instead of promotion.
+      for (auto VT : { MVT::v8i8, MVT::v4i8, MVT::v2i8,
+                       MVT::v4i16, MVT::v2i16 }) {
+        setOperationAction(ISD::UADDSAT, VT, Custom);
+        setOperationAction(ISD::SADDSAT, VT, Custom);
+        setOperationAction(ISD::USUBSAT, VT, Custom);
+        setOperationAction(ISD::SSUBSAT, VT, Custom);
+      }
     }
 
     setOperationAction(ISD::INSERT_VECTOR_ELT,  MVT::v8i16, Custom);