mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Don't create indexed load / store with zero offset!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -3110,6 +3110,10 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
|
|||||||
ISD::MemIndexedMode AM = ISD::UNINDEXED;
|
ISD::MemIndexedMode AM = ISD::UNINDEXED;
|
||||||
if (!TLI.getPreIndexedAddressParts(N, BasePtr, Offset, AM, DAG))
|
if (!TLI.getPreIndexedAddressParts(N, BasePtr, Offset, AM, DAG))
|
||||||
return false;
|
return false;
|
||||||
|
// Don't create a indexed load / store with zero offset.
|
||||||
|
if (isa<ConstantSDNode>(Offset) &&
|
||||||
|
cast<ConstantSDNode>(Offset)->getValue() == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Try turning it into a pre-indexed load / store except when:
|
// Try turning it into a pre-indexed load / store except when:
|
||||||
// 1) The base is a frame index.
|
// 1) The base is a frame index.
|
||||||
@ -3239,6 +3243,10 @@ bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
|
|||||||
std::swap(BasePtr, Offset);
|
std::swap(BasePtr, Offset);
|
||||||
if (Ptr != BasePtr)
|
if (Ptr != BasePtr)
|
||||||
continue;
|
continue;
|
||||||
|
// Don't create a indexed load / store with zero offset.
|
||||||
|
if (isa<ConstantSDNode>(Offset) &&
|
||||||
|
cast<ConstantSDNode>(Offset)->getValue() == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
// Try turning it into a post-indexed load / store except when
|
// Try turning it into a post-indexed load / store except when
|
||||||
// 1) All uses are load / store ops that use it as base ptr.
|
// 1) All uses are load / store ops that use it as base ptr.
|
||||||
|
Reference in New Issue
Block a user