[llvm] a5c96e3 - [X86] Stop accidentally custom type legalizing v4i32->v4f32 on SSE1 only targets.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 28 23:12:05 PST 2019


Author: Craig Topper
Date: 2019-12-28T23:11:48-08:00
New Revision: a5c96e326a7720f8c983b5b9fd820762f6922346

URL: https://github.com/llvm/llvm-project/commit/a5c96e326a7720f8c983b5b9fd820762f6922346
DIFF: https://github.com/llvm/llvm-project/commit/a5c96e326a7720f8c983b5b9fd820762f6922346.diff

LOG: [X86] Stop accidentally custom type legalizing v4i32->v4f32 on SSE1 only targets.

We had a Custom operation action for v4i32 on SSE1. But since
v4i32 isn't legal until SSE2 this was not what was intended. The
code that get executed was intended for op legalization and
creates a bunch of v4i32 nodes that all end up scalarized.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index b7018398c4b0..95e12e55433c 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -847,8 +847,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
     setOperationAction(ISD::VSELECT,            MVT::v4f32, Custom);
     setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Custom);
     setOperationAction(ISD::SELECT,             MVT::v4f32, Custom);
-    setOperationAction(ISD::UINT_TO_FP,         MVT::v4i32, Custom);
-    setOperationAction(ISD::STRICT_UINT_TO_FP,  MVT::v4i32, Custom);
 
     setOperationAction(ISD::LOAD,               MVT::v2f32, Custom);
     setOperationAction(ISD::STORE,              MVT::v2f32, Custom);
@@ -986,6 +984,9 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
     setOperationAction(ISD::UINT_TO_FP,         MVT::v2i32, Custom);
     setOperationAction(ISD::STRICT_UINT_TO_FP,  MVT::v2i32, Custom);
 
+    setOperationAction(ISD::UINT_TO_FP,         MVT::v4i32, Custom);
+    setOperationAction(ISD::STRICT_UINT_TO_FP,  MVT::v4i32, Custom);
+
     // Fast v2f32 UINT_TO_FP( v2i32 ) custom conversion.
     setOperationAction(ISD::SINT_TO_FP,         MVT::v2f32, Custom);
     setOperationAction(ISD::STRICT_SINT_TO_FP,  MVT::v2f32, Custom);


        


More information about the llvm-commits mailing list