diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-09-23 23:47:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-24 06:47:30 +0000 |
| commit | 9c2024a7509baae921083d49a56e1321c51f00ec (patch) | |
| tree | 1f66721d16ee032893418b8ef4f7e23a1714c034 /tests | |
| parent | 979e16a34ef9ff2806476b809e2dcba5a96c40d4 (diff) | |
Remove unnecessary Load and Store pair (#8433)
This commit removes unnecessary Load and Store pairs in IR.
When the IR is like
```
let %1 = var
let %2 = load(%ptr)
store(%1 %2)
```
This PR will replace all uses of %1 with %ptr.
And the load and store instructions will be removed.
But I found that there can be cases where %2 might be still used later
in other IRs.
For these cases, the removal of load instruction relies on DCE.
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/metal/vector-get-element-ptr.slang | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/metal/vector-get-element-ptr.slang b/tests/metal/vector-get-element-ptr.slang index af2acabbc..1c616b37e 100644 --- a/tests/metal/vector-get-element-ptr.slang +++ b/tests/metal/vector-get-element-ptr.slang @@ -14,11 +14,11 @@ void modify(inout int v) void computeMain(int3 v : SV_DispatchThreadID) { int3 u = v; - // CHECK: int [[TEMP:[a-zA-Z0-9_]+]] = u{{.*}}.x; + // CHECK: int [[TEMP:[a-zA-Z0-9_]+]] = [[OUT:[a-zA-Z0-9_]+]].x; // CHECK: modify{{.*}}(&[[TEMP]]) - // CHECK: u{{.*}}.x = [[TEMP]]; + // CHECK: [[OUT]].x = [[TEMP]]; modify(u.x); // BUF: 2 outputBuffer[0] = u.x + u.y; -}
\ No newline at end of file +} |
