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

Christudasan Devadasan via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 21:10:37 PDT 2023


cdevadas wrote:

> I think isBasicBlockPrologue is unworkable and should be removed. I don't think it's sensible to do ad-hoc exec mask tracking like this and we need a better control flow representation. I think for the moment we are better off splitting blocks, and then starting to augment MachineBasicBlock with an annotation of the divergent CFG.

The spills inserted at the block entry for BBLiveIns are part of the BB prolog. That's what I believe. So, teaching `isBasicBlockPrologue` seems the right approach to me unless there is a strong reason against it.
The initially proposed bb split approach still needs a fixup in the isBasicBlockPrologue. Any subsequent spill insertion in the same block causes a problem because the first spill would break the bb prolog which is wrong.

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


More information about the llvm-commits mailing list