Skip to content

Commit 1ef4d3b

Browse files
committed
[X86] canonicalizeBitSelect/combineLogicBlendIntoPBLENDV - avoid SDLoc duplication. NFC.
Reuse caller's equivalent SDLoc
1 parent d9e2fb7 commit 1ef4d3b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50993,7 +50993,8 @@ static SDValue combineAnd(SDNode *N, SelectionDAG &DAG,
5099350993
}
5099450994

5099550995
// Canonicalize OR(AND(X,C),AND(Y,~C)) -> OR(AND(X,C),ANDNP(C,Y))
50996-
static SDValue canonicalizeBitSelect(SDNode *N, SelectionDAG &DAG,
50996+
static SDValue canonicalizeBitSelect(SDNode *N, const SDLoc &DL,
50997+
SelectionDAG &DAG,
5099750998
const X86Subtarget &Subtarget) {
5099850999
assert(N->getOpcode() == ISD::OR && "Unexpected Opcode");
5099951000

@@ -51033,8 +51034,6 @@ static SDValue canonicalizeBitSelect(SDNode *N, SelectionDAG &DAG,
5103351034
return SDValue();
5103451035
}
5103551036

51036-
SDLoc DL(N);
51037-
5103851037
if (useVPTERNLOG(Subtarget, VT)) {
5103951038
// Emit a VPTERNLOG node directly - 0xCA is the imm code for A?B:C.
5104051039
// VPTERNLOG is only available as vXi32/64-bit types.
@@ -51097,7 +51096,8 @@ static bool matchLogicBlend(SDNode *N, SDValue &X, SDValue &Y, SDValue &Mask) {
5109751096
// (or (and (m, (sub 0, x)), (pandn m, x)))
5109851097
// into:
5109951098
// (sub (xor X, M), M)
51100-
static SDValue combineLogicBlendIntoPBLENDV(SDNode *N, SelectionDAG &DAG,
51099+
static SDValue combineLogicBlendIntoPBLENDV(SDNode *N, const SDLoc &DL,
51100+
SelectionDAG &DAG,
5110151101
const X86Subtarget &Subtarget) {
5110251102
assert(N->getOpcode() == ISD::OR && "Unexpected Opcode");
5110351103

@@ -51122,8 +51122,6 @@ static SDValue combineLogicBlendIntoPBLENDV(SDNode *N, SelectionDAG &DAG,
5112251122
if (!MaskVT.isInteger() || DAG.ComputeNumSignBits(Mask) != EltBits)
5112351123
return SDValue();
5112451124

51125-
SDLoc DL(N);
51126-
5112751125
// Attempt to combine to conditional negate: (sub (xor X, M), M)
5112851126
if (SDValue Res = combineLogicBlendIntoConditionalNegate(VT, Mask, X, Y, DL,
5112951127
DAG, Subtarget))
@@ -51607,10 +51605,10 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG,
5160751605
if (SDValue R = combineCompareEqual(N, DAG, DCI, Subtarget))
5160851606
return R;
5160951607

51610-
if (SDValue R = canonicalizeBitSelect(N, DAG, Subtarget))
51608+
if (SDValue R = canonicalizeBitSelect(N, dl, DAG, Subtarget))
5161151609
return R;
5161251610

51613-
if (SDValue R = combineLogicBlendIntoPBLENDV(N, DAG, Subtarget))
51611+
if (SDValue R = combineLogicBlendIntoPBLENDV(N, dl, DAG, Subtarget))
5161451612
return R;
5161551613

5161651614
// (0 - SetCC) | C -> (zext (not SetCC)) * (C + 1) - 1 if we can get a LEA out of it.

0 commit comments

Comments
 (0)