The change allows clang -mno-omit-leaf-frame-pointer to disable frame
pointer elimination. This behavior matches X86 and Mips, and also GCC
AArch64.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 42062 Build 42428: arc lint + arc unit
Event Timeline
Fix machine-outliner-regsave.mir. Touch %lr to fix the following -verify-machineinstrs issue
*** Bad machine code: Using an undefined physical register *** - function: bar - basic block: %bb.0 (0x1325e00) - instruction: early-clobber $sp = STRXpre $lr, $sp(tied-def 0), -16 - operand 1: $lr
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | ||
---|---|---|
247 | MFI.hasCalls() was returning here false, Even for function who has call inside. May be because it is called earlier,before generating Full frame Info . It needs to be removed from here. I could that it is done. |
LGTM
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | ||
---|---|---|
247 | Isn't TargetOptions::DisableFramePointerElim itself calling hasCalls()? I guess we conservatively return true anyway if the frame info isn't computed yet, though, so probably doesn't matter. |
Ping:)
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | ||
---|---|---|
247 | TargetOptions::DisableFramePointerElim doesn't call hasCalls(). Deleting hasCalls() will make -frame-pointer=[non-leaf|all] different. |
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | ||
---|---|---|
247 |
|
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | ||
---|---|---|
247 | Thanks for the pointer. It looks there are other cleanup opportunities in TargetOptions::DisableFramePointerElim. |
This breaks tests on the "expensive tests" bot: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/514
Please take a look!
Looking. Where can I find the cmake configuration?
Mine (-DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_EXPENSIVE_CHECKS=On) does not build for other reasons:
.../llvm/include/llvm/ADT/PointerUnion.h:93:26: error: constexpr variable 'NumLowBitsAvailable' must be initialized by a constant expression static constexpr int NumLowBitsAvailable = lowBitsAvailable<PTs...>();
I find the configuration in https://github.com/llvm/llvm-zorg/blob/master/buildbot/osuosl/master/config/builders.py and reproduce with cmake -GNinja -Hllvm -BExpensive -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_EXPENSIVE_CHECKS=On -DLLVM_ENABLE_WERROR=Off -DCMAKE_CXX_FLAGS=-U_GLIBCXX_DEBUG
MFI.hasCalls() was returning here false, Even for function who has call inside. May be because it is called earlier,before generating Full frame Info . It needs to be removed from here. I could that it is done.