File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -178,18 +178,19 @@ bool AMDGPUAtomicOptimizerImpl::run(Function &F) {
178
178
return Changed;
179
179
}
180
180
181
- static bool shouldOptimizeForType (Type *Ty) {
181
+ static bool isOptimizableAtomic (Type *Ty) {
182
182
switch (Ty->getTypeID ()) {
183
183
case Type::FloatTyID:
184
184
case Type::DoubleTyID:
185
185
return true ;
186
186
case Type::IntegerTyID: {
187
- if (Ty->getIntegerBitWidth () == 32 || Ty->getIntegerBitWidth () == 64 )
187
+ unsigned size = Ty->getIntegerBitWidth ();
188
+ if (size == 32 || size == 64 )
188
189
return true ;
190
+ }
189
191
default :
190
192
return false ;
191
193
}
192
- }
193
194
}
194
195
195
196
void AMDGPUAtomicOptimizerImpl::visitAtomicRMWInst (AtomicRMWInst &I) {
@@ -244,7 +245,7 @@ void AMDGPUAtomicOptimizerImpl::visitAtomicRMWInst(AtomicRMWInst &I) {
244
245
// value to the atomic calculation. We can only optimize divergent values if
245
246
// we have DPP available on our subtarget, and the atomic operation is 32
246
247
// bits.
247
- if (ValDivergent && (!ST->hasDPP () || !shouldOptimizeForType (I.getType ()))) {
248
+ if (ValDivergent && (!ST->hasDPP () || !isOptimizableAtomic (I.getType ()))) {
248
249
return ;
249
250
}
250
251
@@ -326,7 +327,7 @@ void AMDGPUAtomicOptimizerImpl::visitIntrinsicInst(IntrinsicInst &I) {
326
327
// value to the atomic calculation. We can only optimize divergent values if
327
328
// we have DPP available on our subtarget, and the atomic operation is 32
328
329
// bits.
329
- if (ValDivergent && (!ST->hasDPP () || !shouldOptimizeForType (I.getType ()))) {
330
+ if (ValDivergent && (!ST->hasDPP () || !isOptimizableAtomic (I.getType ()))) {
330
331
return ;
331
332
}
332
333
You can’t perform that action at this time.
0 commit comments