DAG: Check if a value is divergent before requiresUniformRegister

This avoids a potentially expensive scan if we already know it doesn't
matter.
This commit is contained in:
Matt Arsenault 2020-01-31 17:28:25 -05:00
parent b4275bcbe4
commit 792d9b5719
1 changed files with 2 additions and 2 deletions

View File

@ -387,8 +387,8 @@ unsigned FunctionLoweringInfo::CreateRegs(Type *Ty, bool isDivergent) {
}
unsigned FunctionLoweringInfo::CreateRegs(const Value *V) {
return CreateRegs(V->getType(), DA && !TLI->requiresUniformRegister(*MF, V) &&
DA->isDivergent(V));
return CreateRegs(V->getType(), DA && DA->isDivergent(V) &&
!TLI->requiresUniformRegister(*MF, V));
}
/// GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the