[llvm] 5c80a4f - [LegalizeTypes] Remove unnecessary if before calling ReplaceValueWith on the chain in SoftenFloatRes_LOAD.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 00:14:50 PST 2019


Author: Craig Topper
Date: 2019-12-13T00:14:41-08:00
New Revision: 5c80a4f454ac6dad09e5c27f32a28af62cdb4d13

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

LOG: [LegalizeTypes] Remove unnecessary if before calling ReplaceValueWith on the chain in SoftenFloatRes_LOAD.

I believe this is a leftover from when fp128 was softened to fp128
on X86-64. In that case type legalization must have been able to
create a load that was the same as N which would make this
replacement fail or assert. Since we no longer do that, this
check should be unneeded.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 4bea8716b0ca..a563845b39f5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -660,8 +660,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_LOAD(SDNode *N) {
                        L->getAAInfo());
     // Legalized the chain result - switch anything that used the old chain to
     // use the new one.
-    if (N != NewL.getValue(1).getNode())
-      ReplaceValueWith(SDValue(N, 1), NewL.getValue(1));
+    ReplaceValueWith(SDValue(N, 1), NewL.getValue(1));
     return NewL;
   }
 


        


More information about the llvm-commits mailing list