[PATCH] D29679: CVP: Make CVP iterate in an order that maximizes reuse of LVI cache

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 19:13:47 PST 2017


dberlin added a comment.

Ugh. I reverted this.
CVP is completely borked as an optimization, it gets no answers if you iterate in anything but top-down order.

That is , given
define i32 @test1(i1 %C) nounwind  {

  br i1 %C, label %exit, label %body

body:           ; preds = %0

  %A = select i1 %C, i32 10, i32 11               ; <i32> [#uses=1]
  ret i32 %A

exit:           ; preds = %0

  ret i32 10

}
if you process body before entry, it gives "overdefined" for %A
if you process entry before body, it gives "11" for %A

Any reasonable optimization would get right answers but slower :(

This is

1. Sad because it makes LVI's laziness utterly and completely pointless.
2. It means my one testcase is pretty much unfixable without predicateinfo.


Repository:
  rL LLVM

https://reviews.llvm.org/D29679





More information about the llvm-commits mailing list