[llvm-commits] [dragonegg] r146650 - in /dragonegg/trunk: include/x86/dragonegg/Target.h src/Backend.cpp
Duncan Sands
baldrick at free.fr
Thu Dec 15 02:44:19 PST 2011
Author: baldrick
Date: Thu Dec 15 04:44:19 2011
New Revision: 146650
URL: http://llvm.org/viewvc/llvm-project?rev=146650&view=rev
Log:
The --disable-non-leaf-fp-elim option was eliminated and now needs
to be set in TargetOptions.
Modified:
dragonegg/trunk/include/x86/dragonegg/Target.h
dragonegg/trunk/src/Backend.cpp
Modified: dragonegg/trunk/include/x86/dragonegg/Target.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/x86/dragonegg/Target.h?rev=146650&r1=146649&r2=146650&view=diff
==============================================================================
--- dragonegg/trunk/include/x86/dragonegg/Target.h (original)
+++ dragonegg/trunk/include/x86/dragonegg/Target.h Thu Dec 15 04:44:19 2011
@@ -419,11 +419,16 @@
#define LLVM_SET_MACHINE_OPTIONS(argvec) \
do { \
- if (TARGET_OMIT_LEAF_FRAME_POINTER) \
- argvec.push_back("--disable-non-leaf-fp-elim"); \
- \
if (ix86_force_align_arg_pointer) \
argvec.push_back("-force-align-stack"); \
} while (0)
+#define LLVM_SET_TARGET_MACHINE_OPTIONS(O) \
+ do { \
+ if (TARGET_OMIT_LEAF_FRAME_POINTER) { \
+ O.NoFramePointerElim = false; \
+ O.NoFramePointerElimNonLeaf = true; \
+ } \
+ } while (0)
+
#endif /* DRAGONEGG_TARGET_H */
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=146650&r1=146649&r2=146650&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Thu Dec 15 04:44:19 2011
@@ -415,19 +415,35 @@
#endif
TargetOptions Options;
+ if (flag_omit_frame_pointer) {
+ // Eliminate frame pointers everywhere.
+ Options.NoFramePointerElim = false;
+ Options.NoFramePointerElimNonLeaf = false;
+ } else {
+ // Keep frame pointers everywhere.
+ Options.NoFramePointerElim = true;
+ Options.NoFramePointerElimNonLeaf = true;
+ }
+ // If a target has an option to eliminate frame pointers in leaf functions
+ // only then it should set
+ // NoFramePointerElim = false;
+ // NoFramePointerElimNonLeaf = true;
+ // in its LLVM_SET_TARGET_MACHINE_OPTIONS method when this option is true.
Options.UnsafeFPMath =
#if (GCC_MINOR > 5)
fast_math_flags_set_p(&global_options);
#else
fast_math_flags_set_p();
#endif
- Options.NoNaNsFPMath = flag_finite_math_only;
Options.NoInfsFPMath = flag_finite_math_only;
- Options.NoFramePointerElim = !flag_omit_frame_pointer;
+ Options.NoNaNsFPMath = flag_finite_math_only;
Options.NoZerosInBSS = !flag_zero_initialized_in_bss;
#if (GCC_MINOR > 5)
Options.EnableSegmentedStacks = flag_split_stack;
#endif
+#ifdef LLVM_SET_TARGET_MACHINE_OPTIONS
+ LLVM_SET_TARGET_MACHINE_OPTIONS(Options);
+#endif
TheTarget = TME->createTargetMachine(TargetTriple, CPU, FeatureStr, Options,
RelocModel, CMModel, CodeGenOptLevel());
assert(TheTarget->getTargetData()->isBigEndian() == BYTES_BIG_ENDIAN);
More information about the llvm-commits
mailing list