[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:28:56 PST 2019


MaskRay created this revision.
MaskRay added reviewers: efriedma, rnk, thegameg, ychen.
Herald added subscribers: llvm-commits, hiraditya, krytarowski, arichardson, emaste.
Herald added a project: LLVM.

D56351 <https://reviews.llvm.org/D56351> (included in LLVM 8.0.0) introduced "frame-pointer".  All tests
which use "no-frame-pointer-elim" or "no-frame-pointer-elim-non-leaf"
have been migrated to use "frame-pointer".

Ignore the two obsoleted function attributes.

(I have patches to fix two downstream users: ldc and Julia (lightweight use in jit on Windows and FreeBSD)).


Repository:
  rG LLVM Github Monorepo

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,6 @@
 
   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();
-
-    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.235243.patch
Type: text/x-patch
Size: 1535 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191225/9a7f1d2b/attachment.bin>


More information about the llvm-commits mailing list