[llvm] cb6c093 - [X86] combineConcatVectorOps - pull out repeated getTargetLoweringInfo calls. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 08:37:58 PST 2023


Author: Simon Pilgrim
Date: 2023-12-08T16:37:28Z
New Revision: cb6c0934339c8fb8a00326fbacc46dfdf082e9bb

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

LOG: [X86] combineConcatVectorOps - pull out repeated getTargetLoweringInfo calls. NFC.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index f6c7cabdf64c0..d69976342fcbd 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -54482,6 +54482,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
   SDValue Op0 = Ops[0];
   bool IsSplat = llvm::all_equal(Ops);
   unsigned NumOps = Ops.size();
+  const TargetLowering &TLI = DAG.getTargetLoweringInfo();
 
   // Repeated subvectors.
   if (IsSplat &&
@@ -54938,7 +54939,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
         if (SelVT.getVectorElementType() == MVT::i1) {
           SelVT = EVT::getVectorVT(*DAG.getContext(), MVT::i1,
                                    NumOps * SelVT.getVectorNumElements());
-          if (DAG.getTargetLoweringInfo().isTypeLegal(SelVT))
+          if (TLI.isTypeLegal(SelVT))
             return DAG.getNode(Op0.getOpcode(), DL, VT,
                                ConcatSubOperand(SelVT.getSimpleVT(), Ops, 0),
                                ConcatSubOperand(VT, Ops, 1),
@@ -54952,7 +54953,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
           IsConcatFree(VT, Ops, 1) && IsConcatFree(VT, Ops, 2)) {
         EVT SelVT = Ops[0].getOperand(0).getValueType();
         SelVT = SelVT.getDoubleNumVectorElementsVT(*DAG.getContext());
-        if (DAG.getTargetLoweringInfo().isTypeLegal(SelVT))
+        if (TLI.isTypeLegal(SelVT))
           return DAG.getNode(Op0.getOpcode(), DL, VT,
                              ConcatSubOperand(SelVT.getSimpleVT(), Ops, 0),
                              ConcatSubOperand(VT, Ops, 1),


        


More information about the llvm-commits mailing list