mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 02:24:29 +00:00
Enable the simplification of truncating-store after fixing the usage of
GetDemandBits (which must operate on the vector element type). Fix the a usage of getZeroExtendInReg which must also be done on scalar types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133052 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -6428,14 +6428,15 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
|
|||||||
|
|
||||||
// FIXME: is there such a thing as a truncating indexed store?
|
// FIXME: is there such a thing as a truncating indexed store?
|
||||||
if (ST->isTruncatingStore() && ST->isUnindexed() &&
|
if (ST->isTruncatingStore() && ST->isUnindexed() &&
|
||||||
Value.getValueType().isInteger() && !Value.getValueType().isVector()) {
|
Value.getValueType().isInteger()) {
|
||||||
// See if we can simplify the input to this truncstore with knowledge that
|
// See if we can simplify the input to this truncstore with knowledge that
|
||||||
// only the low bits are being used. For example:
|
// only the low bits are being used. For example:
|
||||||
// "truncstore (or (shl x, 8), y), i8" -> "truncstore y, i8"
|
// "truncstore (or (shl x, 8), y), i8" -> "truncstore y, i8"
|
||||||
SDValue Shorter =
|
SDValue Shorter =
|
||||||
GetDemandedBits(Value,
|
GetDemandedBits(Value,
|
||||||
APInt::getLowBitsSet(Value.getValueSizeInBits(),
|
APInt::getLowBitsSet(
|
||||||
ST->getMemoryVT().getSizeInBits()));
|
Value.getValueType().getScalarType().getSizeInBits(),
|
||||||
|
ST->getMemoryVT().getScalarType().getSizeInBits()));
|
||||||
AddToWorkList(Value.getNode());
|
AddToWorkList(Value.getNode());
|
||||||
if (Shorter.getNode())
|
if (Shorter.getNode())
|
||||||
return DAG.getTruncStore(Chain, N->getDebugLoc(), Shorter,
|
return DAG.getTruncStore(Chain, N->getDebugLoc(), Shorter,
|
||||||
|
@ -201,7 +201,7 @@ private:
|
|||||||
EVT OldVT = Op.getValueType();
|
EVT OldVT = Op.getValueType();
|
||||||
DebugLoc dl = Op.getDebugLoc();
|
DebugLoc dl = Op.getDebugLoc();
|
||||||
Op = GetPromotedInteger(Op);
|
Op = GetPromotedInteger(Op);
|
||||||
return DAG.getZeroExtendInReg(Op, dl, OldVT);
|
return DAG.getZeroExtendInReg(Op, dl, OldVT.getScalarType());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Integer Result Promotion.
|
// Integer Result Promotion.
|
||||||
|
Reference in New Issue
Block a user