|
14 | 14 | #include "llvm/ADT/APInt.h"
|
15 | 15 | #include "llvm/ADT/StringMap.h"
|
16 | 16 | #include "llvm/ADT/StringRef.h"
|
| 17 | +#include "llvm/IR/InstIterator.h" |
17 | 18 | #include "llvm/IR/IntrinsicInst.h"
|
18 | 19 | #include "llvm/IR/Module.h"
|
19 | 20 | #include "llvm/IR/Operator.h"
|
@@ -156,12 +157,11 @@ PreservedAnalyses CompileTimePropertiesPass::run(Module &M,
|
156 | 157 | // Check pointer annotations.
|
157 | 158 | SmallVector<IntrinsicInst *, 4> RemovableAnnots;
|
158 | 159 | 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; |
165 | 165 |
|
166 | 166 | // Remove irrelevant "sycl-properties" annotations after the transformations.
|
167 | 167 | for (IntrinsicInst *IntrInst : RemovableAnnots) {
|
|
0 commit comments