[PATCH] D65037: push LR before mcount on ARM

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 20 01:22:11 PDT 2019


t.p.northover added a comment.

What a horrible function. AAPCS? Who cares about that?



================
Comment at: llvm/lib/Target/ARM/CMakeLists.txt:54
   ARMTargetTransformInfo.cpp
+  CustomCallLoweringPass.cpp
   MLxExpansionPass.cpp
----------------
This filename is too generic. It handles a single GNU-specific profiling function.


================
Comment at: llvm/lib/Target/ARM/CustomCallLoweringPass.cpp:1
+#include "ARM.h"
+#include "ARMBaseInstrInfo.h"
----------------
This needs a comment header, with the usual licensing info and a brief description of what this pass does.


================
Comment at: llvm/lib/Target/ARM/CustomCallLoweringPass.cpp:33
+                  const ARMBaseInstrInfo &TII = *ST.getInstrInfo();
+                  DebugLoc DL;
+                  if (ST.isThumb()) {
----------------
Can this be initialized from the call instruction?


================
Comment at: llvm/lib/Target/ARM/CustomCallLoweringPass.cpp:45
+                  }
+                  return true;
+                }
----------------
What happens if a function calling the counter gets inlined?

For pure stack correctness you probably need to ensure all calls to mcount get a push before them; the counts may be screwy but that's probably better than a segfault.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65037





More information about the llvm-commits mailing list