[llvm] 3fb1041 - [SelectionDAGBuilder] Use getPtrExtOrTrunc in place of getZExtOrTrunc. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 13:08:56 PDT 2023


Author: Craig Topper
Date: 2023-05-19T13:08:39-07:00
New Revision: 3fb1041165d78bee8fa9a0871d78a4d54fcea11f

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

LOG: [SelectionDAGBuilder] Use getPtrExtOrTrunc in place of getZExtOrTrunc. NFC

This getZExtOrTrunc seems to have been added when getPtrExtOrTrunc
was introduced. getPtrExtOrTrunc is currently equivalent to getZExtOrTrunc,
but could be changed for some target in the future.

Reviewed By: t.p.northover

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 19fc413b193a..1b82a16f7550 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4234,7 +4234,7 @@ void SelectionDAGBuilder::visitLoad(const LoadInst &I) {
     Chains[ChainI] = L.getValue(1);
 
     if (MemVTs[i] != ValueVTs[i])
-      L = DAG.getZExtOrTrunc(L, dl, ValueVTs[i]);
+      L = DAG.getPtrExtOrTrunc(L, dl, ValueVTs[i]);
 
     Values[i] = L;
   }


        


More information about the llvm-commits mailing list