From 2b11cf60dbe4b328252488bd9610fd80145f6a28 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 28 Sep 2017 14:47:39 +0000 Subject: [PATCH] [LoopUnroll] Fix use after poison. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314418 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopUnrollPass.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp index a7822c9c791..add18f3a0bf 100644 --- a/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -1304,6 +1304,9 @@ PreservedAnalyses LoopUnrollPass::run(Function &F, // for unrolling is only needed to get optimization remarks emitted in // a forward order. Loop &L = *Worklist.pop_back_val(); +#ifndef NDEBUG + Loop *ParentL = L.getParentLoop(); +#endif // The API here is quite complex to call, but there are only two interesting // states we support: partial and full (or "simple") unrolling. However, to @@ -1326,7 +1329,6 @@ PreservedAnalyses LoopUnrollPass::run(Function &F, // The parent must not be damaged by unrolling! #ifndef NDEBUG - Loop *ParentL = L.getParentLoop(); if (Result != LoopUnrollResult::Unmodified && ParentL) ParentL->verifyLoop(); #endif -- 2.49.0