]> granicus.if.org Git - llvm/commit
[X86] Teach the isel optimization for (x << C1) op C2 to (x op (C2>>C1)) << C1 to...
authorCraig Topper <craig.topper@intel.com>
Thu, 28 Mar 2019 18:05:37 +0000 (18:05 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 28 Mar 2019 18:05:37 +0000 (18:05 +0000)
commit7144be6b9188ee305e63ee5884aa9d0890e7fc1a
treec831c2ef7580a01110073b0f9a70c67658f81943
parentf290220c22d4d26addaeda04439797fbbdb1bd65
[X86] Teach the isel optimization for (x << C1) op C2 to (x op (C2>>C1)) << C1 to consider cases where C2>>C1 can fit an unsigned 32-bit immediate

For 64-bit operations we should consider if the immediate can be made to fit
in an unsigned 32-bits immedate. For OR/XOR this allows us to load the immediate
with MOV32ri instead of movabsq. For AND this allows us to fold the immediate.

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

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