diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2021-10-08 16:29:57 -0400 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2021-11-09 17:39:24 -0500 |
commit | 4b5c3e591d74f0f5810608b45ede58f3d489e14d (patch) | |
tree | c01e1586c3181242cb2952fbcb10a60ef660f745 /clang/lib/CodeGen/CGCall.cpp | |
parent | e52937eba022c78545d7783693f0fb0e56b8cd35 (diff) | |
download | llvm-4b5c3e591d74f0f5810608b45ede58f3d489e14d.zip llvm-4b5c3e591d74f0f5810608b45ede58f3d489e14d.tar.gz llvm-4b5c3e591d74f0f5810608b45ede58f3d489e14d.tar.bz2 |
[OpenMP] Remove doing assumption propagation in the front end.
This patch removes the assumption propagation that was added in D110655
primarily to get assumption informatino on opaque call sites for
optimizations. The analysis done in D111445 allows us to do this more
intelligently in the back-end.
Depends on D111445
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D111463
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index daea09b..d830a7e 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1748,8 +1748,7 @@ static void AddAttributesFromFunctionProtoType(ASTContext &Ctx, } static void AddAttributesFromAssumes(llvm::AttrBuilder &FuncAttrs, - const Decl *Callee, const Decl *Caller, - bool AssumptionOnCallSite) { + const Decl *Callee) { if (!Callee) return; @@ -1758,10 +1757,6 @@ static void AddAttributesFromAssumes(llvm::AttrBuilder &FuncAttrs, for (const AssumptionAttr *AA : Callee->specific_attrs<AssumptionAttr>()) AA->getAssumption().split(Attrs, ","); - if (Caller && Caller->hasAttrs() && AssumptionOnCallSite) - for (const AssumptionAttr *AA : Caller->specific_attrs<AssumptionAttr>()) - AA->getAssumption().split(Attrs, ","); - if (!Attrs.empty()) FuncAttrs.addAttribute(llvm::AssumptionAttrKey, llvm::join(Attrs.begin(), Attrs.end(), ",")); @@ -2019,10 +2014,12 @@ static bool DetermineNoUndef(QualType QTy, CodeGenTypes &Types, /// attributes that restrict how the frontend generates code must be /// added here rather than getDefaultFunctionAttributes. /// -void CodeGenModule::ConstructAttributeList( - StringRef Name, const CGFunctionInfo &FI, CGCalleeInfo CalleeInfo, - llvm::AttributeList &AttrList, unsigned &CallingConv, bool AttrOnCallSite, - bool IsThunk, const Decl *Caller) { +void CodeGenModule::ConstructAttributeList(StringRef Name, + const CGFunctionInfo &FI, + CGCalleeInfo CalleeInfo, + llvm::AttributeList &AttrList, + unsigned &CallingConv, + bool AttrOnCallSite, bool IsThunk) { llvm::AttrBuilder FuncAttrs; llvm::AttrBuilder RetAttrs; @@ -2040,12 +2037,9 @@ void CodeGenModule::ConstructAttributeList( const Decl *TargetDecl = CalleeInfo.getCalleeDecl().getDecl(); - // Only attach assumptions to call sites in OpenMP mode. - bool AssumptionOnCallSite = getLangOpts().OpenMP && AttrOnCallSite; - // Attach assumption attributes to the declaration. If this is a call // site, attach assumptions from the caller to the call as well. - AddAttributesFromAssumes(FuncAttrs, TargetDecl, Caller, AssumptionOnCallSite); + AddAttributesFromAssumes(FuncAttrs, TargetDecl); bool HasOptnone = false; // The NoBuiltinAttr attached to the target FunctionDecl. @@ -5180,7 +5174,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, CGM.ConstructAttributeList(CalleePtr->getName(), CallInfo, Callee.getAbstractInfo(), Attrs, CallingConv, /*AttrOnCallSite=*/true, - /*IsThunk=*/false, CurFuncDecl); + /*IsThunk=*/false); if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(CurFuncDecl)) if (FD->hasAttr<StrictFPAttr>()) |