[llvm] dac94f2 - [X86] combineAndNotOrIntoAndNotAnd - pull out repeated SDLoc(). NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 18 00:17:25 PDT 2025


Author: Simon Pilgrim
Date: 2025-06-18T08:17:07+01:00
New Revision: dac94f28e696e8234ec69bbed549533ea6b00227

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

LOG: [X86] combineAndNotOrIntoAndNotAnd - pull out repeated SDLoc(). 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 335481b97d47e..62912f1c8d123 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -51308,13 +51308,11 @@ static bool hasBZHI(const X86Subtarget &Subtarget, MVT VT) {
 
 /// Folds (and X, (or Y, ~Z)) --> (and X, ~(and ~Y, Z))
 /// This undoes the inverse fold performed in InstCombine
-static SDValue combineAndNotOrIntoAndNotAnd(SDNode *N, SelectionDAG &DAG) {
-
+static SDValue combineAndNotOrIntoAndNotAnd(SDNode *N, const SDLoc &DL,
+                                            SelectionDAG &DAG) {
   using namespace llvm::SDPatternMatch;
   MVT VT = N->getSimpleValueType(0);
-  SDLoc DL(N);
-  const TargetLowering &TLI = DAG.getTargetLoweringInfo();
-  if (!TLI.hasAndNot(SDValue(N, 0)))
+  if (!DAG.getTargetLoweringInfo().hasAndNot(SDValue(N, 0)))
     return SDValue();
 
   SDValue X, Y, Z;
@@ -51850,7 +51848,7 @@ static SDValue combineAnd(SDNode *N, SelectionDAG &DAG,
   if (SDValue R = combineAndLoadToBZHI(N, DAG, Subtarget))
     return R;
 
-  if (SDValue R = combineAndNotOrIntoAndNotAnd(N, DAG))
+  if (SDValue R = combineAndNotOrIntoAndNotAnd(N, dl, DAG))
     return R;
 
   // fold (and (mul x, c1), c2) -> (mul x, (and c1, c2))


        


More information about the llvm-commits mailing list