llvm-project/llvm/lib/Transforms/Utils
Orlando Cazalet-Hyams 1251cac62a [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion
Summary:
Bug: https://bugs.llvm.org/show_bug.cgi?id=39024

The bug reports that a vectorized loop is stepped through 4 times and each step through the loop seemed to show a different path. I found two problems here:

A) An incorrect line number on a preheader block (for.body.preheader) instruction causes a step into the loop before it begins.
B) Instructions in the middle block have different line numbers which give the impression of another iteration.

In this patch I give all of the middle block instructions the line number of the scalar loop latch terminator branch. This seems to provide the smoothest debugging experience because the vectorized loops will always end on this line before dropping into the scalar loop. To solve problem A I have altered llvm::SplitBlockPredecessors to accommodate loop header blocks.

I have set up a separate review D61933 for a fix which is required for this patch.

Reviewers: samsonov, vsk, aprantl, probinson, anemet, hfinkel, jmorse

Reviewed By: hfinkel, jmorse

Subscribers: jmorse, javed.absar, eraman, kcc, bjope, jmellorcrummey, hfinkel, gbedwell, hiraditya, zzheng, llvm-commits

Tags: #llvm, #debug-info

Differential Revision: https://reviews.llvm.org/D60831

> llvm-svn: 363046

llvm-svn: 363786
2019-06-19 10:50:47 +00:00
..
ASanStackFrameLayout.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
AddDiscriminators.cpp [llvm] Clarify responsiblity of some of DILocation discriminator APIs 2019-01-24 00:10:25 +00:00
BasicBlockUtils.cpp [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion 2019-06-19 10:50:47 +00:00
BreakCriticalEdges.cpp [SanitizerCoverage] Avoid splitting critical edges when destination is a basic block containing unreachable 2019-03-12 18:20:25 +00:00
BuildLibCalls.cpp [SimplifyLibCalls] Fold more fortified functions into non-fortified variants 2019-05-31 22:41:36 +00:00
BypassSlowDivision.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
CallPromotionUtils.cpp [opaque pointer types] Pass function type for CallBase::setCalledFunction. 2019-02-01 20:44:54 +00:00
CanonicalizeAliases.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CloneFunction.cpp Move DomTreeUpdater from IR to Analysis 2019-02-06 02:52:52 +00:00
CloneModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeExtractor.cpp [CodeExtractor] Add a few debug lines to understand why a region is not extracted 2019-04-16 02:12:05 +00:00
CtorUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DemoteRegToStack.cpp [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
EntryExitInstrumenter.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
EscapeEnumerator.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
Evaluator.cpp [Evaluator] Walk initial elements when handling load through bitcast 2019-04-25 17:00:01 +00:00
FlattenCFG.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionComparator.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionImportUtils.cpp Change some dyn_cast to more apropriate isa. NFC 2019-04-05 16:16:23 +00:00
GlobalStatus.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GuardUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImportedFunctionsInliningStatistics.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InlineFunction.cpp [CallSite removal] Refactoring llvm::InlineFunction APIs 2019-06-05 21:28:13 +00:00
InstructionNamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntegerDivision.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LCSSA.cpp [MemorySSA] LCSSA preserves MemorySSA. 2019-04-23 20:59:44 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LibCallsShrinkWrap.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Local.cpp Revert r360902 "Resubmit: [Salvage] Change salvage debug info ..." 2019-05-21 11:53:41 +00:00
LoopRotationUtils.cpp [LoopRotate] fix crash encountered with callbr 2019-03-06 23:04:40 +00:00
LoopSimplify.cpp [MemorySSA] LoopSimplify preserves MemorySSA only when flag is flipped. 2019-05-14 18:07:18 +00:00
LoopUnroll.cpp [Utils] Clean another duplicated util method. 2019-06-04 18:45:15 +00:00
LoopUnrollAndJam.cpp [Utils] Clean another duplicated util method. 2019-06-04 18:45:15 +00:00
LoopUnrollPeel.cpp PHINode: introduce setIncomingValueForBlock() function, and use it. 2019-06-17 14:38:56 +00:00
LoopUnrollRuntime.cpp PHINode: introduce setIncomingValueForBlock() function, and use it. 2019-06-17 14:38:56 +00:00
LoopUtils.cpp Change semantics of fadd/fmul vector reductions. 2019-06-11 08:22:10 +00:00
LoopVersioning.cpp LoopVersioning: Respect convergent 2019-06-12 14:05:58 +00:00
LowerInvoke.cpp [opaque pointer types] Pass function types to CallInst creation. 2019-02-01 20:43:25 +00:00
LowerMemIntrinsics.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
LowerSwitch.cpp Fix a crash when the default of a switch is removed 2019-06-03 17:54:15 +00:00
Mem2Reg.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MetaRenamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ModuleUtils.cpp [IR] Disallow llvm.global_ctors and llvm.global_dtors of the 2-field form in textual format 2019-05-15 02:35:32 +00:00
NameAnonGlobals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PredicateInfo.cpp [PredicateInfo] Do not process unreachable operands. 2019-05-15 19:35:38 +00:00
PromoteMemoryToRegister.cpp [Mem2Reg] Delete unused PointerAllocaValues 2019-04-14 07:28:29 +00:00
SSAUpdater.cpp [LICM/MSSA] Add promotion to scalars by building an AliasSetTracker with MemorySSA. 2019-02-06 20:25:17 +00:00
SSAUpdaterBulk.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SanitizerStats.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
SimplifyCFG.cpp [SimplifyCFG] NFC, prof branch_weighs handling is simplified 2019-06-18 06:50:52 +00:00
SimplifyIndVar.cpp [SimplifyIndVar] Simplify non-overflowing saturating add/sub 2019-06-15 08:48:52 +00:00
SimplifyLibCalls.cpp [SimplifyLibCalls] Fold more fortified functions into non-fortified variants 2019-05-31 22:41:36 +00:00
SizeOpts.cpp [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
SplitModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripGCRelocates.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripNonLineTableDebugInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SymbolRewriter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
UnifyFunctionExitNodes.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Utils.cpp [LLVM-C] Expose the "Add Discriminators" Pass To LLVM-C 2019-03-15 16:57:23 +00:00
VNCoercion.cpp [GVN] non-functional code movement 2019-06-07 23:08:38 +00:00
ValueMapper.cpp Reapply: IR: add optional type to 'byval' function parameters 2019-05-30 18:48:23 +00:00