[llvm] f019c89 - [X86] foldXorTruncShiftIntoCmp - pull out repeated SDLoc. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 3 08:03:27 PDT 2025
Author: Simon Pilgrim
Date: 2025-07-03T16:03:14+01:00
New Revision: f019c890087a044cef031002e76e7626ff912deb
URL: https://github.com/llvm/llvm-project/commit/f019c890087a044cef031002e76e7626ff912deb
DIFF: https://github.com/llvm/llvm-project/commit/f019c890087a044cef031002e76e7626ff912deb.diff
LOG: [X86] foldXorTruncShiftIntoCmp - 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 b85c3e3d94ad8..c92cbcf14ba09 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -52596,7 +52596,8 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG,
/// XOR(TRUNCATE(SRL(X, size(X)-1)), 1)
/// into:
/// SETGT(X, -1)
-static SDValue foldXorTruncShiftIntoCmp(SDNode *N, SelectionDAG &DAG) {
+static SDValue foldXorTruncShiftIntoCmp(SDNode *N, const SDLoc &DL,
+ SelectionDAG &DAG) {
// This is only worth doing if the output type is i8 or i1.
EVT ResultType = N->getValueType(0);
if (ResultType != MVT::i8 && ResultType != MVT::i1)
@@ -52631,7 +52632,6 @@ static SDValue foldXorTruncShiftIntoCmp(SDNode *N, SelectionDAG &DAG) {
// Create a greater-than comparison against -1.
// N.B. Using SETGE against 0 works but we want a canonical looking
// comparison, using SETGT matches up with what TranslateX86CC.
- SDLoc DL(N);
SDValue ShiftOp = Shift.getOperand(0);
EVT ShiftOpTy = ShiftOp.getValueType();
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
@@ -54936,7 +54936,7 @@ static SDValue combineXor(SDNode *N, SelectionDAG &DAG,
if (SDValue R = combineOrXorWithSETCC(N->getOpcode(), DL, VT, N0, N1, DAG))
return R;
- if (SDValue RV = foldXorTruncShiftIntoCmp(N, DAG))
+ if (SDValue RV = foldXorTruncShiftIntoCmp(N, DL, DAG))
return RV;
// Fold not(iX bitcast(vXi1)) -> (iX bitcast(not(vec))) for legal boolvecs.
More information about the llvm-commits
mailing list