[PATCH] D112645: [OpenMP] Fix: opposite attributes could be set by -fno-inline
Joseph Huber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 1 06:49:16 PDT 2021
jhuber6 accepted this revision.
jhuber6 added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:5370
if (CGM.getCodeGenOpts().OptimizationLevel != 0)
Fn->addFnAttr(llvm::Attribute::AlwaysInline);
return Fn;
----------------
igor.kirillov wrote:
> I noticed that here we set this attribute on the same function that is created by `emitOutlinedFunctionPrologue` but there AlwaysInline attribute is guaranteed to be set under same condition. So I suppose we could remove this piece of code?
Yeah, you can remove this.
================
Comment at: clang/test/OpenMP/parallel_for_noinline.cpp:1
+// RUN: %clang -O0 -fopenmp -fno-inline %s -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O0
+// RUN: %clang -O1 -fopenmp -fno-inline %s -S -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-O1
----------------
This can probably be merged with the other test added in D107649 since it's the same problem, just add another run line and run the update script.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112645/new/
https://reviews.llvm.org/D112645
More information about the cfe-commits
mailing list