1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Fix PR1872: SrcValue and SrcValueOffset should not be used to compute load / store node id.

llvm-svn: 45167
This commit is contained in:
Evan Cheng 2007-12-18 19:38:14 +00:00
parent 06cd90a12f
commit 8824950e8f
2 changed files with 28 additions and 20 deletions

View File

@ -372,8 +372,6 @@ static void AddNodeIDNode(FoldingSetNodeID &ID, SDNode *N) {
ID.AddInteger(LD->getAddressingMode());
ID.AddInteger(LD->getExtensionType());
ID.AddInteger((unsigned int)(LD->getLoadedVT()));
ID.AddPointer(LD->getSrcValue());
ID.AddInteger(LD->getSrcValueOffset());
ID.AddInteger(LD->getAlignment());
ID.AddInteger(LD->isVolatile());
break;
@ -383,8 +381,6 @@ static void AddNodeIDNode(FoldingSetNodeID &ID, SDNode *N) {
ID.AddInteger(ST->getAddressingMode());
ID.AddInteger(ST->isTruncatingStore());
ID.AddInteger((unsigned int)(ST->getStoredVT()));
ID.AddPointer(ST->getSrcValue());
ID.AddInteger(ST->getSrcValueOffset());
ID.AddInteger(ST->getAlignment());
ID.AddInteger(ST->isVolatile());
break;
@ -639,16 +635,12 @@ SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N,
ID.AddInteger(LD->getAddressingMode());
ID.AddInteger(LD->getExtensionType());
ID.AddInteger((unsigned int)(LD->getLoadedVT()));
ID.AddPointer(LD->getSrcValue());
ID.AddInteger(LD->getSrcValueOffset());
ID.AddInteger(LD->getAlignment());
ID.AddInteger(LD->isVolatile());
} else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
ID.AddInteger(ST->getAddressingMode());
ID.AddInteger(ST->isTruncatingStore());
ID.AddInteger((unsigned int)(ST->getStoredVT()));
ID.AddPointer(ST->getSrcValue());
ID.AddInteger(ST->getSrcValueOffset());
ID.AddInteger(ST->getAlignment());
ID.AddInteger(ST->isVolatile());
}
@ -2330,8 +2322,6 @@ SDOperand SelectionDAG::getLoad(MVT::ValueType VT,
ID.AddInteger(ISD::UNINDEXED);
ID.AddInteger(ISD::NON_EXTLOAD);
ID.AddInteger((unsigned int)VT);
ID.AddPointer(SV);
ID.AddInteger(SVOffset);
ID.AddInteger(Alignment);
ID.AddInteger(isVolatile);
void *IP = 0;
@ -2385,8 +2375,6 @@ SDOperand SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT,
ID.AddInteger(ISD::UNINDEXED);
ID.AddInteger(ExtType);
ID.AddInteger((unsigned int)EVT);
ID.AddPointer(SV);
ID.AddInteger(SVOffset);
ID.AddInteger(Alignment);
ID.AddInteger(isVolatile);
void *IP = 0;
@ -2413,8 +2401,6 @@ SelectionDAG::getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
ID.AddInteger(AM);
ID.AddInteger(LD->getExtensionType());
ID.AddInteger((unsigned int)(LD->getLoadedVT()));
ID.AddPointer(LD->getSrcValue());
ID.AddInteger(LD->getSrcValueOffset());
ID.AddInteger(LD->getAlignment());
ID.AddInteger(LD->isVolatile());
void *IP = 0;
@ -2454,8 +2440,6 @@ SDOperand SelectionDAG::getStore(SDOperand Chain, SDOperand Val,
ID.AddInteger(ISD::UNINDEXED);
ID.AddInteger(false);
ID.AddInteger((unsigned int)VT);
ID.AddPointer(SV);
ID.AddInteger(SVOffset);
ID.AddInteger(Alignment);
ID.AddInteger(isVolatile);
void *IP = 0;
@ -2502,8 +2486,6 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val,
ID.AddInteger(ISD::UNINDEXED);
ID.AddInteger(1);
ID.AddInteger((unsigned int)SVT);
ID.AddPointer(SV);
ID.AddInteger(SVOffset);
ID.AddInteger(Alignment);
ID.AddInteger(isVolatile);
void *IP = 0;
@ -2529,8 +2511,6 @@ SelectionDAG::getIndexedStore(SDOperand OrigStore, SDOperand Base,
ID.AddInteger(AM);
ID.AddInteger(ST->isTruncatingStore());
ID.AddInteger((unsigned int)(ST->getStoredVT()));
ID.AddPointer(ST->getSrcValue());
ID.AddInteger(ST->getSrcValueOffset());
ID.AddInteger(ST->getAlignment());
ID.AddInteger(ST->isVolatile());
void *IP = 0;

View File

@ -0,0 +1,28 @@
; RUN: llvm-as < %s | llc -march=x86 | grep {(%esp)} | count 2
; PR1872
%struct.c34007g__designated___XUB = type { i32, i32, i32, i32 }
%struct.c34007g__pkg__parent = type { i32*, %struct.c34007g__designated___XUB* }
define void @_ada_c34007g() {
entry:
%x8 = alloca %struct.c34007g__pkg__parent, align 8 ; <%struct.c34007g__pkg__parent*> [#uses=2]
%tmp1272 = getelementptr %struct.c34007g__pkg__parent* %x8, i32 0, i32 0 ; <i32**> [#uses=1]
%x82167 = bitcast %struct.c34007g__pkg__parent* %x8 to i64* ; <i64*> [#uses=1]
br i1 true, label %bb4668, label %bb848
bb4668: ; preds = %bb4648
%tmp5464 = load i64* %x82167, align 8 ; <i64> [#uses=1]
%tmp5467 = icmp ne i64 0, %tmp5464 ; <i1> [#uses=1]
%tmp5470 = load i32** %tmp1272, align 8 ; <i32*> [#uses=1]
%tmp5471 = icmp eq i32* %tmp5470, null ; <i1> [#uses=1]
%tmp5475 = or i1 %tmp5471, %tmp5467 ; <i1> [#uses=1]
%tmp5497 = or i1 %tmp5475, false ; <i1> [#uses=1]
br i1 %tmp5497, label %bb848, label %bb5507
bb848: ; preds = %entry
ret void
bb5507: ; preds = %bb4668
ret void
}