[PATCH] D71863: Ignore "no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" in favor of "frame-pointer"

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 18:38:02 PST 2019


MaskRay updated this revision to Diff 235244.
MaskRay added a comment.

+ if (!F.hasFnAttribute("frame-pointer"))
+   return false;

(Forgot to include them..


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71863

Files:
  llvm/docs/ReleaseNotes.rst
  llvm/lib/CodeGen/TargetOptionsImpl.cpp


Index: llvm/lib/CodeGen/TargetOptionsImpl.cpp
===================================================================
--- llvm/lib/CodeGen/TargetOptionsImpl.cpp
+++ llvm/lib/CodeGen/TargetOptionsImpl.cpp
@@ -28,20 +28,8 @@
 
   const Function &F = MF.getFunction();
 
-  // TODO: Remove support for old `fp elim` function attributes after fully
-  //       migrate to use "frame-pointer"
-  if (!F.hasFnAttribute("frame-pointer")) {
-    // Check to see if we should eliminate all frame pointers.
-    if (F.getFnAttribute("no-frame-pointer-elim").getValueAsString() == "true")
-      return true;
-
-    // Check to see if we should eliminate non-leaf frame pointers.
-    if (F.hasFnAttribute("no-frame-pointer-elim-non-leaf"))
-      return MF.getFrameInfo().hasCalls();
-
+  if (!F.hasFnAttribute("frame-pointer"))
     return false;
-  }
-
   StringRef FP = F.getFnAttribute("frame-pointer").getValueAsString();
   if (FP == "all")
     return true;
Index: llvm/docs/ReleaseNotes.rst
===================================================================
--- llvm/docs/ReleaseNotes.rst
+++ llvm/docs/ReleaseNotes.rst
@@ -93,6 +93,11 @@
 * ``Callbacks`` have been added to ``CommandLine Options``.  These can
   be used to validate of selectively enable other options.
 
+* The function attributes ``no-frame-pointer-elim`` and
+  ``no-frame-pointer-elim-non-leaf`` have been replaced by ``frame-pointer``,
+  which has 3 values: ``none``, ``non-leaf``, and ``all``. The values mean what
+  functions must retain frame pointers.
+
 Changes to the LLVM IR
 ----------------------
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71863.235244.patch
Type: text/x-patch
Size: 1578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191225/0e22409c/attachment.bin>


More information about the llvm-commits mailing list