OSDN Git Service

[X86] Add peephole for masked rotate amount
authorAdam Nemet <anemet@apple.com>
Wed, 12 Mar 2014 21:20:55 +0000 (21:20 +0000)
committerAdam Nemet <anemet@apple.com>
Wed, 12 Mar 2014 21:20:55 +0000 (21:20 +0000)
commita65ca9dcf0a7e4889a3130fa83e5e3045893a27b
treee0b2557dbcb104581d06b055c6c7cae89216bcce
parent9367c49f5de071784c732bbafeb66bf6a56c040f
[X86] Add peephole for masked rotate amount

Extend what's currently done for shift because the HW performs this masking
implicitly:

   (rotl:i32 x, (and y, 31)) -> (rotl:i32 x, y)

I use the newly factored out multiclass that was only supporting shifts so
far.

For testing I extended my testcase for the new rotation idiom.

<rdar://problem/15295856>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203718 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrCompiler.td
test/CodeGen/X86/rotate4.ll