When iterating over a block, meta instructions have no effect on wait counts, but their presence drops the reference to earlier waitcnt instructions before they are processed. This results in spurious wait counts, which do not affect correctness, but are also not required in the resulting program. Skipping meta instructions as soon as they are seen cleans this up.
21 lines
480 B
YAML
21 lines
480 B
YAML
# RUN: llc -mtriple=amdgcn -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck %s
|
|
|
|
# Check that a trivial soft waitcnt at the end of a block is deleted even if it
|
|
# is followed by a meta instruction.
|
|
|
|
# CHECK-LABEL: name: waitcnt-no-redundant
|
|
# CHECK: S_WAITCNT 0
|
|
# CHECK: S_MOV_B32
|
|
# CHECK-NOT: S_WAITCNT
|
|
|
|
---
|
|
name: waitcnt-no-redundant
|
|
body: |
|
|
bb.1:
|
|
S_WAITCNT_soft 53119
|
|
$sgpr2 = S_MOV_B32 42
|
|
S_WAITCNT_soft 53119
|
|
$vgpr2 = IMPLICIT_DEF
|
|
|
|
...
|