Skip to content

Commit 0711565

Browse files
authored
[AMDGPU] Fix flat D16 patterns handling of cpol. NFCI. (#150551)
GlobalSAddr and ScratchSVAddr produce 4 operands, not 3 as before. The last one is CPol which is curently ignored by D16 patterns. I was unable to catch it on any wrongdoing with these patterns, but in general it is dangerous to ignore it.
1 parent d3937e2 commit 0711565

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Target/AMDGPU/FLATInstructions.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,8 +1301,8 @@ class FlatSignedLoadPat_D16_t16 <FLAT_Pseudo inst, SDPatternOperator node, Value
13011301
>;
13021302

13031303
class GlobalLoadSaddrPat_D16 <FLAT_Pseudo inst, SDPatternOperator node, ValueType vt> : GCNPat <
1304-
(vt (node (GlobalSAddr (i64 SReg_64:$saddr), (i32 VGPR_32:$voffset), i32:$offset), vt:$in)),
1305-
(inst $saddr, $voffset, $offset, 0, $in)
1304+
(vt (node (GlobalSAddr (i64 SReg_64:$saddr), (i32 VGPR_32:$voffset), i32:$offset, CPol:$cpol), vt:$in)),
1305+
(inst $saddr, $voffset, $offset, $cpol, $in)
13061306
>;
13071307

13081308
class FlatLoadSaddrPat_D16 <FLAT_Pseudo inst, SDPatternOperator node, ValueType vt> : GCNPat <
@@ -1316,8 +1316,8 @@ class FlatLoadSaddrPat_D16_t16 <FLAT_Pseudo inst, SDPatternOperator node, ValueT
13161316
>;
13171317

13181318
class GlobalLoadSaddrPat_D16_t16 <FLAT_Pseudo inst, SDPatternOperator node, ValueType vt> : GCNPat <
1319-
(vt (node (GlobalSAddr (i64 SReg_64:$saddr), (i32 VGPR_32:$voffset), i32:$offset))),
1320-
(inst $saddr, $voffset, $offset, (i32 0))
1319+
(vt (node (GlobalSAddr (i64 SReg_64:$saddr), (i32 VGPR_32:$voffset), i32:$offset, CPol:$cpol))),
1320+
(inst $saddr, $voffset, $offset, $cpol)
13211321
>;
13221322

13231323
class FlatLoadSignedPat <FLAT_Pseudo inst, SDPatternOperator node, ValueType vt> : GCNPat <
@@ -1521,8 +1521,8 @@ class ScratchLoadSVaddrPat_D16 <FLAT_Pseudo inst, SDPatternOperator node, ValueT
15211521
>;
15221522

15231523
class ScratchLoadSVaddrPat_D16_t16 <FLAT_Pseudo inst, SDPatternOperator node, ValueType vt> : GCNPat <
1524-
(vt (node (ScratchSVAddr (i32 VGPR_32:$vaddr), (i32 SGPR_32:$saddr), i32:$offset))),
1525-
(inst $vaddr, $saddr, $offset, 0)
1524+
(vt (node (ScratchSVAddr (i32 VGPR_32:$vaddr), (i32 SGPR_32:$saddr), i32:$offset, CPol:$cpol))),
1525+
(inst $vaddr, $saddr, $offset, $cpol)
15261526
>;
15271527

15281528
multiclass GlobalFLATLoadPats<FLAT_Pseudo inst, SDPatternOperator node, ValueType vt> {

0 commit comments

Comments
 (0)