aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorJessica Del <50999226+OutOfCache@users.noreply.github.com>2023-12-15 15:49:25 +0100
committerGitHub <noreply@github.com>2023-12-15 15:49:25 +0100
commit32f9983c064557883223b585810eac3c6797d500 (patch)
treec2d29f827e3f99ea0a4018d0501ecb2ed75de325 /llvm/lib/IR
parent163aeca33d4adb97e8599584409457ca14b1419b (diff)
downloadllvm-32f9983c064557883223b585810eac3c6797d500.zip
llvm-32f9983c064557883223b585810eac3c6797d500.tar.gz
llvm-32f9983c064557883223b585810eac3c6797d500.tar.bz2
[AMDGPU] - Add address space for strided buffers (#74471)
This is an experimental address space for strided buffers. These buffers can have structs as elements and a stride > 1. These pointers allow the indexed access in units of stride, i.e., they point at `buffer[index * stride]`. Thus, we can use the `idxen` modifier for buffer loads. We assign address space 9 to 192-bit buffer pointers which contain a 128-bit descriptor, a 32-bit offset and a 32-bit index. Essentially, they are fat buffer pointers with an additional 32-bit index.
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index eeac80c..738ec30 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -5207,10 +5207,12 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
// This goes before adding new address spaces to prevent incoherent string
// values.
if (!DL.contains("-ni") && !DL.starts_with("ni"))
- Res.append("-ni:7:8");
- // Update ni:7 to ni:7:8.
+ Res.append("-ni:7:8:9");
+ // Update ni:7 to ni:7:8:9.
if (DL.ends_with("ni:7"))
- Res.append(":8");
+ Res.append(":8:9");
+ if (DL.ends_with("ni:7:8"))
+ Res.append(":9");
// Add sizing for address spaces 7 and 8 (fat raw buffers and buffer
// resources) An empty data layout has already been upgraded to G1 by now.
@@ -5218,6 +5220,8 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
Res.append("-p7:160:256:256:32");
if (!DL.contains("-p8") && !DL.starts_with("p8"))
Res.append("-p8:128:128");
+ if (!DL.contains("-p9") && !DL.startswith("p9"))
+ Res.append("-p9:192:256:256:32");
return Res;
}