mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
[X86] X86::isConstantSplat - enable partial undef bit handling by default.
We currently only ever use this for lowering constant uniform values (shift/rotate by immediate) so we can safely enable it by default (it treats the undef bits as zero when extracting constants). This is necessary for an upcoming patch that will use SimplifyDemandedBits more aggressively on funnel shift amounts and causes regressions in vXi64 constant without it.
This commit is contained in:
parent
8b6b4c77d6
commit
3463efbca6
@ -6528,11 +6528,12 @@ static bool getTargetConstantBitsFromNode(SDValue Op, unsigned EltSizeInBits,
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace X86 {
|
namespace X86 {
|
||||||
bool isConstantSplat(SDValue Op, APInt &SplatVal) {
|
bool isConstantSplat(SDValue Op, APInt &SplatVal, bool AllowPartialUndefs) {
|
||||||
APInt UndefElts;
|
APInt UndefElts;
|
||||||
SmallVector<APInt, 16> EltBits;
|
SmallVector<APInt, 16> EltBits;
|
||||||
if (getTargetConstantBitsFromNode(Op, Op.getScalarValueSizeInBits(),
|
if (getTargetConstantBitsFromNode(Op, Op.getScalarValueSizeInBits(),
|
||||||
UndefElts, EltBits, true, false)) {
|
UndefElts, EltBits, true,
|
||||||
|
AllowPartialUndefs)) {
|
||||||
int SplatIndex = -1;
|
int SplatIndex = -1;
|
||||||
for (int i = 0, e = EltBits.size(); i != e; ++i) {
|
for (int i = 0, e = EltBits.size(); i != e; ++i) {
|
||||||
if (UndefElts[i])
|
if (UndefElts[i])
|
||||||
|
@ -722,7 +722,10 @@ namespace llvm {
|
|||||||
|
|
||||||
/// If Op is a constant whose elements are all the same constant or
|
/// If Op is a constant whose elements are all the same constant or
|
||||||
/// undefined, return true and return the constant value in \p SplatVal.
|
/// undefined, return true and return the constant value in \p SplatVal.
|
||||||
bool isConstantSplat(SDValue Op, APInt &SplatVal);
|
/// If we have undef bits that don't cover an entire element, we treat these
|
||||||
|
/// as zero if AllowPartialUndefs is set, else we fail and return false.
|
||||||
|
bool isConstantSplat(SDValue Op, APInt &SplatVal,
|
||||||
|
bool AllowPartialUndefs = true);
|
||||||
} // end namespace X86
|
} // end namespace X86
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
Loading…
Reference in New Issue
Block a user