Skip to content

[AMDGPU] Incorrect outputs from tiling kernel after PR #129464 #131386

Closed
@krzysz00

Description

@krzysz00

To reproduce, grab https://github.com/user-attachments/files/19236058/129464-reproducer.zip and, on a gfx942/MI-300, make test after (if necessary) editing the Makefile to point at the LLVM build you'd like to test.

The IR that triggers the miscompile is in input.ll within that attached file, and compiles correctly under -O1 but does not compile correctly under -O3.

The test harness, which demonstrates the expected array packing the program performs, is in driver.cpp in the attached reproducer. The code takes a 100x250 array of 32-bit ints an input and produces a 16x4x16x32 array, where out[i][j][k][l] == in[j * 32 + l][i * 16 + k], defaulting to 42 for elements that would be out of bounds in in.

The failure is

Mismatch at (0, 1, 14, 4) got 11014 but wanted 9014
Mismatch at (0, 2, 14, 4) got 19014 but wanted 17014
Mismatch at (1, 0, 14, 4) got 3030 but wanted 1030
Mismatch at (1, 1, 14, 4) got 11030 but wanted 9030
Mismatch at (1, 2, 14, 4) got 19030 but wanted 17030
Mismatch at (2, 0, 14, 4) got 3046 but wanted 1046
Mismatch at (2, 1, 14, 4) got 11046 but wanted 9046
Mismatch at (2, 2, 14, 4) got 19046 but wanted 17046
...
Mismatch at (12, 0, 14, 4) got 3206 but wanted 1206
Mismatch at (12, 1, 14, 4) got 11206 but wanted 9206
Mismatch at (12, 2, 14, 4) got 19206 but wanted 17206
Mismatch at (13, 0, 14, 4) got 3222 but wanted 1222
Mismatch at (13, 1, 14, 4) got 11222 but wanted 9222
Mismatch at (13, 2, 14, 4) got 19222 but wanted 17222
Mismatch at (14, 0, 14, 4) got 3238 but wanted 1238
Mismatch at (14, 1, 14, 4) got 11238 but wanted 9238
Mismatch at (14, 2, 14, 4) got 19238 but wanted 17238

as if some particular register were being dropped.

I bisected this failure to #129464 - I don't know if this PR caused the failure or exposed some other underlying bug.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions