[llvm] [AMDGPU] Improve isBasicBlockPrologue helper function (PR #69924)

Christudasan Devadasan via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 11:18:28 PDT 2023


cdevadas wrote:

> Would you mind giving more details on the issue you are trying to solve? Did you hit the problem in any real case? Does this change has kind of relation with the change: https://reviews.llvm.org/D145329? Thanks!

Yes, this patch would avoid https://reviews.llvm.org/D145329.
Splitting the si_end_cf block doesn't effectively solve the problem in all cases. OCL conformance tests break with incorrect spill insertion in the downstream compiler. D145329, in fact, fixed it but created an incorrect spill placement for a math library code. Because the split inserts the *_term version of the exec manipulation instruction in the block which is a terminator and causes the spill insertion before it for the offending test. That is wrong.
The root cause I believe `isBasicBlockPrologue` isn't complete. Fixing this helper function avoids the need for end_cf block split.
Most of the lit test changes in the patch now insert the spills after the exec manipulation instruction, but that wasn't the case earlier.

https://github.com/llvm/llvm-project/pull/69924


More information about the llvm-commits mailing list