diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-04-23 02:49:29 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-04-23 02:49:29 +0000 |
commit | 6f8b8e4c45edc4b0433af49ff65e3bcc0ded7524 (patch) | |
tree | 0d377d3951b839a0a530d159af017c153090f21d /llvm/lib | |
parent | b297b6b0c930771067170ebd966fbe293899c0c2 (diff) | |
download | bcm5719-llvm-6f8b8e4c45edc4b0433af49ff65e3bcc0ded7524.tar.gz bcm5719-llvm-6f8b8e4c45edc4b0433af49ff65e3bcc0ded7524.zip |
[NVPTX] Set ctlz_zero_undef to Expand so LegalizeDAG will convert it to ctlz. Remove the now unneccessary isel patterns. NFC
llvm-svn: 267265
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXInstrInfo.td | 7 |
2 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp index 8ff8ec32c84..564b70643f4 100644 --- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -257,9 +257,9 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM, setOperationAction(ISD::CTLZ, MVT::i16, Legal); setOperationAction(ISD::CTLZ, MVT::i32, Legal); setOperationAction(ISD::CTLZ, MVT::i64, Legal); - setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i16, Legal); - setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i32, Legal); - setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i64, Legal); + setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i16, Expand); + setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i32, Expand); + setOperationAction(ISD::CTLZ_ZERO_UNDEF, MVT::i64, Expand); setOperationAction(ISD::CTTZ, MVT::i16, Expand); setOperationAction(ISD::CTTZ, MVT::i32, Expand); setOperationAction(ISD::CTTZ, MVT::i64, Expand); diff --git a/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td b/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td index e35de4b54fe..50d9ea05545 100644 --- a/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td +++ b/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td @@ -2576,13 +2576,10 @@ let hasSideEffects = 0 in { // 32-bit has a direct PTX instruction def : Pat<(ctlz Int32Regs:$a), (CLZr32 Int32Regs:$a)>; -def : Pat<(ctlz_zero_undef Int32Regs:$a), (CLZr32 Int32Regs:$a)>; // For 64-bit, the result in PTX is actually 32-bit so we zero-extend // to 64-bit to match the LLVM semantics def : Pat<(ctlz Int64Regs:$a), (CVT_u64_u32 (CLZr64 Int64Regs:$a), CvtNONE)>; -def : Pat<(ctlz_zero_undef Int64Regs:$a), - (CVT_u64_u32 (CLZr64 Int64Regs:$a), CvtNONE)>; // For 16-bit, we zero-extend to 32-bit, then trunc the result back // to 16-bits (ctlz of a 16-bit value is guaranteed to require less @@ -2592,10 +2589,6 @@ def : Pat<(ctlz Int16Regs:$a), (SUBi16ri (CVT_u16_u32 (CLZr32 (CVT_u32_u16 Int16Regs:$a, CvtNONE)), CvtNONE), 16)>; -def : Pat<(ctlz_zero_undef Int16Regs:$a), - (SUBi16ri (CVT_u16_u32 (CLZr32 - (CVT_u32_u16 Int16Regs:$a, CvtNONE)), - CvtNONE), 16)>; // Population count let hasSideEffects = 0 in { |