[llvm-commits] [poolalloc] r131749 - in /poolalloc/trunk/lib/AssistDS: GEPExprArgs.cpp LoadArgs.cpp StructReturnToPointer.cpp TypeChecks.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Fri May 20 13:01:06 PDT 2011
Author: aggarwa4
Date: Fri May 20 15:01:06 2011
New Revision: 131749
URL: http://llvm.org/viewvc/llvm-project?rev=131749&view=rev
Log:
Populate AttributesVec in index order. Hits assert
Misordered AttributesList! in 401.bzip2 otherwise.
Modified:
poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp
poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp
poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
Modified: poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp?rev=131749&r1=131748&r2=131749&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp Fri May 20 15:01:06 2011
@@ -118,6 +118,8 @@
NI->setName(II->getName());
NI->addAttr(F->getAttributes().getParamAttributes(II->getArgNo() + 1));
}
+ NewF->setAttributes(NewF->getAttributes().addAttr(
+ 0, F->getAttributes().getRetAttributes()));
// Perform the cloning.
SmallVector<ReturnInst*,100> Returns;
CloneFunctionInto(NewF, F, ValueMap, Returns);
@@ -128,8 +130,6 @@
}
NewF->setAttributes(NewF->getAttributes().addAttr(
- 0, F->getAttributes().getRetAttributes()));
- NewF->setAttributes(NewF->getAttributes().addAttr(
~0, F->getAttributes().getFnAttributes()));
//Get the point to insert the GEP instr.
SmallVector<Value*, 8> Ops(CI->op_begin()+1, CI->op_end());
@@ -157,7 +157,10 @@
AttrListPtr CallPAL = CI->getAttributes();
Attributes RAttrs = CallPAL.getRetAttributes();
Attributes FnAttrs = CallPAL.getFnAttributes();
+ if (RAttrs)
+ AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
+ CI->dump();
SmallVector<Value*, 8> Args;
Args.push_back(GEP->getPointerOperand());
for(unsigned j =1;j<CI->getNumOperands();j++) {
@@ -169,8 +172,6 @@
// Create the new attributes vec.
if (FnAttrs != Attribute::None)
AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
- if (RAttrs)
- AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
AttributesVec.end());
Modified: poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/LoadArgs.cpp?rev=131749&r1=131748&r2=131749&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/LoadArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/LoadArgs.cpp Fri May 20 15:01:06 2011
@@ -168,6 +168,9 @@
AttrListPtr CallPAL = CI->getAttributes();
Attributes RAttrs = CallPAL.getRetAttributes();
Attributes FnAttrs = CallPAL.getFnAttributes();
+ if (RAttrs)
+ AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
+
SmallVector<Value*, 8> Args;
Args.push_back(LI->getOperand(0));
for(unsigned j =1;j<CI->getNumOperands();j++) {
@@ -179,8 +182,6 @@
// Create the new attributes vec.
if (FnAttrs != Attribute::None)
AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
- if (RAttrs)
- AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
AttributesVec.end());
Modified: poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp?rev=131749&r1=131748&r2=131749&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp Fri May 20 15:01:06 2011
@@ -125,6 +125,9 @@
AttrListPtr CallPAL = CI->getAttributes();
Attributes RAttrs = CallPAL.getRetAttributes();
Attributes FnAttrs = CallPAL.getFnAttributes();
+
+ if (RAttrs)
+ AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
Args.push_back(AllocaNew);
for(unsigned j =1;j<CI->getNumOperands();j++) {
@@ -136,8 +139,6 @@
// Create the new attributes vec.
if (FnAttrs != Attribute::None)
AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
- if (RAttrs)
- AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
AttributesVec.end());
Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=131749&r1=131748&r2=131749&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Fri May 20 15:01:06 2011
@@ -446,6 +446,9 @@
Attributes RAttrs = CallPAL.getRetAttributes();
Attributes FnAttrs = CallPAL.getFnAttributes();
+ if (RAttrs)
+ AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
+
Function::arg_iterator II = F.arg_begin();
for(unsigned j =1;j<CI->getNumOperands();j++, II++) {
@@ -463,8 +466,6 @@
// Create the new attributes vec.
if (FnAttrs != Attribute::None)
AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
- if (RAttrs)
- AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
AttributesVec.end());
More information about the llvm-commits
mailing list