[llvm] 8139900 - [X86] combineOrShiftToFunnelShift - use isOperationLegalOrCustom to check FSHL/FSHR support
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 04:52:47 PDT 2019
Author: Simon Pilgrim
Date: 2019-10-30T11:52:22Z
New Revision: 81399002aeafe35b13c2bea10da11c3cc4c11946
URL: https://github.com/llvm/llvm-project/commit/81399002aeafe35b13c2bea10da11c3cc4c11946
DIFF: https://github.com/llvm/llvm-project/commit/81399002aeafe35b13c2bea10da11c3cc4c11946.diff
LOG: [X86] combineOrShiftToFunnelShift - use isOperationLegalOrCustom to check FSHL/FSHR support
Remove hard wired legality check.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index c407efb543bd..ccb8e8aa76b3 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -39599,7 +39599,8 @@ static SDValue combineOrShiftToFunnelShift(SDNode *N, SelectionDAG &DAG,
EVT VT = N->getValueType(0);
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
- if (VT != MVT::i16 && VT != MVT::i32 && VT != MVT::i64)
+ if (!TLI.isOperationLegalOrCustom(ISD::FSHL, VT) ||
+ !TLI.isOperationLegalOrCustom(ISD::FSHR, VT))
return SDValue();
// fold (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c)
More information about the llvm-commits
mailing list