[llvm] e0841f6 - [SelectionDAGBuilder] Remove unneeded vector bitcast from visitTargetIntrinsic.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 14 12:53:02 PST 2022


Author: Craig Topper
Date: 2022-01-14T12:52:49-08:00
New Revision: e0841f692017cad1edf866e9c6907bffda5ea02c

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

LOG: [SelectionDAGBuilder] Remove unneeded vector bitcast from visitTargetIntrinsic.

This seems to be a leftover from a long time ago when there was
an ISD::VBIT_CONVERT and a MVT::Vector. It looks like in those days
the vector type was carried in a VTSDNode.

As far as I know, these days ComputeValueTypes would have already
assigned "Result" the same type we're getting from TLI.getValueType
here. Thus the BITCAST is always a NOP. Verified by adding an assert
and running check-llvm.

Reviewed By: efriedma

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

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 161d7fa876128..82564b951b9f9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4848,10 +4848,7 @@ void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I,
   }
 
   if (!I.getType()->isVoidTy()) {
-    if (VectorType *PTy = dyn_cast<VectorType>(I.getType())) {
-      EVT VT = TLI.getValueType(DAG.getDataLayout(), PTy);
-      Result = DAG.getNode(ISD::BITCAST, getCurSDLoc(), VT, Result);
-    } else
+    if (!isa<VectorType>(I.getType()))
       Result = lowerRangeToAssertZExt(DAG, I, Result);
 
     MaybeAlign Alignment = I.getRetAlign();


        


More information about the llvm-commits mailing list