llvm/test
Sanjoy Das 26e7d2f8d6 [IndVars] Fix PR25576
`LCSSASafePhiForRAUW` as computed was incorrect -- in cases like
these (this exact example does not actually trigger the bug):

define i32 @f(i32 %n, i1* %c) {
entry:
  br label %outer.loop

outer.loop:
  br label %inner.loop

inner.loop:
  %iv = phi i32 [ 0, %outer.loop ], [ %iv.inc, %inner.loop ]
  %iv.inc = add nuw nsw i32 %iv, 1
  %tc = udiv i32 %n, 13
  %be.cond = icmp ult i32 %iv, %tc
  br i1 %be.cond, label %inner.loop, label %inner.exit

inner.exit:
  %iv.lcssa = phi i32 [ %iv, %inner.loop ]
  %outer.be.cond = load volatile i1, i1* %c
  br i1 %outer.be.cond, label %outer.loop, label %leave

leave:
  %iv.lcssa.lcssa = phi i32 [ %iv.lcssa, %inner.exit ]
  ret i32 %iv.lcssa.lcssa
}

`LCSSASafePhiForRAUW` is true for `%iv.lcssa` when re-rewriting the exit
value of `%iv` for `%inner.loop` to `%tc` (this can happen due to
`SCEVExpander::findExistingExpansion`), but the RAUW breaks LCSSA.

To fix this, instead of computing `SafePhi` with special logic, decide
the safety of RAUW directly via `replacementPreservesLCSSAForm`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 18:12:52 +00:00
..
Analysis Revert "[ValueTracking] Understand more select patterns in ComputeKnownBits" 2016-01-14 15:49:32 +00:00
Assembler [ConstantFold] Fix bitcast to gep constant folding transform. 2015-12-14 19:30:32 +00:00
Bindings Deprecate a few C APIs. 2015-12-18 23:46:42 +00:00
Bitcode [WinEH] Verify unwind edges against EH pad tree 2016-01-10 04:28:38 +00:00
BugPoint [bugpoint] Add a named metadata (+their operands) reducer 2015-11-06 00:12:50 +00:00
CodeGen [X86][AVX512] Regenerate v1 shuffle tests 2016-01-17 14:53:17 +00:00
DebugInfo [DwarfDebug] Don't merge DebugLocEntries if their pieces overlap 2016-01-16 01:15:32 +00:00
Examples
ExecutionEngine Remove some stale comments and fix a typo as suggested by David Blaikie in his 2016-01-17 01:49:46 +00:00
Feature [WinEH] Verify unwind edges against EH pad tree 2016-01-10 04:28:38 +00:00
FileCheck
Instrumentation [sanitizer] [msan] Fix origin store of array types 2016-01-11 19:55:27 +00:00
Integer
JitListener Fix several accidental DOS line endings in source files 2016-01-03 17:22:03 +00:00
LibDriver
Linker Reapply r257105 "[Verifier] Check that debug values have proper size" 2016-01-15 00:46:17 +00:00
LTO Don't try to check all uses if lazy loading. 2016-01-15 18:23:46 +00:00
MC Revert "[ARM] Add ARMv8-M security extension instructions to ARMv8-M Baseline/Mainline" 2016-01-15 18:55:12 +00:00
Object [llvm-readobj][ELF] Teach llvm-readobj to show dynamic relocation in REL format 2016-01-16 22:40:09 +00:00
Other Recommit r256952 "Filtering IR printing for print-after-all/print-before-all" 2016-01-06 22:55:03 +00:00
SymbolRewriter
TableGen Add test cases that will show the bug that was fixed in r256725. 2016-01-13 07:53:11 +00:00
tools Fixed CRLF->LF line endings from r257914. NFC. 2016-01-16 10:38:32 +00:00
Transforms [IndVars] Fix PR25576 2016-01-17 18:12:52 +00:00
Unit
Verifier [WinEH] Fix catchpad pred verification 2016-01-10 04:32:03 +00:00
YAMLParser
.clang-format
CMakeLists.txt Introduce sanstats tool and llvm::CreateSanitizerStatReport function. 2016-01-16 00:31:11 +00:00
lit.cfg Introduce sanstats tool and llvm::CreateSanitizerStatReport function. 2016-01-16 00:31:11 +00:00
lit.site.cfg.in Make WinCOFFObjectWriter.cpp's timestamp writing not use ENABLE_TIMESTAMPS 2016-01-06 19:05:19 +00:00
Makefile check-llvm: Tweak the feature "timestamps" for autoconf. 2015-12-21 08:46:12 +00:00
Makefile.tests
TestRunner.sh