This breaks copyAttributesFrom when the destination lives in a different
module from the source. The decision in D21255 was to revert this patch
and handle comdat copying separately from copyAttributesFrom.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This patch should fix DAE:
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index d9da5e8..3caaa4a 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -147,6 +147,7 @@ bool DeadArgumentEliminationPass::DeleteDeadVarargs(Function &Fn) { // Create the new function body and insert it into the module... Function *NF = Function::Create(NFTy, Fn.getLinkage()); NF->copyAttributesFrom(&Fn); + NF->setComdat(Fn.getComdat()); Fn.getParent()->getFunctionList().insert(Fn.getIterator(), NF); NF->takeName(&Fn); @@ -813,6 +814,7 @@ bool DeadArgumentEliminationPass::RemoveDeadStuffFromFunction(Function *F) { // Create the new function body and insert it into the module... Function *NF = Function::Create(NFTy, F->getLinkage()); NF->copyAttributesFrom(F); + NF->setComdat(F->getComdat()); NF->setAttributes(NewPAL); // Insert the new function before the old function, so we won't be processing // it again.
test/Transforms/DeadArgElim/comdat.ll | ||
---|---|---|
1 ↗ | (On Diff #60889) | Please keep this test case and fix DAE |