[PATCH] D101829: [SCEV] By more careful when traversing phis in isImpliedViaMerge.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 12:32:26 PDT 2021


reames added a comment.

I'm confused.

On this example:
inner:

  %x = phi i32 [ -1, %outer.header ], [ %call, %inner ]
  %call = call i32 @match()
  %inner.cond = icmp sgt i32 %call, -1
  br i1 %inner.cond, label %inner, label %outer.exiting.1

outer.exiting.1:

  %x.lcssa = phi i32 [ %x, %inner ]

The value of %x *is* always signed less than or equal to -1.  On the last iteration, %call might not be, but the value used in the x.lcssa is the value of the phi, not of the call.  Thus, concluding that %x.lcssa <=s -1 seems entirely correct?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101829/new/

https://reviews.llvm.org/D101829



More information about the llvm-commits mailing list