[llvm] 2a80558 - [SPIRV] Use llvm::all_of (NFC) (#144099)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 13 13:16:26 PDT 2025
Author: Kazu Hirata
Date: 2025-06-13T13:16:22-07:00
New Revision: 2a805589f56b30b27057c7549dd0ad2963ae16b1
URL: https://github.com/llvm/llvm-project/commit/2a805589f56b30b27057c7549dd0ad2963ae16b1
DIFF: https://github.com/llvm/llvm-project/commit/2a805589f56b30b27057c7549dd0ad2963ae16b1.diff
LOG: [SPIRV] Use llvm::all_of (NFC) (#144099)
We can pass a range to llvm::all_of.
Added:
Modified:
llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
index 8edd0b533b9fa..911a6966aaef0 100644
--- a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
@@ -1564,15 +1564,14 @@ static bool isUSMStorageClass(SPIRV::StorageClass::StorageClass SC) {
static bool isASCastInGVar(MachineRegisterInfo *MRI, Register ResVReg) {
bool IsGRef = false;
bool IsAllowedRefs =
- std::all_of(MRI->use_instr_begin(ResVReg), MRI->use_instr_end(),
- [&IsGRef](auto const &It) {
- unsigned Opcode = It.getOpcode();
- if (Opcode == SPIRV::OpConstantComposite ||
- Opcode == SPIRV::OpVariable ||
- isSpvIntrinsic(It, Intrinsic::spv_init_global))
- return IsGRef = true;
- return Opcode == SPIRV::OpName;
- });
+ llvm::all_of(MRI->use_instructions(ResVReg), [&IsGRef](auto const &It) {
+ unsigned Opcode = It.getOpcode();
+ if (Opcode == SPIRV::OpConstantComposite ||
+ Opcode == SPIRV::OpVariable ||
+ isSpvIntrinsic(It, Intrinsic::spv_init_global))
+ return IsGRef = true;
+ return Opcode == SPIRV::OpName;
+ });
return IsAllowedRefs && IsGRef;
}
More information about the llvm-commits
mailing list