Skip to content

Commit 1d9d465

Browse files
authored
[MLIR][ROCDL] Enable AliasAnalysis for GlobalLoadLds and LDS_Read_Tr (#133255)
Enables AliasAnalysis for `GlobalLoadLds` and `LDS_Read_Tr`. All other memory related ROCDL Ops have this already enabled.
1 parent 2a96bec commit 1d9d465

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,15 @@ def ROCDLGlobalBuffer : LLVM_PointerInAddressSpace<1>;
423423
def ROCDLBufferLDS : LLVM_PointerInAddressSpace<3>;
424424

425425
class ROCDL_LDS_Read_Tr_IntrOp<string mnemonic> :
426-
ROCDL_IntrOp<mnemonic, [1], [], [], 1>,
427-
Arguments<(ins Arg<ROCDLBufferLDS, "", [MemRead]>:$ptr)>{
426+
ROCDL_IntrOp<mnemonic, [1], [], [], 1, 0, 1> {
427+
dag args = (ins Arg<ROCDLBufferLDS, "", [MemRead]>:$ptr);
428+
let arguments = !con(args, aliasAttrs);
428429
let assemblyFormat = "$ptr attr-dict `:` type($ptr) `->` type($res)";
430+
let extraClassDefinition = [{
431+
::llvm::SmallVector<::mlir::Value> $cppClass::getAccessedOperands() {
432+
return {getPtr()};
433+
}
434+
}];
429435
}
430436

431437
def ROCDL_ds_read_tr4_b64 : ROCDL_LDS_Read_Tr_IntrOp<"ds.read.tr4.b64">;
@@ -437,13 +443,19 @@ def ROCDL_ds_read_tr16_b64 : ROCDL_LDS_Read_Tr_IntrOp<"ds.read.tr16.b64">;
437443
// Global load to LDS intrinsic (available in GFX950)
438444

439445
def ROCDL_GlobalLoadLDSOp :
440-
ROCDL_IntrOp<"global.load.lds", [], [], [], 0>,
441-
Arguments<(ins Arg<ROCDLGlobalBuffer, "", [MemRead]>:$globalPtr,
446+
ROCDL_IntrOp<"global.load.lds", [], [], [], 0, 0, 1> {
447+
dag args = (ins Arg<ROCDLGlobalBuffer, "", [MemRead]>:$globalPtr,
442448
Arg<ROCDLBufferLDS, "", [MemWrite]>:$ldsPtr,
443449
I32:$size,
444450
I32:$offset,
445-
I32:$aux)> {
451+
I32:$aux);
452+
let arguments = !con(args, aliasAttrs);
446453
let assemblyFormat = "operands attr-dict";
454+
let extraClassDefinition = [{
455+
::llvm::SmallVector<::mlir::Value> $cppClass::getAccessedOperands() {
456+
return {getGlobalPtr(), getLdsPtr()};
457+
}
458+
}];
447459
}
448460

449461
//===---------------------------------------------------------------------===//

0 commit comments

Comments
 (0)