]> granicus.if.org Git - llvm/commit
[X86] Add test cases for missed opportunities in (x << C1) op C2 to (x op (C2>>C1...
authorCraig Topper <craig.topper@intel.com>
Wed, 27 Mar 2019 06:07:05 +0000 (06:07 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 27 Mar 2019 06:07:05 +0000 (06:07 +0000)
commit6ba87d01dcddd908b1faf4b4d636a999a5341d30
treea4020684beff5c057bc925bc1857e9e9252e7979
parentc760298a35c542ca10323b28412b6969542e2f1c
[X86] Add test cases for missed opportunities in (x << C1) op C2 to (x op (C2>>C1)) << C1 transform.

We handle the case where the C2 does not fit in a signed 32-bit immediate, but
(C2>>C1) does. But there's also some 64-bit opportunities when C2 is not an unsigned
32-bit immediate, but (C2>>C1) is. For OR/XOR this allows us to load the
immediate with with MOV32ri instead of a movabsq. For AND it allows us to use a
32-bit AND and fold the immediate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357050 91177308-0d34-0410-b5e6-96231b3b80d8
test/CodeGen/X86/narrow-shl-cst.ll