search for: getcodegenopts

Displaying 18 results from an estimated 18 matches for "getcodegenopts".

2016 Sep 09
2
defaults for FP contraction [e.g. fused multiply-add]: suggestion and patch to be slightly more aggressive and to make Clang`s optimization settings closer to having the same meaning as when they are given to GCC [at least for "-O3"]
...+ // If there will ever be e.g. "LangOpts.C", replace "LangOpts.C11 || LangOpts.C99" with "LangOpts.C" on the next line. + if ( (LangOpts.C11 || LangOpts.C99 || LangOpts.CPlusPlus) // ... + /*...*/ && ( CodeGenOptions::FPC_On == Res.getCodeGenOpts().getFPContractMode() ) // ... // just being careful + /*...*/ && (Res.getCodeGenOpts().OptimizationLevel >= 3) ) + LangOpts.DefaultFPContract = 1; + return Success; } diff --git a/clang/test/CodeGen/fp-contract-pragma.cpp b/clang/test/CodeGen/fp-contract-pragma.cpp index 1c5...
2015 Jun 17
2
[LLVMdev] Inline hint for methods defined in-class
...g patch, which I believe handles the in-class definition case: --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { if (!CGM.getCodeGenOpts().NoInline) { for (auto RI : FD->redecls()) - if (RI->isInlineSpecified()) { + if (RI->isInlined()) { Fn->addFnAttr(llvm::Attribute::InlineHint); break; } I tried this on C++ benchmarks in SPEC 2006. There is no noticeable performance...
2015 Jun 17
2
[LLVMdev] Inline hint for methods defined in-class
...he in-class definition > case: > > --- a/lib/CodeGen/CodeGenFunction.cpp > +++ b/lib/CodeGen/CodeGenFunction.cpp > @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, > if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { > if (!CGM.getCodeGenOpts().NoInline) { > for (auto RI : FD->redecls()) > - if (RI->isInlineSpecified()) { > + if (RI->isInlined()) { > Fn->addFnAttr(llvm::Attribute::InlineHint); > break; > } > > I tried this on C++ benchmarks in SPEC 2...
2015 Jun 24
4
[LLVMdev] Inline hint for methods defined in-class
...gt;> --- a/lib/CodeGen/CodeGenFunction.cpp > >> +++ b/lib/CodeGen/CodeGenFunction.cpp > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { > >> if (!CGM.getCodeGenOpts().NoInline) { > >> for (auto RI : FD->redecls()) > >> - if (RI->isInlineSpecified()) { > >> + if (RI->isInlined()) { > >> Fn->addFnAttr(llvm::Attribute::InlineHint); > >> break; > >>...
2015 Jun 24
4
[LLVMdev] Inline hint for methods defined in-class
...>> +++ b/lib/CodeGen/CodeGenFunction.cpp >> > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl >> > >> GD, >> > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> > >> for (auto RI : FD->redecls()) >> > >> - if (RI->isInlineSpecified()) { >> > >> + if (RI->isInlined()) { >> > >> Fn->addFnAttr(llvm::Attribute::InlineHint); >> > &gt...
2015 Jul 07
6
[LLVMdev] Inline hint for methods defined in-class
...d patch will add InlineHint to methods defined inside a class: --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { if (!CGM.getCodeGenOpts().NoInline) { for (auto RI : FD->redecls()) - if (RI->isInlineSpecified()) { + if (RI->isInlined()) { Fn->addFnAttr(llvm::Attribute::InlineHint); break; } Here are the performance and size numbers I've collected: - C++ subset of...
2015 Jun 24
2
[LLVMdev] Inline hint for methods defined in-class
...pp >> >> > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl >> >> > >> GD, >> >> > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) >> { >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> > >> for (auto RI : FD->redecls()) >> >> > >> - if (RI->isInlineSpecified()) { >> >> > >> + if (RI->isInlined()) { >> >> > >> Fn->addFnAttr(llvm::Attri...
2015 Jun 24
6
[LLVMdev] Inline hint for methods defined in-class
...pp >> >> > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl >> >> > >> GD, >> >> > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) >> { >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> > >> for (auto RI : FD->redecls()) >> >> > >> - if (RI->isInlineSpecified()) { >> >> > >> + if (RI->isInlined()) { >> >> > >> Fn->addFnAttr(llvm::Attri...
2015 Jun 24
3
[LLVMdev] Inline hint for methods defined in-class
...StartFunction(GlobalDecl >> >> >> > >> GD, >> >> >> > >> if (const FunctionDecl *FD = >> >> >> > >> dyn_cast_or_null<FunctionDecl>(D)) >> >> { >> >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> >> > >> for (auto RI : FD->redecls()) >> >> >> > >> - if (RI->isInlineSpecified()) { >> >> >> > >> + if (RI->isInlined()) { >> >> >> > >>...
2015 Jun 24
3
[LLVMdev] Inline hint for methods defined in-class
...void >> CodeGenFunction::StartFunction(GlobalDecl >> >> >> > >> GD, >> >> >> > >> if (const FunctionDecl *FD = >> dyn_cast_or_null<FunctionDecl>(D)) >> >> { >> >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> >> > >> for (auto RI : FD->redecls()) >> >> >> > >> - if (RI->isInlineSpecified()) { >> >> >> > >> + if (RI->isInlined()) { >> >> >> > >>...
2015 Jun 24
2
[LLVMdev] Inline hint for methods defined in-class
...StartFunction(GlobalDecl >> >> >> > >> GD, >> >> >> > >> if (const FunctionDecl *FD = >> >> >> > >> dyn_cast_or_null<FunctionDecl>(D)) >> >> { >> >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> >> > >> for (auto RI : FD->redecls()) >> >> >> > >> - if (RI->isInlineSpecified()) { >> >> >> > >> + if (RI->isInlined()) { >> >> >> > >>...
2016 Sep 09
3
defaults for FP contraction [e.g. fused multiply-add]: suggestion and patch to be slightly more aggressive and to make Clang`s optimization settings closer to having the same meaning as when they are given to GCC [at least for "-O3"]
...ot arguing] My guess: b/c we don`t want programs to give different results when compiled at different "-O<...>" settings with the exception of "-Ofast". At any rate, the above change is trivial to apply to my recent proposed patch: just remove the "&& (Res.getCodeGenOpts().OptimizationLevel >= 3)" part of the condition. Regards, Abe
2015 Jul 08
9
[LLVMdev] Inline hint for methods defined in-class
...a class: >> >> --- a/lib/CodeGen/CodeGenFunction.cpp >> +++ b/lib/CodeGen/CodeGenFunction.cpp >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { >> if (!CGM.getCodeGenOpts().NoInline) { >> for (auto RI : FD->redecls()) >> - if (RI->isInlineSpecified()) { >> + if (RI->isInlined()) { >> Fn->addFnAttr(llvm::Attribute::InlineHint); >> break; >> } >> >> Here are...
2016 Sep 11
3
defaults for FP contraction [e.g. fused multiply-add]: suggestion and patch to be slightly more aggressive and to make Clang`s optimization settings closer to having the same meaning as when they are given to GCC [at least for "-O3"]
On Sep 10, 2016, at 3:33 AM, Steve Canon <scanon at apple.com> wrote: >>> >>> Pretty much. In particular, imagine a user trying to debug an unexpected floating point result caused by conversion of a*b + c into fma(a, b, c). >> >> I think that’s unavoidable, because of the way the optimization levels work. Even fma contraction is on by default (something I’d
2015 Jul 09
2
[LLVMdev] Inline hint for methods defined in-class
...; --- a/lib/CodeGen/CodeGenFunction.cpp > >> +++ b/lib/CodeGen/CodeGenFunction.cpp > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl > >> GD, > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { > >> if (!CGM.getCodeGenOpts().NoInline) { > >> for (auto RI : FD->redecls()) > >> - if (RI->isInlineSpecified()) { > >> + if (RI->isInlined()) { > >> Fn->addFnAttr(llvm::Attribute::InlineHint); > >> break; > >> } > >> > >> Here are the perfor...
2015 Jun 24
2
[LLVMdev] Inline hint for methods defined in-class
...(GlobalDecl >> >> >> >> > >> GD, >> >> >> >> > >> if (const FunctionDecl *FD = >> >> dyn_cast_or_null<FunctionDecl>(D)) >> >> >> { >> >> >> >> > >> if (!CGM.getCodeGenOpts().NoInline) { >> >> >> >> > >> for (auto RI : FD->redecls()) >> >> >> >> > >> - if (RI->isInlineSpecified()) { >> >> >> >> > >> + if (RI->isInlined()) { >> >>...
2015 Jul 10
3
[LLVMdev] Inline hint for methods defined in-class
...b/lib/CodeGen/CodeGenFunction.cpp > > >> @@ -630,7 +630,7 @@ void > > >> CodeGenFunction::StartFunction(GlobalDecl > > >> GD, > > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) > > >> { > > >> if (!CGM.getCodeGenOpts().NoInline) { > > >> for (auto RI : FD->redecls()) > > >> - if (RI->isInlineSpecified()) { > > >> + if (RI->isInlined()) { > > >> Fn->addFnAttr(llvm::Attribute::InlineHint); > > >> break; > > >> } > > >>...
2015 Jul 10
2
[LLVMdev] Inline hint for methods defined in-class
...gt; > > > >> CodeGenFunction::StartFunction(GlobalDecl > > > > >> GD, > > > > >> if (const FunctionDecl *FD = > > > > >> dyn_cast_or_null<FunctionDecl>(D)) > > > > >> { > > > > >> if (!CGM.getCodeGenOpts().NoInline) { > > > > >> for (auto RI : FD->redecls()) > > > > >> - if (RI->isInlineSpecified()) { > > > > >> + if (RI->isInlined()) { > > > > >> Fn->addFnAttr(llvm::Attribute::InlineHint); > > > > >&...