diff options
| author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2019-06-12 08:34:51 +0000 | 
|---|---|---|
| committer | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2019-06-12 08:34:51 +0000 | 
| commit | a94715639619a258a714deeb485d2d7fb9dd1cb9 (patch) | |
| tree | 008ae0d540dcf5ef766d3cd14baffcaa245e4791 /llvm/lib/Transforms/Vectorize | |
| parent | f8b4e60c7f514d70e9b603673fbc351c5df141e1 (diff) | |
| download | bcm5719-llvm-a94715639619a258a714deeb485d2d7fb9dd1cb9.tar.gz bcm5719-llvm-a94715639619a258a714deeb485d2d7fb9dd1cb9.zip | |
Revert "[DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion"
This reverts commit 1a0f7a2077b70c9864faa476e15b048686cf1ca7.
See phabricator thread for D60831.
llvm-svn: 363132
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 20 | 
1 files changed, 6 insertions, 14 deletions
| diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index b7ffe817c33..79528e5927e 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2911,11 +2911,11 @@ BasicBlock *InnerLoopVectorizer::createVectorizedLoopSkeleton() {          CmpInst::Create(Instruction::ICmp, CmpInst::ICMP_EQ, Count,                          CountRoundDown, "cmp.n", MiddleBlock->getTerminator()); -    // Here we use the same DebugLoc as the scalar loop latch branch instead -    // of the corresponding compare because they may have ended up with -    // different line numbers and we want to avoid awkward line stepping while -    // debugging. Eg. if the compare has got a line number inside the loop. -    cast<Instruction>(CmpN)->setDebugLoc(ScalarLatchBr->getDebugLoc()); +    // Provide correct stepping behaviour by using the same DebugLoc as the +    // scalar loop latch branch cmp if it exists. +    if (CmpInst *ScalarLatchCmp = +            dyn_cast_or_null<CmpInst>(ScalarLatchBr->getCondition())) +      cast<Instruction>(CmpN)->setDebugLoc(ScalarLatchCmp->getDebugLoc());    }    BranchInst *BrInst = BranchInst::Create(ExitBlock, ScalarPH, CmpN); @@ -3608,15 +3608,7 @@ void InnerLoopVectorizer::fixReduction(PHINode *Phi) {    // Reduce all of the unrolled parts into a single vector.    Value *ReducedPartRdx = VectorLoopValueMap.getVectorValue(LoopExitInst, 0);    unsigned Op = RecurrenceDescriptor::getRecurrenceBinOp(RK); - -  // The middle block terminator has already been assigned a DebugLoc here (the -  // OrigLoop's single latch terminator). We want the whole middle block to -  // appear to execute on this line because: (a) it is all compiler generated, -  // (b) these instructions are always executed after evaluating the latch -  // conditional branch, and (c) other passes may add new predecessors which -  // terminate on this line. This is the easiest way to ensure we don't -  // accidentally cause an extra step back into the loop while debugging. -  setDebugLocFromInst(Builder, LoopMiddleBlock->getTerminator()); +  setDebugLocFromInst(Builder, ReducedPartRdx);    for (unsigned Part = 1; Part < UF; ++Part) {      Value *RdxPart = VectorLoopValueMap.getVectorValue(LoopExitInst, Part);      if (Op != Instruction::ICmp && Op != Instruction::FCmp) | 

