[DagCombiner] Not all 'andn''s work with immediates.
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 7 May 2018 21:52:11 +0000 (21:52 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 7 May 2018 21:52:11 +0000 (21:52 +0000)
commitcc42d08b1daf6874e7b65986443510bfc5e0abc3
treeade7212a0b263366809902766925ee60d779acd4
parent45fc2c83e60265f3772ba86b9b832f3d540ef049
[DagCombiner] Not all 'andn''s work with immediates.

Summary:
Split off from D46031.

In masked merge case, this degrades IPC by decreasing instruction count.
{F6108777}
The next patch should be able to recover and improve this.

This also affects the transform @spatel have added in D27489 / rL289738,
and the test coverage for X86 was missing.
But after i have added it, and looked at the changes in MCA, i'm somewhat confused.
{F6093591} {F6093592} {F6093593}
I'd say this regression is an improvement, since `IPC` increased in that case?

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: andreadb, llvm-commits, spatel

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

llvm-svn: 331684
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/test/CodeGen/X86/icmp-opt.ll
llvm/test/CodeGen/X86/selectcc-to-shiftand.ll
llvm/test/CodeGen/X86/unfold-masked-merge-scalar-variablemask.ll