[X86] Refactor peepholes for masked shift amount into a multiclass
authorAdam Nemet <anemet@apple.com>
Wed, 12 Mar 2014 18:02:33 +0000 (18:02 +0000)
committerAdam Nemet <anemet@apple.com>
Wed, 12 Mar 2014 18:02:33 +0000 (18:02 +0000)
commit77d21e8550c936b44dfe7d0e65fec19a5c56ea9f
tree1a1c0de136390e1bd6302b10fb3e94bd3b9367a9
parenta6b6d52299ad2bfe34aa4949e64f964bc9c1abc9
[X86] Refactor peepholes for masked shift amount into a multiclass

The peephole (shift x, (and y, 31)) -> (shift x, y) is repeated for each
integer type and each shift variant.

To improve this a new multiclass is added that covers all integer types.  The
shift patterns are now instantiated from this.  I am planning to add new
instances for rotates as well.

No functional change intended:

  * test/CodeGen/X86/shift-and.ll provides coverage

  * Compared the expanded tablegen output and matched up the defs for these
    Pat<>s before and after

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