mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Change typeIncompatible to return an AttrBuilder instead of new-ing an AttributeSet.
This makes use of the new API which can remove attributes from a set given a builder. This is much faster than creating a temporary set and reduces llc time by about 0.3% which was all spent creating temporary attributes sets on the context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236668 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -849,17 +849,12 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
// here. Currently, this should not be possible, but special handling might be
|
||||
// required when new return value attributes are added.
|
||||
if (NRetTy->isVoidTy())
|
||||
RAttrs =
|
||||
AttributeSet::get(NRetTy->getContext(), AttributeSet::ReturnIndex,
|
||||
AttrBuilder(RAttrs, AttributeSet::ReturnIndex).
|
||||
removeAttributes(AttributeFuncs::
|
||||
typeIncompatible(NRetTy, AttributeSet::ReturnIndex),
|
||||
AttributeSet::ReturnIndex));
|
||||
RAttrs = RAttrs.removeAttributes(NRetTy->getContext(),
|
||||
AttributeSet::ReturnIndex,
|
||||
AttributeFuncs::typeIncompatible(NRetTy));
|
||||
else
|
||||
assert(!AttrBuilder(RAttrs, AttributeSet::ReturnIndex).
|
||||
hasAttributes(AttributeFuncs::
|
||||
typeIncompatible(NRetTy, AttributeSet::ReturnIndex),
|
||||
AttributeSet::ReturnIndex) &&
|
||||
overlaps(AttributeFuncs::typeIncompatible(NRetTy)) &&
|
||||
"Return attributes no longer compatible?");
|
||||
|
||||
if (RAttrs.hasAttributes(AttributeSet::ReturnIndex))
|
||||
@@ -903,13 +898,9 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
AttributeSet RAttrs = CallPAL.getRetAttributes();
|
||||
|
||||
// Adjust in case the function was changed to return void.
|
||||
RAttrs =
|
||||
AttributeSet::get(NF->getContext(), AttributeSet::ReturnIndex,
|
||||
AttrBuilder(RAttrs, AttributeSet::ReturnIndex).
|
||||
removeAttributes(AttributeFuncs::
|
||||
typeIncompatible(NF->getReturnType(),
|
||||
AttributeSet::ReturnIndex),
|
||||
AttributeSet::ReturnIndex));
|
||||
RAttrs = RAttrs.removeAttributes(NRetTy->getContext(),
|
||||
AttributeSet::ReturnIndex,
|
||||
AttributeFuncs::typeIncompatible(NF->getReturnType()));
|
||||
if (RAttrs.hasAttributes(AttributeSet::ReturnIndex))
|
||||
AttributesVec.push_back(AttributeSet::get(NF->getContext(), RAttrs));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user