peixin created this revision. peixin added reviewers: jhuber6, jdoerfert, kiranchandramohan, Meinersbur, clementval, kiranktp, Leporacanthicus, bryanpkc, arnamoy10, Chuanfeng. peixin added projects: LLVM, clang. Herald added subscribers: guansong, yaxunl. peixin requested review of this revision. Herald added subscribers: cfe-commits, sstefan1.
For the ordered construct with the simd clause, the outlined region cannot be inlined. Otherwise, there may be unexpected behavior when the captured statements are vectorized. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D109321 Files: clang/lib/CodeGen/CGStmtOpenMP.cpp Index: clang/lib/CodeGen/CGStmtOpenMP.cpp =================================================================== --- clang/lib/CodeGen/CGStmtOpenMP.cpp +++ clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -5362,8 +5362,8 @@ CGF.CapturedStmtInfo = &CapStmtInfo; llvm::Function *Fn = CGF.GenerateOpenMPCapturedStmtFunction(*S, Loc); Fn->setDoesNotRecurse(); - if (CGM.getCodeGenOpts().OptimizationLevel != 0) - Fn->addFnAttr(llvm::Attribute::AlwaysInline); + Fn->removeFnAttr(llvm::Attribute::AlwaysInline); + Fn->addFnAttr(llvm::Attribute::NoInline); return Fn; }
Index: clang/lib/CodeGen/CGStmtOpenMP.cpp =================================================================== --- clang/lib/CodeGen/CGStmtOpenMP.cpp +++ clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -5362,8 +5362,8 @@ CGF.CapturedStmtInfo = &CapStmtInfo; llvm::Function *Fn = CGF.GenerateOpenMPCapturedStmtFunction(*S, Loc); Fn->setDoesNotRecurse(); - if (CGM.getCodeGenOpts().OptimizationLevel != 0) - Fn->addFnAttr(llvm::Attribute::AlwaysInline); + Fn->removeFnAttr(llvm::Attribute::AlwaysInline); + Fn->addFnAttr(llvm::Attribute::NoInline); return Fn; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits