[llvm] 5b7ac10 - [RISCV] Use SelectionDAG::getFreeze to simplify some code. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 23 21:28:38 PST 2022


Author: Craig Topper
Date: 2022-02-23T21:13:01-08:00
New Revision: 5b7ac107b1e22be10c745c184b073747c1c07759

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

LOG: [RISCV] Use SelectionDAG::getFreeze to simplify some code. NFC

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index b8969a327d078..bc29f89a519b0 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -1794,7 +1794,7 @@ static SDValue lowerFTRUNC_FCEIL_FFLOOR(SDValue Op, SelectionDAG &DAG) {
   SDLoc DL(Op);
 
   // Freeze the source since we are increasing the number of uses.
-  SDValue Src = DAG.getNode(ISD::FREEZE, DL, VT, Op.getOperand(0));
+  SDValue Src = DAG.getFreeze(Op.getOperand(0));
 
   // Truncate to integer and convert back to FP.
   MVT IntVT = VT.changeVectorElementTypeToInteger();
@@ -1856,7 +1856,7 @@ static SDValue lowerFROUND(SDValue Op, SelectionDAG &DAG) {
   SDLoc DL(Op);
 
   // Freeze the source since we are increasing the number of uses.
-  SDValue Src = DAG.getNode(ISD::FREEZE, DL, VT, Op.getOperand(0));
+  SDValue Src = DAG.getFreeze(Op.getOperand(0));
 
   // We do the conversion on the absolute value and fix the sign at the end.
   SDValue Abs = DAG.getNode(ISD::FABS, DL, VT, Src);
@@ -2744,7 +2744,7 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
 
     // Freeze V2 since we use it twice and we need to be sure that the add and
     // multiply see the same value.
-    V2 = DAG.getNode(ISD::FREEZE, DL, IntHalfVT, V2);
+    V2 = DAG.getFreeze(V2);
 
     // Recreate TrueMask using the widened type's element count.
     MVT MaskVT =


        


More information about the llvm-commits mailing list