Skip to content

Commit 8b17272

Browse files
committed
Use inst_iterator
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent c23bfa7 commit 8b17272

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/tools/sycl-post-link/CompileTimePropertiesPass.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "llvm/ADT/APInt.h"
1515
#include "llvm/ADT/StringMap.h"
1616
#include "llvm/ADT/StringRef.h"
17+
#include "llvm/IR/InstIterator.h"
1718
#include "llvm/IR/IntrinsicInst.h"
1819
#include "llvm/IR/Module.h"
1920
#include "llvm/IR/Operator.h"
@@ -156,12 +157,11 @@ PreservedAnalyses CompileTimePropertiesPass::run(Module &M,
156157
// Check pointer annotations.
157158
SmallVector<IntrinsicInst *, 4> RemovableAnnots;
158159
for (Function &F : M)
159-
for (BasicBlock &BB : F)
160-
for (Instruction &Inst : BB)
161-
if (auto *IntrInst = dyn_cast<IntrinsicInst>(&Inst))
162-
if (IntrInst->getIntrinsicID() == Intrinsic::ptr_annotation &&
163-
transformSYCLPropertiesAnnotation(M, IntrInst, RemovableAnnots))
164-
CompileTimePropertiesMet = true;
160+
for (inst_iterator I = inst_begin(&F), E = inst_end(&F); I != E; ++I)
161+
if (auto *IntrInst = dyn_cast<IntrinsicInst>(&*I))
162+
if (IntrInst->getIntrinsicID() == Intrinsic::ptr_annotation &&
163+
transformSYCLPropertiesAnnotation(M, IntrInst, RemovableAnnots))
164+
CompileTimePropertiesMet = true;
165165

166166
// Remove irrelevant "sycl-properties" annotations after the transformations.
167167
for (IntrinsicInst *IntrInst : RemovableAnnots) {

0 commit comments

Comments
 (0)