Before this patch, we can only use the MaxBECount for an AddRec's range
computation if the MaxBECount has <= bit width of the AddRec. This patch
reasons that if a MaxBECount has > bit width, and is <= the max value of
AddRec's bit width, we can still use the MaxBECount.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I've no idea if the Dependence Analysis test change is correct. Would appreciate if reviews can look at it.
Comment Actions
- Rebase on top of a refactoring patch
- Update polly tests. One test looks functionally the same, and the other test finds tighter bounds. Looks ok to me.
Comment Actions
Hi,
The following starts failing with this patch:
opt -verify-scev -passes="loop(loop-unroll-full),loop-mssa(licm<allowspeculation>,indvars,loop-rotate)" bbi-83618.ll -o /dev/null
We get
Incorrect cached computation in ConstantMultipleCache for (-1 * (zext i16 {0,+,6}<nuw><%for.body> to i64))<nuw><nsw> : Computed -6 but cache contains -2! PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump: 0. Program arguments: ../../main-github/llvm/build-all/bin/opt -verify-scev -passes=loop(loop-unroll-full),loop-mssa(licm<allowspeculation>,indvars,loop-rotate) bbi-83618.ll -o /dev/null #0 0x00005647691c5b77 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (../../main-github/llvm/build-all/bin/opt+0x2db3b77) #1 0x00005647691c389e llvm::sys::RunSignalHandlers() (../../main-github/llvm/build-all/bin/opt+0x2db189e) #2 0x00005647691c620f SignalHandler(int) Signals.cpp:0:0 #3 0x00007f850faf2630 __restore_rt sigaction.c:0:0 #4 0x00007f850d239387 raise (/lib64/libc.so.6+0x36387) #5 0x00007f850d23aa78 abort (/lib64/libc.so.6+0x37a78) #6 0x00005647683ab616 llvm::ScalarEvolution::verify() const (../../main-github/llvm/build-all/bin/opt+0x1f99616) #7 0x0000564769cf7f36 llvm::FunctionToLoopPassAdaptor::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x38e5f36) #8 0x00005647693e0b5d llvm::detail::PassModel<llvm::Function, llvm::FunctionToLoopPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x2fceb5d) #9 0x0000564768bd4ff4 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x27c2ff4) #10 0x0000564767089c4d llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0xc77c4d) #11 0x0000564768bd93de llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x27c73de) #12 0x00005647670899ed llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0xc779ed) #13 0x0000564768bd4184 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x27c2184) #14 0x0000564766cc4a1e llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) (../../main-github/llvm/build-all/bin/opt+0x8b2a1e) #15 0x0000564766cd30ee main (../../main-github/llvm/build-all/bin/opt+0x8c10ee) #16 0x00007f850d225555 __libc_start_main (/lib64/libc.so.6+0x22555) #17 0x0000564766cbf170 _start (../../main-github/llvm/build-all/bin/opt+0x8ad170) Abort (core dumped)
static_cast -> cast