[PATCH] D131886: Use llvm::all_of (NFC)

LiqinWeng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 21:35:03 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9181ab9223e1: [NFC]] Use llvm::all_of instead of std::all_of (authored by Miss_Grape).

Changed prior to commit:
  https://reviews.llvm.org/D131886?vs=452857&id=454688#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131886/new/

https://reviews.llvm.org/D131886

Files:
  llvm/lib/Analysis/TypeMetadataUtils.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp


Index: llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
===================================================================
--- llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
+++ llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
@@ -20,6 +20,7 @@
 #include "SPIRVTargetMachine.h"
 #include "SPIRVUtils.h"
 #include "TargetInfo/SPIRVTargetInfo.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/TargetPassConfig.h"
 
@@ -77,10 +78,7 @@
   // If there are no capabilities, or we can't satisfy the version or
   // capability requirements, use the list of extensions (if the subtarget
   // can handle them all).
-  if (std::all_of(ReqExts.begin(), ReqExts.end(),
-                  [&ST](const SPIRV::Extension::Extension &Ext) {
-                    return ST.canUseExtension(Ext);
-                  })) {
+  if (llvm::all_of(ReqExts, [&ST](const SPIRV::Extension::Extension &Ext) {
     return {true, {}, ReqExts, 0, 0}; // TODO: add versions to extensions.
   }
   return {false, {}, {}, 0, 0};
Index: llvm/lib/IR/Verifier.cpp
===================================================================
--- llvm/lib/IR/Verifier.cpp
+++ llvm/lib/IR/Verifier.cpp
@@ -4526,8 +4526,8 @@
     visitCallStackMetadata(StackMD);
 
     // Check that remaining operands are MDString.
-    Check(std::all_of(MIB->op_begin() + 1, MIB->op_end(),
-                      [](const MDOperand &Op) { return isa<MDString>(Op); }),
+    Check(llvm::all_of(llvm::drop_begin(MIB->operands()),
+                       [](const MDOperand &Op) { return isa<MDString>(Op); }),
           "Not all !memprof MemInfoBlock operands 1 to N are MDString", MIB);
   }
 }
Index: llvm/lib/Analysis/TypeMetadataUtils.cpp
===================================================================
--- llvm/lib/Analysis/TypeMetadataUtils.cpp
+++ llvm/lib/Analysis/TypeMetadataUtils.cpp
@@ -61,7 +61,7 @@
     } else if (auto GEP = dyn_cast<GetElementPtrInst>(User)) {
       // Take into account the GEP offset.
       if (VPtr == GEP->getPointerOperand() && GEP->hasAllConstantIndices()) {
-        SmallVector<Value *, 8> Indices(GEP->op_begin() + 1, GEP->op_end());
+        SmallVector<Value *, 8> Indices(drop_begin(GEP->operands()));
         int64_t GEPOffset = M->getDataLayout().getIndexedOffsetInType(
             GEP->getSourceElementType(), Indices);
         findLoadCallsAtConstantOffset(M, DevirtCalls, User, Offset + GEPOffset,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131886.454688.patch
Type: text/x-patch
Size: 2441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220823/ed0de719/attachment.bin>


More information about the llvm-commits mailing list