pdhaliwal updated this revision to Diff 377502.
pdhaliwal added a comment.

Only removing optnone.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111218/new/

https://reviews.llvm.org/D111218

Files:
  clang/lib/CodeGen/CGStmtOpenMP.cpp


Index: clang/lib/CodeGen/CGStmtOpenMP.cpp
===================================================================
--- clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -503,6 +503,11 @@
     F->setDoesNotThrow();
   F->setDoesNotRecurse();
 
+  // TODO: should not need this once amdgcn handles function pointers properly.
+  if (CGM.getTriple().isAMDGCN()) {
+    F->removeFnAttr(llvm::Attribute::OptimizeNone);
+  }
+
   // Generate the function.
   CGF.StartFunction(CD, Ctx.VoidTy, F, FuncInfo, Args, Loc, Loc);
   Address ContextAddr = CGF.GetAddrOfLocalVar(CD->getContextParam());
@@ -665,8 +670,14 @@
   F->setDoesNotRecurse();
 
   // Always inline the outlined function if optimizations are enabled.
-  if (CGM.getCodeGenOpts().OptimizationLevel != 0)
+  if (CGM.getCodeGenOpts().OptimizationLevel != 0) {
     F->addFnAttr(llvm::Attribute::AlwaysInline);
+  }
+
+  // TODO: remove this once amdgcn handles function pointers properly.
+  if (CGM.getTriple().isAMDGCN()) {
+    F->removeFnAttr(llvm::Attribute::OptimizeNone);
+  }
 
   // Generate the function.
   CGF.StartFunction(CD, Ctx.VoidTy, F, FuncInfo, TargetArgs,


Index: clang/lib/CodeGen/CGStmtOpenMP.cpp
===================================================================
--- clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -503,6 +503,11 @@
     F->setDoesNotThrow();
   F->setDoesNotRecurse();
 
+  // TODO: should not need this once amdgcn handles function pointers properly.
+  if (CGM.getTriple().isAMDGCN()) {
+    F->removeFnAttr(llvm::Attribute::OptimizeNone);
+  }
+
   // Generate the function.
   CGF.StartFunction(CD, Ctx.VoidTy, F, FuncInfo, Args, Loc, Loc);
   Address ContextAddr = CGF.GetAddrOfLocalVar(CD->getContextParam());
@@ -665,8 +670,14 @@
   F->setDoesNotRecurse();
 
   // Always inline the outlined function if optimizations are enabled.
-  if (CGM.getCodeGenOpts().OptimizationLevel != 0)
+  if (CGM.getCodeGenOpts().OptimizationLevel != 0) {
     F->addFnAttr(llvm::Attribute::AlwaysInline);
+  }
+
+  // TODO: remove this once amdgcn handles function pointers properly.
+  if (CGM.getTriple().isAMDGCN()) {
+    F->removeFnAttr(llvm::Attribute::OptimizeNone);
+  }
 
   // Generate the function.
   CGF.StartFunction(CD, Ctx.VoidTy, F, FuncInfo, TargetArgs,
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to