Skip to content

Commit 9e41b65

Browse files
Fix UT test_core.py::test_poison_return failure (#2685)
Closes #2482 Cuda converts tt.store to inline_asm command, and xpu converts it to llvm.store. Then the LLVM optimizer for the SROA function removes llvm.store with the poison value, but ignores the cuda assembly instruction. Signed-off-by: Kirill Suvorov <[email protected]>
1 parent 0d9c0d3 commit 9e41b65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/test/unit/language/test_core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5186,8 +5186,6 @@ def return_poison(x):
51865186

51875187

51885188
def test_poison_return(device):
5189-
if is_xpu():
5190-
pytest.skip("FIXME: poison is optimized away by opt")
51915189

51925190
@triton.jit
51935191
def kernel(Out):
@@ -5196,7 +5194,9 @@ def kernel(Out):
51965194
a = torch.empty((), device=device, dtype=torch.int32)
51975195
h = kernel[(1, )](a)
51985196
assert "ub.poison" in h.asm["ttir"], h.asm["ttir"]
5199-
assert "poison" in h.asm["llir"], h.asm["llir"]
5197+
# xpu uses llvm.store, which in this case is removed by the optimizer
5198+
if not is_xpu():
5199+
assert "poison" in h.asm["llir"], h.asm["llir"]
52005200

52015201

52025202
# -----------------------

0 commit comments

Comments
 (0)