[llvm] 7f32ede - [X86] combineMulToPMADDWD - use ComputeMinSignedBits(). NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 8 07:28:44 PST 2021
Author: Simon Pilgrim
Date: 2021-11-08T15:28:31Z
New Revision: 7f32edea23489f67967f8fc3048a50a30ae86f31
URL: https://github.com/llvm/llvm-project/commit/7f32edea23489f67967f8fc3048a50a30ae86f31
DIFF: https://github.com/llvm/llvm-project/commit/7f32edea23489f67967f8fc3048a50a30ae86f31.diff
LOG: [X86] combineMulToPMADDWD - use ComputeMinSignedBits(). NFCI.
Use ComputeMinSignedBits() to ensure the mul source operands at least sign-extend down from the bottom 16 bits.
This will make it easier if/when we try to support handling of source types larger than 32-bits.
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 597f909ac35e..aa60a8cbb3bf 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -44466,8 +44466,8 @@ static SDValue combineMulToPMADDWD(SDNode *N, SelectionDAG &DAG,
N1.getOperand(0).getScalarValueSizeInBits() <= 8))
return SDValue();
- // Sign bits must extend through the upper 17 bits.
- if (DAG.ComputeNumSignBits(N1) < 17 || DAG.ComputeNumSignBits(N0) < 17)
+ // Sign bits must extend down to the lowest i16.
+ if (DAG.ComputeMinSignedBits(N1) > 16 || DAG.ComputeMinSignedBits(N0) > 16)
return SDValue();
// At least one of the elements must be zero in the upper 17 bits, or can be
More information about the llvm-commits
mailing list