[PATCH] D71539: [SCEV] Look through trivial PHIs.
Bardia Mahjour via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 28 13:08:50 PDT 2021
bmahjour added a comment.
https://github.com/llvm/llvm-project/commit/764d9aa97905f202385b4f25f8d234630b4feef3 is exposing an issue in DependenceAnalysis:
> cat bugpoint-reduced-simplified.ll
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512"
target triple = "powerpc64le-unknown-linux-gnu"
define dso_local void @hotspotKernel([512 x double]* %temp) local_unnamed_addr #0 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.body272, %entry
br label %for.body6
for.body6: ; preds = %for.body6, %for.cond1.preheader
%c.2594 = phi i32 [ 1, %for.cond1.preheader ], [ %add27, %for.body6 ]
%add27 = add nuw nsw i32 %c.2594, 1
br i1 undef, label %for.body6, label %for.end63
for.end63: ; preds = %for.body6
%c.1.lcssa = phi i32 [ %add27, %for.body6 ]
%sub96 = add nsw i32 %c.1.lcssa, -1
%0 = zext i32 %sub96 to i64
%arrayidx98 = getelementptr inbounds [512 x double], [512 x double]* %temp, i64 0, i64 %0
%1 = load double, double* %arrayidx98, align 8
br label %for.body272
for.body272: ; preds = %for.body272, %for.end63
%r.1597 = phi i32 [ 1, %for.end63 ], [ %add277, %for.body272 ]
%idxprom274 = zext i32 %r.1597 to i64
%add277 = add nuw nsw i32 %r.1597, 1
%arrayidx295 = getelementptr inbounds [512 x double], [512 x double]* %temp, i64 %idxprom274, i64 510
%2 = load double, double* %arrayidx295, align 8
br i1 undef, label %for.body272, label %for.cond1.preheader, !llvm.loop !1
}
attributes #0 = { "target-features"="+altivec,+bpermd,+crypto,+direct-move,+extdiv,+htm,+isa-v207-instructions,+power8-vector,+vsx,-isa-v30-instructions,-power9-vector,-privileged,-rop-protect,-spe" }
!llvm.ident = !{!0}
!0 = !{!"version 14.0.0"}
!1 = distinct !{!1, !2}
!2 = !{!"llvm.loop.mustprogress"}
opt -passes='print<da>' -disable-output bugpoint-reduced-simplified.ll
'Dependence Analysis' for function 'hotspotKernel':
Src: %1 = load double, double* %arrayidx98, align 8 --> Dst: %1 = load double, double* %arrayidx98, align 8
da analyze - consistent input [S]!
Src: %1 = load double, double* %arrayidx98, align 8 --> Dst: %2 = load double, double* %arrayidx295, align 8
da analyze - opt: /home/bmahjour/workspaces/_all/upstream-fork/llvm-project/llvm/lib/Analysis/DependenceAnalysis.cpp:2161: bool llvm::DependenceInfo::testSIV(const llvm::SCEV *, const llvm::SCEV *, unsigned $
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/bmahjour/workspaces/_all/upstream-fork/build/bin/opt -passes=print<da> -disable-output bugpoint-reduced-simplified.ll
#0 0x0000000012c87154 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/bmahjour/workspaces/_all/upstream-fork/build/bin/opt+0x12c87154)
#1 0x0000000012c87554 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#2 0x0000000012c842b8 llvm::sys::RunSignalHandlers() (/home/bmahjour/workspaces/_all/upstream-fork/build/bin/opt+0x12c842b8)
#3 0x0000000012c8781c SignalHandler(int) Signals.cpp:0:0
#4 0x00002000000604d8 (linux-vdso64.so.1+0x4d8)
#5 0x00002000005fea0c __libc_signal_restore_set /build/glibc-dBVPtL/glibc-2.27/signal/../sysdeps/unix/sysv/linux/nptl-signals.h:80:0
#6 0x00002000005fea0c raise /build/glibc-dBVPtL/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:48:0
#7 0x0000200000600c60 abort /build/glibc-dBVPtL/glibc-2.27/stdlib/abort.c:79:0
#8 0x00002000005ebbb8 __assert_fail_base /build/glibc-dBVPtL/glibc-2.27/assert/assert.c:92:0
#9 0x00002000005ebc64 __assert_fail /build/glibc-dBVPtL/glibc-2.27/assert/assert.c:101:0
#10 0x0000000011847ba4 llvm::DependenceInfo::testSIV(llvm::SCEV const*, llvm::SCEV const*, unsigned int&, llvm::FullDependence&, llvm::DependenceInfo::Constraint&, llvm::SCEV const*&) const (/home/bmahjour/wor$
#11 0x0000000011854070 llvm::DependenceInfo::depends(llvm::Instruction*, llvm::Instruction*, bool) (/home/bmahjour/workspaces/_all/upstream-fork/build/bin/opt+0x11854070)
#12 0x0000000011833f9c dumpExampleDependence(llvm::raw_ostream&, llvm::DependenceInfo*) DependenceAnalysis.cpp:0:0
#13 0x0000000011834594 llvm::DependenceAnalysisPrinterPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/bmahjour/workspaces/_all/upstream-fork/build/bin/opt+0x11834594)
#14 0x0000000012fff0fc llvm::detail::PassModel<llvm::Function, llvm::DependenceAnalysisPrinterPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<$
#15 0x00000000122e4b6c llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/bmahjour/workspaces/_all/upstream-fork/buil$
#16 0x000000001074aedc llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(l$
#17 0x00000000122ea58c llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/bmahjour/workspaces/_all/upstream-fork/build/bin/opt+0x122ea58c)
#18 0x000000001039e95c llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Mo$
#19 0x00000000122e3840 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/bmahjour/workspaces/_all/upstream-fork/build/bin/op$
#20 0x0000000010392d60 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::Strin$
#21 0x00000000103ac0cc main (/home/bmahjour/workspaces/_all/upstream-fork/build/bin/opt+0x103ac0cc)
#22 0x00002000005d449c generic_start_main /build/glibc-dBVPtL/glibc-2.27/csu/../csu/libc-start.c:310:0
#23 0x00002000005d469c __libc_start_main /build/glibc-dBVPtL/glibc-2.27/csu/../sysdeps/unix/sysv/linux/powerpc/libc-start.c:116:0
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71539/new/
https://reviews.llvm.org/D71539
More information about the llvm-commits
mailing list