mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +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:
@@ -1513,10 +1513,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
|
||||
if (!CallerPAL.isEmpty() && !Caller->use_empty()) {
|
||||
AttrBuilder RAttrs(CallerPAL, AttributeSet::ReturnIndex);
|
||||
if (RAttrs.
|
||||
hasAttributes(AttributeFuncs::
|
||||
typeIncompatible(NewRetTy, AttributeSet::ReturnIndex),
|
||||
AttributeSet::ReturnIndex))
|
||||
if (RAttrs.overlaps(AttributeFuncs::typeIncompatible(NewRetTy)))
|
||||
return false; // Attribute not compatible with transformed value.
|
||||
}
|
||||
|
||||
@@ -1557,8 +1554,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
return false; // Cannot transform this parameter value.
|
||||
|
||||
if (AttrBuilder(CallerPAL.getParamAttributes(i + 1), i + 1).
|
||||
hasAttributes(AttributeFuncs::
|
||||
typeIncompatible(ParamTy, i + 1), i + 1))
|
||||
overlaps(AttributeFuncs::typeIncompatible(ParamTy)))
|
||||
return false; // Attribute not compatible with transformed value.
|
||||
|
||||
if (CS.isInAllocaArgument(i))
|
||||
@@ -1631,10 +1627,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
|
||||
// If the return value is not being used, the type may not be compatible
|
||||
// with the existing attributes. Wipe out any problematic attributes.
|
||||
RAttrs.
|
||||
removeAttributes(AttributeFuncs::
|
||||
typeIncompatible(NewRetTy, AttributeSet::ReturnIndex),
|
||||
AttributeSet::ReturnIndex);
|
||||
RAttrs.remove(AttributeFuncs::typeIncompatible(NewRetTy));
|
||||
|
||||
// Add the new return attributes.
|
||||
if (RAttrs.hasAttributes())
|
||||
|
Reference in New Issue
Block a user