[X86] When iselling (x << C1) and/or/xor C2 as (x and/or/xor (C2>>C1)) << C1, go...
authorCraig Topper <craig.topper@intel.com>
Wed, 27 Mar 2019 04:45:58 +0000 (04:45 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 27 Mar 2019 04:45:58 +0000 (04:45 +0000)
commit7da7b97487a6be012bb367605a6ce1d554056a88
tree1fbee8279619985b8a30ccacf76a04eda3665e3d
parente204d244badb2e9765a1020f41c773f63da208f4
[X86] When iselling (x << C1) and/or/xor C2 as (x and/or/xor (C2>>C1)) << C1, go through the isel table instead of manually selecting.

Previously we manually selected the AND/OR/XOR with immediate and the SHL(or ADD if the shift is 1). But this was missing out on the opportunity to use a 64 bit AND with a 32-bit immediate and possibly other isel tricks we have built into the tables.

Instead, insert the new nodes into the DAG using insertDAGNode and allow them each to be selected through the normal table.

llvm-svn: 357049
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/narrow-shl-cst.ll