OSDN Git Service

[PatternMatch] add special-case uaddo matching for increment-by-one (2nd try)
authorSanjay Patel <spatel@rotateright.com>
Sun, 3 Feb 2019 16:16:48 +0000 (16:16 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 3 Feb 2019 16:16:48 +0000 (16:16 +0000)
commitcf5cc9f6fab0c8ac23004d2545e9d193ae2f7941
tree960903073ea0c27e1585f3bf74359465d9b48185
parent34c29daf07c40b385a2f246fce6b72c7f062697b
[PatternMatch] add special-case uaddo matching for increment-by-one (2nd try)

This is the most important uaddo problem mentioned in PR31754:
https://bugs.llvm.org/show_bug.cgi?id=31754
...but that was overcome in x86 codegen with D57637.

That patch also corrects the inc vs. add regressions seen with the  previous attempt at this.

Still, we want to make this matcher complete, so we can potentially canonicalize the pattern
even if it's an 'add 1' operation.
Pattern matching, however, shouldn't assume that we have canonicalized IR, so we match 4
commuted variants of uaddo.

There's also a test with a crazy type to show that the existing CGP transform based on this
matcher is not limited by target legality checks.

I'm not sure if the Hexagon diff means the test is no longer testing what it intended to
test, but that should be solvable in a follow-up.

Differential Revision: https://reviews.llvm.org/D57516

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352998 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/PatternMatch.h
test/CodeGen/Hexagon/swp-epilog-phi5.ll
test/CodeGen/X86/copy-eflags.ll
test/CodeGen/X86/rd-mod-wr-eflags.ll
test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll