summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/SafeStack.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/ADCE.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/BDCE.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/Float2Int.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp4
6 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/SafeStack.cpp b/llvm/lib/Transforms/Instrumentation/SafeStack.cpp
index 6b185a2b127..ac2775b6397 100644
--- a/llvm/lib/Transforms/Instrumentation/SafeStack.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SafeStack.cpp
@@ -275,7 +275,7 @@ void SafeStack::findInsts(Function &F,
SmallVectorImpl<AllocaInst *> &DynamicAllocas,
SmallVectorImpl<ReturnInst *> &Returns,
SmallVectorImpl<Instruction *> &StackRestorePoints) {
- for (Instruction &I : inst_range(&F)) {
+ for (Instruction &I : instructions(&F)) {
if (auto AI = dyn_cast<AllocaInst>(&I)) {
++NumAllocas;
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp
index 824342ad7e3..96a0107ce18 100644
--- a/llvm/lib/Transforms/Scalar/ADCE.cpp
+++ b/llvm/lib/Transforms/Scalar/ADCE.cpp
@@ -57,7 +57,7 @@ bool ADCE::runOnFunction(Function& F) {
SmallVector<Instruction*, 128> Worklist;
// Collect the set of "root" instructions that are known live.
- for (Instruction &I : inst_range(F)) {
+ for (Instruction &I : instructions(F)) {
if (isa<TerminatorInst>(I) || isa<DbgInfoIntrinsic>(I) || I.isEHPad() ||
I.mayHaveSideEffects()) {
Alive.insert(&I);
@@ -79,7 +79,7 @@ bool ADCE::runOnFunction(Function& F) {
// which have no side effects and do not influence the control flow or return
// value of the function, and may therefore be deleted safely.
// NOTE: We reuse the Worklist vector here for memory efficiency.
- for (Instruction &I : inst_range(F)) {
+ for (Instruction &I : instructions(F)) {
if (!Alive.count(&I)) {
Worklist.push_back(&I);
I.dropAllReferences();
diff --git a/llvm/lib/Transforms/Scalar/BDCE.cpp b/llvm/lib/Transforms/Scalar/BDCE.cpp
index 7252db0a6cd..909a86f740b 100644
--- a/llvm/lib/Transforms/Scalar/BDCE.cpp
+++ b/llvm/lib/Transforms/Scalar/BDCE.cpp
@@ -272,7 +272,7 @@ bool BDCE::runOnFunction(Function& F) {
SmallPtrSet<Instruction*, 128> Visited;
// Collect the set of "root" instructions that are known live.
- for (Instruction &I : inst_range(F)) {
+ for (Instruction &I : instructions(F)) {
if (!isAlwaysLive(&I))
continue;
@@ -365,7 +365,7 @@ bool BDCE::runOnFunction(Function& F) {
// which have no side effects and do not influence the control flow or return
// value of the function, and may therefore be deleted safely.
// NOTE: We reuse the Worklist vector here for memory efficiency.
- for (Instruction &I : inst_range(F)) {
+ for (Instruction &I : instructions(F)) {
// For live instructions that have all dead bits, first make them dead by
// replacing all uses with something else. Then, if they don't need to
// remain live (because they have side effects, etc.) we can remove them.
diff --git a/llvm/lib/Transforms/Scalar/Float2Int.cpp b/llvm/lib/Transforms/Scalar/Float2Int.cpp
index 8c1dce1c9fb..f52c32b9721 100644
--- a/llvm/lib/Transforms/Scalar/Float2Int.cpp
+++ b/llvm/lib/Transforms/Scalar/Float2Int.cpp
@@ -127,7 +127,7 @@ static Instruction::BinaryOps mapBinOpcode(unsigned Opcode) {
// Find the roots - instructions that convert from the FP domain to
// integer domain.
void Float2Int::findRoots(Function &F, SmallPtrSet<Instruction*,8> &Roots) {
- for (auto &I : inst_range(F)) {
+ for (auto &I : instructions(F)) {
switch (I.getOpcode()) {
default: break;
case Instruction::FPToUI:
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
index 098e6eff15f..d6a48c783b4 100644
--- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
+++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
@@ -466,7 +466,7 @@ static Instruction *findLocationForEntrySafepoint(Function &F,
static void findCallSafepoints(Function &F,
std::vector<CallSite> &Found /*rval*/) {
assert(Found.empty() && "must be empty!");
- for (Instruction &I : inst_range(F)) {
+ for (Instruction &I : instructions(F)) {
Instruction *inst = &I;
if (isa<CallInst>(inst) || isa<InvokeInst>(inst)) {
CallSite CS(inst);
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index 53975e254b1..6f70147c2a0 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -2310,7 +2310,7 @@ void RewriteStatepointsForGC::stripDereferenceabilityInfoFromBody(Function &F) {
LLVMContext &Ctx = F.getContext();
MDBuilder Builder(Ctx);
- for (Instruction &I : inst_range(F)) {
+ for (Instruction &I : instructions(F)) {
if (const MDNode *MD = I.getMetadata(LLVMContext::MD_tbaa)) {
assert(MD->getNumOperands() < 5 && "unrecognized metadata shape!");
bool IsImmutableTBAA =
@@ -2384,7 +2384,7 @@ bool RewriteStatepointsForGC::runOnFunction(Function &F) {
// when rewriting. We'll delete the unreachable ones in a moment.
SmallVector<CallSite, 64> ParsePointNeeded;
bool HasUnreachableStatepoint = false;
- for (Instruction &I : inst_range(F)) {
+ for (Instruction &I : instructions(F)) {
// TODO: only the ones with the flag set!
if (isStatepoint(I)) {
if (DT.isReachableFromEntry(I.getParent()))
OpenPOWER on IntegriCloud