summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-12-23 05:52:55 +0000
committerCraig Topper <craig.topper@intel.com>2018-12-23 05:52:55 +0000
commit006bac688056e7d6b58708100bc4cc797ac12b23 (patch)
tree0d07e809a112c36aff061defc8fbfeed4e598a71 /llvm/lib
parent69952979da5bc001c071506c64fbbe95fc4f181a (diff)
downloadbcm5719-llvm-006bac688056e7d6b58708100bc4cc797ac12b23.tar.gz
bcm5719-llvm-006bac688056e7d6b58708100bc4cc797ac12b23.zip
[X86] Return false from hasAndNotCompare if the comparision value is a constant.
We won't end up using an ANDN instruction in this case so we should generate the same code we do for pre-BMI targets. llvm-svn: 350018
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 3f6598d5ca3..6e2a592c80b 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -4945,17 +4945,14 @@ bool X86TargetLowering::hasAndNotCompare(SDValue Y) const {
if (VT != MVT::i32 && VT != MVT::i64)
return false;
- // A mask and compare against constant is ok for an 'andn' too
- // even though the BMI instruction doesn't have an immediate form.
-
- return true;
+ return !isa<ConstantSDNode>(Y);
}
bool X86TargetLowering::hasAndNot(SDValue Y) const {
EVT VT = Y.getValueType();
- if (!VT.isVector()) // x86 can't form 'andn' with an immediate.
- return !isa<ConstantSDNode>(Y) && hasAndNotCompare(Y);
+ if (!VT.isVector())
+ return hasAndNotCompare(Y);
// Vector.
OpenPOWER on IntegriCloud