[PATCH] D13378: [SCEV] Recognize simple br-phi patterns

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 01:34:42 PDT 2015


sanjoy created this revision.
sanjoy added reviewers: atrick, joker.eph, joker-eph.
sanjoy added a subscriber: llvm-commits.

Teach SCEV to match patterns like

```
  br %cond, label %left, label %right
 left:
  br label %merge
 right:
  br label %merge
 merge:
  V = phi [ %x, %left ], [ %y, %right ]
```

as "select %cond, %x, %y".  Before this SCEV would match PHI nodes
exclusively to add recurrences.

This addresses PR25005.

http://reviews.llvm.org/D13378

Files:
  lib/Analysis/ScalarEvolution.cpp
  test/Analysis/ScalarEvolution/smax-br-phi-idioms.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13378.36335.patch
Type: text/x-patch
Size: 20795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151002/1e614f2a/attachment.bin>


More information about the llvm-commits mailing list