<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60638>60638</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion failure in MachineUniformityAnalysis usesValueFromCycle
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AMDGPU
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jayfoad
</td>
</tr>
</table>
<pre>
On this test case:
```
define amdgpu_cs void @f() {
bb:
br label %bb1
bb1:
%i = call i32 @llvm.amdgcn.raw.atomic.buffer.load.i32(<4 x i32> zeroinitializer, i32 0, i32 0, i32 0)
%i2 = icmp eq i32 %i, 0
br i1 %i2, label %bb3, label %bb1
bb3:
%i4 = call i32 @llvm.amdgcn.raw.atomic.buffer.load.i32(<4 x i32> zeroinitializer, i32 0, i32 0, i32 0)
ret void
}
declare i32 @llvm.amdgcn.raw.atomic.buffer.load.i32(<4 x i32>, i32, i32, i32)
```
I get:
```
$ llc -march=amdgcn -mcpu=gfx1030 -o /dev/null -global-isel
llc: /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/MachineUniformityAnalysis.cpp:100: bool llvm::GenericUniformityAnalysisImpl<llvm::GenericSSAContext<llvm::MachineFunction>>::usesValueFromCycle(const llvm::MachineInstr &, const llvm::MachineCycle &) const [ContextT = llvm::GenericSSAContext<llvm::MachineFunction>]: Assertion `!isAlwaysUniform(I)' failed.
```
@sameerds @arsenm FYI
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVE2P2zYQ_TWjC2GBIiXZOuigtauFD0ELpCnQU0GRI5spRboktVnn1xeUtclmP045BBAgUXyceW_mDUUI-mQRW6juoDpkYo5n59vP4jo6obLBqWv7uyXxrAOJGCKRIiDwDugBaAc1XZ9lqXDUFomY1Oky_yMDeXBaESjpCGwHrCGwvbshh-FbDEIGT4wY0BBg1TAUT4jiGQRYpQnwA5HCGKI5S1GNeZjylEza3IsvuYhu0jIf5nFEnxsnVK45S6n5viSP6Rjw38hX9E5bHbUw-it6YPslIH3ro3lOgC0MtJwuBP-7kWCVTuhVf1Kiixs2_X6mir9Yf1PJX6gsf6lMj3Fp2tre7eGpsdIIjz_HaM338tW8aaUjOWF8z2fASmKMJJtJeHkGfrhxIZtJXmbgh9P4WFBOycYRYL3CB2C9nY0hm5NxgzAbHdDcQhkjgXcJdnYTAutX5zNg_UlHYH0Su7l49xnl0zK99ACs3zuF92iB9R-EPGuLn6wenZ90vHZWmGvQIZeXC_CuoDTlGZwzZAnBO-DdPVr0Wr4-dZwuBvj-FfLjx27vbMTH-MPumr2frYza2VTs9KStOWD4S5gZe--m_VUaBLaTzoZIXp0_2hA9AVan5ryDWULcMM2KgepuJfXnYt6fYF0dUpW6ENCnXyS1nBU6dOaLuIa1TsB2x-QbtiWj0AZV_rZLShrEhOhVSKYVPqCdSP_3MVMtVw1vRIZtUW-rpmZl2WTnltYF5YqPdT2IeiyLcqt2O1SjYkzJqpCZbhllnDLaFFu6ZU1OB17yCvkOZVOqbQklxUloky8j4vwp0yHM2Na05rtsmf-wXLWMDUL-i1YB77oPh_s_PgFj6QL27WK4YT6FNGk6xPA9WNTRYPu9PEn-nObSkncNSF47IJu9ac8xXkJqBOtvXj_PQy7d9MzjPzp_URKA9YuY_wMAAP__C__gAQ">