[llvm] 112793a - [DAG] expandUINT_TO_FP - use getShiftAmountConstant helper. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 10:50:11 PST 2025


Author: Simon Pilgrim
Date: 2025-01-06T18:49:50Z
New Revision: 112793a90ec84c31ced9bdacad7ce204e2148d2c

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

LOG: [DAG] expandUINT_TO_FP - use getShiftAmountConstant helper. NFC.

Don't bother with separate getShiftAmountTy/getConstant calls.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index e87d809f88eb97..9f57884eae04df 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -8435,7 +8435,6 @@ bool TargetLowering::expandUINT_TO_FP(SDNode *Node, SDValue &Result,
     return false;
 
   SDLoc dl(SDValue(Node, 0));
-  EVT ShiftVT = getShiftAmountTy(SrcVT, DAG.getDataLayout());
 
   // Implementation of unsigned i64 to f64 following the algorithm in
   // __floatundidf in compiler_rt.  This implementation performs rounding
@@ -8448,7 +8447,7 @@ bool TargetLowering::expandUINT_TO_FP(SDNode *Node, SDValue &Result,
       llvm::bit_cast<double>(UINT64_C(0x4530000000100000)), dl, DstVT);
   SDValue TwoP84 = DAG.getConstant(UINT64_C(0x4530000000000000), dl, SrcVT);
   SDValue LoMask = DAG.getConstant(UINT64_C(0x00000000FFFFFFFF), dl, SrcVT);
-  SDValue HiShift = DAG.getConstant(32, dl, ShiftVT);
+  SDValue HiShift = DAG.getShiftAmountConstant(32, SrcVT, dl);
 
   SDValue Lo = DAG.getNode(ISD::AND, dl, SrcVT, Src, LoMask);
   SDValue Hi = DAG.getNode(ISD::SRL, dl, SrcVT, Src, HiShift);


        


More information about the llvm-commits mailing list