From e4a672483f44d961c7197612baa6522c2cf9d3cd Mon Sep 17 00:00:00 2001 From: Vsevolod Livinskiy Date: Fri, 22 Jan 2016 09:35:30 +0300 Subject: [PATCH] Add --no-omit-frame-pointer option --- ispc.cpp | 3 +++ ispc.h | 3 +++ main.cpp | 3 +++ module.cpp | 6 ++++++ 4 files changed, 15 insertions(+) diff --git a/ispc.cpp b/ispc.cpp index 224d8fbc..a0102fba 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -1025,6 +1025,8 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo if (g->opt.disableFMA == false) options.AllowFPOpFusion = llvm::FPOpFusion::Fast; #if ISPC_LLVM_VERSION <= ISPC_LLVM_3_6 + if (g->NoOmitFramePointer) + options.NoFramePointerElim = true; #ifdef ISPC_IS_WINDOWS if (strcmp("x86", arch) == 0) { // Workaround for issue #503 (LLVM issue 14646). @@ -1443,6 +1445,7 @@ Globals::Globals() { runCPP = true; debugPrint = false; printTarget = false; + NoOmitFramePointer = false; debugIR = -1; disableWarnings = false; warningsAsErrors = false; diff --git a/ispc.h b/ispc.h index 6231062a..87651b57 100644 --- a/ispc.h +++ b/ispc.h @@ -562,6 +562,9 @@ struct Globals { /** When \c true, target ISA will be printed during ispc's execution. */ bool printTarget; + /** When \c true, LLVM won't omit frame pointer. */ + bool NoOmitFramePointer; + /** Indicates which stages of optimization we want to dump. */ std::set debug_stages; diff --git a/main.cpp b/main.cpp index b52e713d..fd21e41c 100644 --- a/main.cpp +++ b/main.cpp @@ -143,6 +143,7 @@ devUsage(int ret) { printf("\nusage (developer options): ispc\n"); printf(" [--debug]\t\t\t\tPrint information useful for debugging ispc\n"); printf(" [--print-target]\t\t\tPrint target's information\n"); + printf(" [--no-omit-frame-pointer]\t\tDisable frame pointer omission. It may be useful for profiling\n"); printf(" [--fuzz-test]\t\t\tRandomly perturb program input to test error conditions\n"); printf(" [--fuzz-seed=]\t\tSeed value for RNG for fuzz testing\n"); printf(" [--opt=