Skip to content

Commit a0bf06e

Browse files
committed
Limit fp srcmods on integers to select/v_cndmask
1 parent 08280c0 commit a0bf06e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3036,12 +3036,15 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
30363036
Src = Src.getOperand(0);
30373037
}
30383038

3039-
// Convert various sign-bit masks to src mods. Currently disabled for 16-bit
3040-
// types as the codegen replaces the operand without adding a srcmod.
3041-
// This is intentionally finding the cases where we are performing float neg
3042-
// and abs on int types, the goal is not to obtain two's complement neg or
3043-
// abs.
3039+
// Convert various sign-bit masks on integers to src mods. Currently disabled
3040+
// for 16-bit types as the codegen replaces the operand without adding a
3041+
// srcmod. This is intentionally finding the cases where we are performing
3042+
// float neg and abs on int types, the goal is not to obtain two's complement
3043+
// neg or abs. Hence, this is non-canonicalizing.
30443044
// TODO: Add 16-bit support.
3045+
if (IsCanonicalizing)
3046+
return true;
3047+
30453048
unsigned Opc = Src->getOpcode();
30463049
EVT VT = Src.getValueType();
30473050
if ((Opc != ISD::AND && Opc != ISD::OR && Opc != ISD::XOR) ||

0 commit comments

Comments
 (0)