llvm-project/llvm/test
Roman Lebedev 8d081b78e4 SCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction
Summary:
An alternative to D48597.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=37936 | PR37936 ]].

The problem is as follows:
1. `indvars` marks `%dec` as `NUW`.
2. `loop-instsimplify` runs `instsimplify`, which constant-folds `%dec` to -1 (D47908)
3. `loop-reduce` tries to do some further modification, but crashes
    with an type assertion in cast, because `%dec` is no longer an `Instruction`,

If the runline is split into two, i.e. you first run `-indvars -loop-instsimplify`,
store that into a file, and then run `-loop-reduce`, there is no crash.

So it looks like the problem is due to `-loop-instsimplify` not discarding SCEV.
But in this case we can just not crash if it's not an `Instruction`.
This is just a local fix, unlike D48597, so there may very well be other problems.

Reviewers: mkazantsev, uabelho, sanjoy, silviu.baranga, wmi

Reviewed By: mkazantsev

Subscribers: evstupac, javed.absar, spatel, llvm-commits

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

llvm-svn: 335950
2018-06-29 07:44:20 +00:00
..
Analysis Add a PhiValuesAnalysis pass to calculate the underlying values of phis 2018-06-28 14:13:06 +00:00
Assembler ConstantFold: Don't fold global address vs. null for addrspace != 0 2018-06-26 18:55:43 +00:00
Bindings [LLVM-C] [OCaml] Remove LLVMAddBBVectorizePass 2018-05-28 16:58:10 +00:00
Bitcode [ThinLTO] Parse module summary index from assembly 2018-06-26 13:56:49 +00:00
BugPoint
CodeGen [X86] Remove masking from the avx512 packed sqrt intrinsics. Use select in IR instead. 2018-06-29 05:43:26 +00:00
DebugInfo [MachineOutliner] Never add the outliner in -O0 2018-06-28 21:49:24 +00:00
Examples
ExecutionEngine Revert "Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models"" 2018-06-28 17:56:43 +00:00
Feature Restore the LoopInstSimplify pass, reverting r327329 that removed it. 2018-05-25 01:32:36 +00:00
FileCheck [FileCheck] Add CHECK-EMPTY directive for checking for blank lines 2018-06-26 15:15:45 +00:00
Instrumentation Revert "Add support for generating a call graph profile from Branch Frequency Info." 2018-06-28 13:15:03 +00:00
Integer
JitListener
LTO [ThinLTO] Add per-module indexes to combined index consistently 2018-06-26 01:32:58 +00:00
Linker
MC [ARM] Add missing Thumb2 assembler diagnostics. 2018-06-28 19:53:12 +00:00
Object [ELF] Change isSectionData to exclude SHF_EXECINSTR 2018-06-23 00:15:33 +00:00
ObjectYAML Resubmit [pdb] Change /DEBUG:GHASH to emit 8 byte hashes." 2018-05-17 22:55:15 +00:00
Other Revert "Add support for generating a call graph profile from Branch Frequency Info." 2018-06-28 13:15:03 +00:00
SafepointIRVerifier SafepointIRVerifier is made unreachable block tolerant 2018-05-23 05:54:55 +00:00
SymbolRewriter
TableGen [IR] Split Intrinsics.inc into enums and implementations 2018-06-23 02:02:38 +00:00
ThinLTO/X86 [ThinLTO] Fix test 2018-06-27 19:00:35 +00:00
Transforms SCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction 2018-06-29 07:44:20 +00:00
Unit
Verifier Revert "Add support for generating a call graph profile from Branch Frequency Info." 2018-06-28 13:15:03 +00:00
YAMLParser
tools Require x86 for this test. 2018-06-28 23:22:14 +00:00
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py [LIT] Enable testing of LLVM gold plugin on Mac OS X 2018-06-20 15:32:47 +00:00
lit.site.cfg.py.in