Skip to content

Commit b3acb25

Browse files
authored
[AMDGPU] Don't rely on !eq comparing int with bits<5>. NFC. (#113279)
Tweak VOP2eInst_Base so that it does not rely on !eq comparing an int value (-1) with a bits<5> value. This is to avoid a change in behaviour when #112904 lands, which is a bug fix which has the side effect of implicitly casting template arguments to the declared template parameter type.
1 parent 6e0b003 commit b3acb25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AMDGPU/VOP2Instructions.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ multiclass
287287

288288
let SchedRW = [Write32Bit] in {
289289
let Uses = !if(useSGPRInput, [VCC, EXEC], [EXEC]) in {
290-
if !eq(VOPDOp, -1) then
290+
if !empty(VOPDName) then
291291
def _e32 : VOP2_Pseudo <opName, P>,
292292
Commutable_REV<revOp#"_e32", !eq(revOp, opName)>;
293293
else
@@ -319,7 +319,7 @@ multiclass
319319
multiclass
320320
VOP2eInst<string opName, VOPProfile P, SDPatternOperator node = null_frag,
321321
string revOp = opName, bit useSGPRInput = !eq(P.NumSrcArgs, 3)>
322-
: VOP2eInst_Base<opName, P, -1, "", node, revOp, useSGPRInput>;
322+
: VOP2eInst_Base<opName, P, 0, "", node, revOp, useSGPRInput>;
323323

324324
multiclass
325325
VOP2eInst_VOPD<string opName, VOPProfile P, bits<5> VOPDOp, string VOPDName,

0 commit comments

Comments
 (0)