1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/lib/Transforms
Sanjoy Das aa011535f3 [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`.

llvm-svn: 258016
2016-01-17 18:12:52 +00:00
..
Hello
InstCombine GlobalValue: use getValueType() instead of getType()->getPointerElementType(). 2016-01-16 20:30:46 +00:00
Instrumentation GlobalValue: use getValueType() instead of getType()->getPointerElementType(). 2016-01-16 20:30:46 +00:00
IPO GlobalValue: use getValueType() instead of getType()->getPointerElementType(). 2016-01-16 20:30:46 +00:00
ObjCARC Refactor: Simplify boolean conditional return statements in lib/Transforms/ObjCARC 2015-12-28 16:19:08 +00:00
Scalar [IndVars] Fix PR25576 2016-01-17 18:12:52 +00:00
Utils GlobalValue: use getValueType() instead of getType()->getPointerElementType(). 2016-01-16 20:30:46 +00:00
Vectorize Reapply r257800 with fix 2016-01-15 18:51:51 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile