[llvm] [AMDGPU] Skip terminators when forcing emit zero flag (PR #112116)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 08:44:56 PDT 2024


shiltian wrote:

>  That option is weird. I thought it meant "if any waitcnt is required, wait for the counter to be 0". But actually it waits for the counter to be zero after every instruction, even instructions that have nothing to do with wait counts.

The name of the option is indeed a little bit confusing.

> I think the point to avoid this was here

We do need waitcnt in some cases (even w/o the option). That indicates that we can't simply skip the iteration (calling `generateWaitcntInstBefore`) if the instruction is a terminator.

```
    bool FlushVmCnt = Block.getFirstTerminator() == Inst &&
                      isPreheaderToFlush(Block, ScoreBrackets);
```

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


More information about the llvm-commits mailing list