Skip to content

Commit a99458d

Browse files
committed
Corrections based on review comments.
1 parent 3e0c7c8 commit a99458d

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
@@ -3036,6 +3036,9 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
30363036
Src = Src.getOperand(0);
30373037
}
30383038

3039+
if(Mods != SISrcMods::NONE)
3040+
return true;
3041+
30393042
// Convert various sign-bit masks on integers to src mods. Currently disabled
30403043
// for 16-bit types as the codegen replaces the operand without adding a
30413044
// srcmod. This is intentionally finding the cases where we are performing
@@ -3052,7 +3055,7 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
30523055
(VT != MVT::i32 && VT != MVT::v2i32 && VT != MVT::i64))
30533056
return true;
30543057

3055-
ConstantSDNode *CRHS = dyn_cast<ConstantSDNode>(Src->getOperand(1));
3058+
ConstantSDNode *CRHS = isConstOrConstSplat((Src->getOperand(1)));
30563059
if (!CRHS)
30573060
return true;
30583061

@@ -3067,8 +3070,7 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
30673070
Mods |= SISrcMods::ABS;
30683071
Src = Src.getOperand(0);
30693072
} else if (Opc == ISD::OR && AllowAbs && CRHS->getAPIntValue().isSignMask()) {
3070-
Mods |= SISrcMods::ABS;
3071-
Mods |= SISrcMods::NEG;
3073+
Mods |= SISrcMods::ABS | SISrcMods::NEG;
30723074
Src = Src.getOperand(0);
30733075
}
30743076

0 commit comments

Comments
 (0)