[llvm] 6f4f0ef - [X86] Don't pass a 1 to the second argument of ISD::FP_ROUND in LowerFCOPYSIGN.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 6 10:48:13 PST 2021


Author: Craig Topper
Date: 2021-02-06T10:29:01-08:00
New Revision: 6f4f0efd893de87fd9aaea379165a8ae566a9096

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

LOG: [X86] Don't pass a 1 to the second argument of ISD::FP_ROUND in LowerFCOPYSIGN.

I don't think we have any reason to believe the FP_ROUND here doesn't change the value.

Found while trying to see if we still need the fp128 block in CanCombineFCOPYSIGN_EXTEND_ROUND.
Removing that check caused this FP_ROUND to fire for fp128 which introduced a libcall expansion that asserted for this being a 1.

Reviewed By: RKSimon, pengfei

Differential Revision: https://reviews.llvm.org/D96098

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 97f2d2bdbd14..6f8ef3ea055c 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -21900,7 +21900,8 @@ static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) {
 
   // And if it is bigger, shrink it first.
   if (Sign.getSimpleValueType().bitsGT(VT))
-    Sign = DAG.getNode(ISD::FP_ROUND, dl, VT, Sign, DAG.getIntPtrConstant(1, dl));
+    Sign =
+        DAG.getNode(ISD::FP_ROUND, dl, VT, Sign, DAG.getIntPtrConstant(0, dl));
 
   // At this point the operands and the result should have the same
   // type, and that won't be f80 since that is not custom lowered.


        


More information about the llvm-commits mailing list