Skip to content

Commit f8329c1

Browse files
committed
Corrections based on review comments.
1 parent 0b9cd67 commit f8329c1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,9 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
32123212
Src = Src.getOperand(0);
32133213
}
32143214

3215+
if (Mods != SISrcMods::NONE)
3216+
return true;
3217+
32153218
// Convert various sign-bit masks on integers to src mods. Currently disabled
32163219
// for 16-bit types as the codegen replaces the operand without adding a
32173220
// srcmod. This is intentionally finding the cases where we are performing
@@ -3228,7 +3231,7 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
32283231
(VT != MVT::i32 && VT != MVT::v2i32 && VT != MVT::i64))
32293232
return true;
32303233

3231-
ConstantSDNode *CRHS = dyn_cast<ConstantSDNode>(Src->getOperand(1));
3234+
ConstantSDNode *CRHS = isConstOrConstSplat((Src->getOperand(1)));
32323235
if (!CRHS)
32333236
return true;
32343237

@@ -3243,8 +3246,7 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
32433246
Mods |= SISrcMods::ABS;
32443247
Src = Src.getOperand(0);
32453248
} else if (Opc == ISD::OR && AllowAbs && CRHS->getAPIntValue().isSignMask()) {
3246-
Mods |= SISrcMods::ABS;
3247-
Mods |= SISrcMods::NEG;
3249+
Mods |= SISrcMods::ABS | SISrcMods::NEG;
32483250
Src = Src.getOperand(0);
32493251
}
32503252

0 commit comments

Comments
 (0)