[PATCH] [PATCH] Stop resetting NoFramePointerElim in TargetMachine::resetTargetOptions

Akira Hatanaka ahatanak at gmail.com
Wed May 20 17:26:53 PDT 2015


I created a new patch which changes the backend to only look at function attribute "no-frame-pointer-elim" and disregard TargetOptions::NoFramePointerElim.

In the new patch, overrideFunctionAttributes is rewritten and renamed. The new function is called from LLVMCreateMCJITCompilerForModule and the tools (llc and opt) and it behaves differently based on where it is called:

- If it is called from the tools, it overwrites function attribute "no-frame-pointer-elim" only if the corresponding command line option "disable-fp-elim" was specified.

- If it is called from LLVMCreateMCJITCompilerForModule, it always writes the function attribute. This is necessary to preserve the behavior of this C API after changes are made in the backend. Note that I'm assuming function attribute "no-frame-pointer-elim" never appears in the module passed to this function as there are no C APIs that allow recording string function attributes as far as I can tell (see include/llvm-c/Core.h).

I also changed it to create and reset the function attribute set once per visited function rather than doing it many times.

I think this patch is better than my previous patch as it simplifies the backend. What do you think?


http://reviews.llvm.org/D9830

Files:
  include/llvm/CodeGen/CommandFlags.h
  include/llvm/IR/Function.h
  include/llvm/Target/TargetFrameLowering.h
  include/llvm/Target/TargetOptions.h
  lib/CodeGen/TargetFrameLoweringImpl.cpp
  lib/CodeGen/TargetOptionsImpl.cpp
  lib/ExecutionEngine/ExecutionEngineBindings.cpp
  lib/IR/Function.cpp
  lib/Target/ARM/ARMFastISel.cpp
  lib/Target/ARM/ARMFrameLowering.cpp
  lib/Target/ARM/ARMFrameLowering.h
  lib/Target/ARM/ARMSubtarget.cpp
  lib/Target/ARM/ARMSubtarget.h
  lib/Target/TargetMachine.cpp
  test/CodeGen/ARM/disable-fp-elim.ll
  test/CodeGen/X86/2014-08-29-CompactUnwind.ll
  tools/llc/llc.cpp
  tools/opt/opt.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9830.26197.patch
Type: text/x-patch
Size: 17825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150521/f9486dd1/attachment.bin>


More information about the llvm-commits mailing list