diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-04-28 03:34:31 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-04-28 03:34:31 +0000 |
commit | 33772c53754bd27af1ce41379def536fc1de7fb0 (patch) | |
tree | 90695f7cd1b8952186dd169e15cea30e312247a8 /llvm/lib/Target/X86 | |
parent | 7626f778a567767690b279420037b7f11f2e4748 (diff) | |
download | bcm5719-llvm-33772c53754bd27af1ce41379def536fc1de7fb0.tar.gz bcm5719-llvm-33772c53754bd27af1ce41379def536fc1de7fb0.zip |
[CodeGen] Default CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF to Expand in TargetLoweringBase. This is what the majority of the targets want and removes a bunch of code. Set it to Legal explicitly in the few cases where that's the desired behavior.
llvm-svn: 267853
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 03de28ed6b0..82d2218f0b1 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -326,16 +326,15 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM, // encoding. setOperationPromotedToType(ISD::CTTZ , MVT::i8 , MVT::i32); setOperationPromotedToType(ISD::CTTZ_ZERO_UNDEF, MVT::i8 , MVT::i32); - if (Subtarget.hasBMI()) { - setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i16 , Expand); - setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i32 , Expand); - if (Subtarget.is64Bit()) - setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i64, Expand); - } else { + if (!Subtarget.hasBMI()) { setOperationAction(ISD::CTTZ , MVT::i16 , Custom); setOperationAction(ISD::CTTZ , MVT::i32 , Custom); - if (Subtarget.is64Bit()) + setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i16 , Legal); + setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i32 , Legal); + if (Subtarget.is64Bit()) { setOperationAction(ISD::CTTZ , MVT::i64 , Custom); + setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i64, Legal); + } } if (Subtarget.hasLZCNT()) { @@ -343,10 +342,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM, // encoding. setOperationPromotedToType(ISD::CTLZ , MVT::i8 , MVT::i32); setOperationPromotedToType(ISD::CTLZ_ZERO_UNDEF, MVT::i8 , MVT::i32); - setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i16 , Expand); - setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i32 , Expand); - if (Subtarget.is64Bit()) - setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i64, Expand); } else { setOperationAction(ISD::CTLZ , MVT::i8 , Custom); setOperationAction(ISD::CTLZ , MVT::i16 , Custom); @@ -684,9 +679,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM, setOperationAction(ISD::UDIVREM, VT, Expand); setOperationAction(ISD::CTPOP, VT, Expand); setOperationAction(ISD::CTTZ, VT, Expand); - setOperationAction(ISD::CTTZ_ZERO_UNDEF, VT, Expand); setOperationAction(ISD::CTLZ, VT, Expand); - setOperationAction(ISD::CTLZ_ZERO_UNDEF, VT, Expand); setOperationAction(ISD::ROTL, VT, Expand); setOperationAction(ISD::ROTR, VT, Expand); setOperationAction(ISD::BSWAP, VT, Expand); |