@@ -1131,32 +1131,45 @@ WIAnalysis::WIDependancy WIAnalysisRunner::calculate_dep(const CallInst* inst)
1131
1131
return WIAnalysis::UNIFORM;
1132
1132
}
1133
1133
1134
- if (intrinsic_name == llvm_waveShuffleIndex )
1134
+ if (m_CGCtx-> platform . HasUniformSubGroupIntrinsic () )
1135
1135
{
1136
- Value* op0 = inst->getArgOperand (0 );
1137
- Value* op1 = inst->getArgOperand (1 );
1138
- if (WIAnalysis::UNIFORM == getDependency (op0) ||
1139
- WIAnalysis::UNIFORM == getDependency (op1))
1136
+ if (intrinsic_name == llvm_waveShuffleIndex)
1137
+ {
1138
+ Value* op0 = inst->getArgOperand (0 );
1139
+ Value* op1 = inst->getArgOperand (1 );
1140
+ if (WIAnalysis::UNIFORM == getDependency (op0) ||
1141
+ WIAnalysis::UNIFORM == getDependency (op1))
1142
+ {
1143
+ return WIAnalysis::UNIFORM;
1144
+ }
1145
+ }
1146
+
1147
+ if (intrinsic_name == llvm_waveBallot || intrinsic_name == llvm_waveAll)
1140
1148
{
1141
1149
return WIAnalysis::UNIFORM;
1142
1150
}
1143
- }
1144
1151
1145
- if (intrinsic_name == llvm_waveBallot || intrinsic_name == llvm_waveAll )
1146
- {
1147
- return WIAnalysis::UNIFORM;
1148
- }
1152
+ if ( intrinsic_name == llvm_waveClustered )
1153
+ {
1154
+ const unsigned clusterSize = static_cast < unsigned >(
1155
+ cast<llvm::ConstantInt>(inst-> getArgOperand ( 2 ))-> getZExtValue ());
1149
1156
1150
- if (intrinsic_name == llvm_waveClustered)
1157
+ constexpr unsigned maxSimdSize = 32 ;
1158
+ if (clusterSize == maxSimdSize)
1159
+ {
1160
+ // TODO: do the same for SIMD8 and SIMD16 if possible.
1161
+ return WIAnalysis::UNIFORM;
1162
+ }
1163
+ }
1164
+ }
1165
+ else
1151
1166
{
1152
- const unsigned clusterSize = static_cast <unsigned >(
1153
- cast<llvm::ConstantInt>(inst->getArgOperand (2 ))->getZExtValue ());
1154
-
1155
- constexpr unsigned maxSimdSize = 32 ;
1156
- if (clusterSize == maxSimdSize)
1167
+ if (GII_id == GenISAIntrinsic::GenISA_getSR0 ||
1168
+ GII_id == GenISAIntrinsic::GenISA_eu_id ||
1169
+ GII_id == GenISAIntrinsic::GenISA_eu_thread_id)
1157
1170
{
1158
- // TODO: do the same for SIMD8 and SIMD16 if possible.
1159
- return WIAnalysis::UNIFORM ;
1171
+ // do not assume these per-thread values are globally uniform
1172
+ return WIAnalysis::RANDOM ;
1160
1173
}
1161
1174
}
1162
1175
0 commit comments