Skip to content

Commit 2a80558

Browse files
[SPIRV] Use llvm::all_of (NFC) (#144099)
We can pass a range to llvm::all_of.
1 parent 6d0cfc2 commit 2a80558

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,15 +1564,14 @@ static bool isUSMStorageClass(SPIRV::StorageClass::StorageClass SC) {
15641564
static bool isASCastInGVar(MachineRegisterInfo *MRI, Register ResVReg) {
15651565
bool IsGRef = false;
15661566
bool IsAllowedRefs =
1567-
std::all_of(MRI->use_instr_begin(ResVReg), MRI->use_instr_end(),
1568-
[&IsGRef](auto const &It) {
1569-
unsigned Opcode = It.getOpcode();
1570-
if (Opcode == SPIRV::OpConstantComposite ||
1571-
Opcode == SPIRV::OpVariable ||
1572-
isSpvIntrinsic(It, Intrinsic::spv_init_global))
1573-
return IsGRef = true;
1574-
return Opcode == SPIRV::OpName;
1575-
});
1567+
llvm::all_of(MRI->use_instructions(ResVReg), [&IsGRef](auto const &It) {
1568+
unsigned Opcode = It.getOpcode();
1569+
if (Opcode == SPIRV::OpConstantComposite ||
1570+
Opcode == SPIRV::OpVariable ||
1571+
isSpvIntrinsic(It, Intrinsic::spv_init_global))
1572+
return IsGRef = true;
1573+
return Opcode == SPIRV::OpName;
1574+
});
15761575
return IsAllowedRefs && IsGRef;
15771576
}
15781577

0 commit comments

Comments
 (0)