mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-26 13:49:56 +00:00
[XCore] CombineSTORE - Use allowsMemoryAccess wrapper. NFCI.
Noticed in D63075 - there was a allowsMisalignedMemoryAccesses call to check for unaligned loads and a check for aligned legal type loads - which is exactly what allowsMemoryAccess does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363141 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c543215de3
commit
0276d51594
@ -1780,9 +1780,8 @@ SDValue XCoreTargetLowering::PerformDAGCombine(SDNode *N,
|
||||
// Replace unaligned store of unaligned load with memmove.
|
||||
StoreSDNode *ST = cast<StoreSDNode>(N);
|
||||
if (!DCI.isBeforeLegalize() ||
|
||||
allowsMisalignedMemoryAccesses(ST->getMemoryVT(),
|
||||
ST->getAddressSpace(),
|
||||
ST->getAlignment()) ||
|
||||
allowsMemoryAccess(*DAG.getContext(), DAG.getDataLayout(),
|
||||
ST->getMemoryVT(), *ST->getMemOperand()) ||
|
||||
ST->isVolatile() || ST->isIndexed()) {
|
||||
break;
|
||||
}
|
||||
@ -1791,12 +1790,7 @@ SDValue XCoreTargetLowering::PerformDAGCombine(SDNode *N,
|
||||
unsigned StoreBits = ST->getMemoryVT().getStoreSizeInBits();
|
||||
assert((StoreBits % 8) == 0 &&
|
||||
"Store size in bits must be a multiple of 8");
|
||||
unsigned ABIAlignment = DAG.getDataLayout().getABITypeAlignment(
|
||||
ST->getMemoryVT().getTypeForEVT(*DCI.DAG.getContext()));
|
||||
unsigned Alignment = ST->getAlignment();
|
||||
if (Alignment >= ABIAlignment) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (LoadSDNode *LD = dyn_cast<LoadSDNode>(ST->getValue())) {
|
||||
if (LD->hasNUsesOfValue(1, 0) && ST->getMemoryVT() == LD->getMemoryVT() &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user