r263394 - Remove compile time PreserveName in favor of a runtime cc1 -discard-value-names option

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 14 01:21:32 PDT 2016


Hi Mehdi,

Just letting you know that I committed a bit of a workaround for
-fsanitize-memory-track-origins after this, the backend instrumentation
pass was depending on the name of the alloca as a way of getting the name
of the variable. I figured though that reverting was probably a bit
overkill here so I added the workaround in r263412 and am letting Evgeniy
and Kostya know :)

-eric


On Sun, Mar 13, 2016 at 2:10 PM Mehdi Amini via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: mehdi_amini
> Date: Sun Mar 13 16:05:23 2016
> New Revision: 263394
>
> URL: http://llvm.org/viewvc/llvm-project?rev=263394&view=rev
> Log:
> Remove compile time PreserveName in favor of a runtime cc1
> -discard-value-names option
>
> Summary:
> This flag is enabled by default in the driver when NDEBUG is set. It
> is forwarded on the LLVMContext to discard all value names (but
> GlobalValue) for performance purpose.
>
> This an improved version of D18024
>
> Reviewers: echristo, chandlerc
>
> Subscribers: cfe-commits
>
> Differential Revision: http://reviews.llvm.org/D18127
>
> From: Mehdi Amini <mehdi.amini at apple.com>
>
> Added:
>     cfe/trunk/test/CodeGenCXX/discard-name-values.cpp
> Modified:
>     cfe/trunk/include/clang/Driver/CC1Options.td
>     cfe/trunk/include/clang/Frontend/CodeGenOptions.def
>     cfe/trunk/lib/CodeGen/CGBuilder.h
>     cfe/trunk/lib/CodeGen/CGCall.cpp
>     cfe/trunk/lib/CodeGen/CGExpr.cpp
>     cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
>     cfe/trunk/lib/CodeGen/ModuleBuilder.cpp
>     cfe/trunk/lib/Driver/Tools.cpp
>     cfe/trunk/lib/Frontend/CompilerInvocation.cpp
>     cfe/trunk/test/CodeGen/mips-byval-arg.c
>     cfe/trunk/test/CodeGen/mips-vector-arg.c
>     cfe/trunk/test/CodeGen/mips-zero-sized-struct.c
>     cfe/trunk/test/CodeGen/mips64-class-return.cpp
>     cfe/trunk/test/CodeGen/mips64-padding-arg.c
>     cfe/trunk/test/CodeGenCXX/debug-info-class.cpp
>     cfe/trunk/test/CodeGenCXX/stack-reuse.cpp
>
> Modified: cfe/trunk/include/clang/Driver/CC1Options.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Driver/CC1Options.td (original)
> +++ cfe/trunk/include/clang/Driver/CC1Options.td Sun Mar 13 16:05:23 2016
> @@ -367,6 +367,8 @@ def code_completion_brief_comments : Fla
>    HelpText<"Include brief documentation comments in code-completion
> results.">;
>  def disable_free : Flag<["-"], "disable-free">,
>    HelpText<"Disable freeing of memory on exit">;
> +def discard_value_names : Flag<["-"], "discard-value-names">,
> +  HelpText<"Discard value names in LLVM IR">;
>  def load : Separate<["-"], "load">, MetaVarName<"<dsopath>">,
>    HelpText<"Load the named plugin (dynamic shared object)">;
>  def plugin : Separate<["-"], "plugin">, MetaVarName<"<name>">,
>
> Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original)
> +++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Sun Mar 13
> 16:05:23 2016
> @@ -43,6 +43,7 @@ CODEGENOPT(DataSections      , 1, 0) ///
>  CODEGENOPT(UniqueSectionNames, 1, 1) ///< Set for -funique-section-names.
>  CODEGENOPT(DisableFPElim     , 1, 0) ///< Set when -fomit-frame-pointer
> is enabled.
>  CODEGENOPT(DisableFree       , 1, 0) ///< Don't free memory.
> +CODEGENOPT(DiscardValueNames , 1, 0) ///< Discard Value Names from the IR
> (LLVMContext flag)
>  CODEGENOPT(DisableGCov       , 1, 0) ///< Don't run the GCov pass, for
> testing.
>  CODEGENOPT(DisableLLVMOpts   , 1, 0) ///< Don't run any optimizations,
> for use in
>                                       ///< getting .bc files that
> correspond to the
>
> Modified: cfe/trunk/lib/CodeGen/CGBuilder.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuilder.h?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGBuilder.h (original)
> +++ cfe/trunk/lib/CodeGen/CGBuilder.h Sun Mar 13 16:05:23 2016
> @@ -23,9 +23,7 @@ class CodeGenFunction;
>  /// \brief This is an IRBuilder insertion helper that forwards to
>  /// CodeGenFunction::InsertHelper, which adds necessary metadata to
>  /// instructions.
> -template <bool PreserveNames>
> -class CGBuilderInserter
> -    : protected llvm::IRBuilderDefaultInserter<PreserveNames> {
> +class CGBuilderInserter : protected llvm::IRBuilderDefaultInserter {
>  public:
>    CGBuilderInserter() = default;
>    explicit CGBuilderInserter(CodeGenFunction *CGF) : CGF(CGF) {}
> @@ -39,17 +37,10 @@ private:
>    CodeGenFunction *CGF = nullptr;
>  };
>
> -// Don't preserve names on values in an optimized build.
> -#ifdef NDEBUG
> -#define PreserveNames false
> -#else
> -#define PreserveNames true
> -#endif
> +typedef CGBuilderInserter CGBuilderInserterTy;
>
> -typedef CGBuilderInserter<PreserveNames> CGBuilderInserterTy;
> -
> -typedef llvm::IRBuilder<PreserveNames, llvm::ConstantFolder,
> -                        CGBuilderInserterTy> CGBuilderBaseTy;
> +typedef llvm::IRBuilder<llvm::ConstantFolder, CGBuilderInserterTy>
> +    CGBuilderBaseTy;
>
>  class CGBuilderTy : public CGBuilderBaseTy {
>    /// Storing a reference to the type cache here makes it a lot easier
> @@ -305,8 +296,6 @@ public:
>    }
>  };
>
> -#undef PreserveNames
> -
>  }  // end namespace CodeGen
>  }  // end namespace clang
>
>
> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Sun Mar 13 16:05:23 2016
> @@ -3840,7 +3840,7 @@ RValue CodeGenFunction::EmitCall(const C
>    }
>
>    llvm::Instruction *CI = CS.getInstruction();
> -  if (Builder.isNamePreserving() && !CI->getType()->isVoidTy())
> +  if (!CI->getType()->isVoidTy())
>      CI->setName("call");
>
>    // Emit any writebacks immediately.  Arguably this should happen
>
> Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sun Mar 13 16:05:23 2016
> @@ -66,8 +66,6 @@ Address CodeGenFunction::CreateTempAlloc
>  /// block.
>  llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,
>                                                      const Twine &Name) {
> -  if (!Builder.isNamePreserving())
> -    return new llvm::AllocaInst(Ty, nullptr, "", AllocaInsertPt);
>    return new llvm::AllocaInst(Ty, nullptr, Name, AllocaInsertPt);
>  }
>
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Sun Mar 13 16:05:23 2016
> @@ -747,9 +747,7 @@ void CodeGenFunction::StartFunction(Glob
>    // later.  Don't create this with the builder, because we don't want it
>    // folded.
>    llvm::Value *Undef = llvm::UndefValue::get(Int32Ty);
> -  AllocaInsertPt = new llvm::BitCastInst(Undef, Int32Ty, "", EntryBB);
> -  if (Builder.isNamePreserving())
> -    AllocaInsertPt->setName("allocapt");
> +  AllocaInsertPt = new llvm::BitCastInst(Undef, Int32Ty, "allocapt",
> EntryBB);
>
>    ReturnBlock = getJumpDestInCurrentScope("return");
>
> @@ -1862,26 +1860,14 @@ void CodeGenFunction::InsertHelper(llvm:
>      CGM.getSanitizerMetadata()->disableSanitizerForInstruction(I);
>  }
>
> -template <bool PreserveNames>
> -void CGBuilderInserter<PreserveNames>::InsertHelper(
> +void CGBuilderInserter::InsertHelper(
>      llvm::Instruction *I, const llvm::Twine &Name, llvm::BasicBlock *BB,
>      llvm::BasicBlock::iterator InsertPt) const {
> -  llvm::IRBuilderDefaultInserter<PreserveNames>::InsertHelper(I, Name, BB,
> -                                                              InsertPt);
> +  llvm::IRBuilderDefaultInserter::InsertHelper(I, Name, BB, InsertPt);
>    if (CGF)
>      CGF->InsertHelper(I, Name, BB, InsertPt);
>  }
>
> -#ifdef NDEBUG
> -#define PreserveNames false
> -#else
> -#define PreserveNames true
> -#endif
> -template void CGBuilderInserter<PreserveNames>::InsertHelper(
> -    llvm::Instruction *I, const llvm::Twine &Name, llvm::BasicBlock *BB,
> -    llvm::BasicBlock::iterator InsertPt) const;
> -#undef PreserveNames
> -
>  static bool hasRequiredFeatures(const SmallVectorImpl<StringRef>
> &ReqFeatures,
>                                  CodeGenModule &CGM, const FunctionDecl
> *FD,
>                                  std::string &FirstMissing) {
>
> Modified: cfe/trunk/lib/CodeGen/ModuleBuilder.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ModuleBuilder.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/ModuleBuilder.cpp (original)
> +++ cfe/trunk/lib/CodeGen/ModuleBuilder.cpp Sun Mar 13 16:05:23 2016
> @@ -64,8 +64,9 @@ namespace {
>                        CoverageSourceInfo *CoverageInfo = nullptr)
>          : Diags(diags), Ctx(nullptr), HeaderSearchOpts(HSO),
>            PreprocessorOpts(PPO), CodeGenOpts(CGO),
> HandlingTopLevelDecls(0),
> -          CoverageInfo(CoverageInfo),
> -          M(new llvm::Module(ModuleName, C)) {}
> +          CoverageInfo(CoverageInfo), M(new llvm::Module(ModuleName, C)) {
> +      C.setDiscardValueNames(CGO.DiscardValueNames);
> +    }
>
>      ~CodeGeneratorImpl() override {
>        // There should normally not be any leftover inline method
> definitions.
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Sun Mar 13 16:05:23 2016
> @@ -3712,6 +3712,8 @@ void Clang::ConstructJob(Compilation &C,
>  // Disable the verification pass in -asserts builds.
>  #ifdef NDEBUG
>    CmdArgs.push_back("-disable-llvm-verifier");
> +  // Discard LLVM value names in -asserts builds.
> +  CmdArgs.push_back("-discard-value-names");
>  #endif
>
>    // Set the main file name, so that debug info works even with
>
> Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
> +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Sun Mar 13 16:05:23 2016
> @@ -541,6 +541,7 @@ static bool ParseCodeGenArgs(CodeGenOpti
>    Opts.DisableFPElim =
>        (Args.hasArg(OPT_mdisable_fp_elim) || Args.hasArg(OPT_pg));
>    Opts.DisableFree = Args.hasArg(OPT_disable_free);
> +  Opts.DiscardValueNames = Args.hasArg(OPT_discard_value_names);
>    Opts.DisableTailCalls = Args.hasArg(OPT_mdisable_tail_calls);
>    Opts.FloatABI = Args.getLastArgValue(OPT_mfloat_abi);
>    if (Arg *A = Args.getLastArg(OPT_meabi)) {
>
> Modified: cfe/trunk/test/CodeGen/mips-byval-arg.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mips-byval-arg.c?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/mips-byval-arg.c (original)
> +++ cfe/trunk/test/CodeGen/mips-byval-arg.c Sun Mar 13 16:05:23 2016
> @@ -1,5 +1,5 @@
> -// RUN: %clang -target mipsel-unknown-linux -O3 -S -o - -emit-llvm %s |
> FileCheck %s -check-prefix=O32
> -// RUN: %clang -target mips64el-unknown-linux -O3 -S -mabi=n64 -o -
> -emit-llvm %s | FileCheck %s -check-prefix=N64
> +// RUN: %clang_cc1 -triple mipsel-unknown-linux -O3 -S -o - -emit-llvm %s
> | FileCheck %s -check-prefix=O32
> +// RUN: %clang_cc1 -triple mips64el-unknown-linux -O3 -S -target-abi n64
> -o - -emit-llvm %s | FileCheck %s -check-prefix=N64
>
>  typedef struct {
>    float f[3];
>
> Modified: cfe/trunk/test/CodeGen/mips-vector-arg.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mips-vector-arg.c?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/mips-vector-arg.c (original)
> +++ cfe/trunk/test/CodeGen/mips-vector-arg.c Sun Mar 13 16:05:23 2016
> @@ -1,5 +1,5 @@
> -// RUN: %clang -target mipsel-unknown-linux -O3 -S -o - -emit-llvm %s |
> FileCheck %s -check-prefix=O32
> -// RUN: %clang -target mips64el-unknown-linux -O3 -S -mabi=n64 -o -
> -emit-llvm %s | FileCheck %s -check-prefix=N64
> +// RUN: %clang_cc1 -triple mipsel-unknown-linux -O3 -S -o - -emit-llvm %s
> | FileCheck %s -check-prefix=O32
> +// RUN: %clang_cc1 -triple mips64el-unknown-linux -O3 -S -target-abi n64
> -o - -emit-llvm %s | FileCheck %s -check-prefix=N64
>
>  // check that
>  // 1. vector arguments are passed in integer registers
>
> Modified: cfe/trunk/test/CodeGen/mips-zero-sized-struct.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mips-zero-sized-struct.c?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/mips-zero-sized-struct.c (original)
> +++ cfe/trunk/test/CodeGen/mips-zero-sized-struct.c Sun Mar 13 16:05:23
> 2016
> @@ -1,9 +1,9 @@
> -// RUN: %clang -target mips-unknown-linux-gnu -S -emit-llvm -o - %s |
> FileCheck -check-prefix=O32 %s
> -// RUN: %clang -target mipsel-unknown-linux-gnu -S -emit-llvm -o - %s |
> FileCheck -check-prefix=O32 %s
> -// RUN: %clang -target mips64-unknown-linux-gnu -S -emit-llvm -o - %s
> -mabi=n32 | FileCheck -check-prefix=N32 %s
> -// RUN: %clang -target mips64el-unknown-linux-gnu -S -emit-llvm -o - %s
> -mabi=n32 | FileCheck -check-prefix=N32 %s
> -// RUN: %clang -target mips64-unknown-linux-gnu -S -emit-llvm -o - %s |
> FileCheck -check-prefix=N64 %s
> -// RUN: %clang -target mips64el-unknown-linux-gnu -S -emit-llvm -o - %s |
> FileCheck -check-prefix=N64 %s
> +// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -S -emit-llvm -o - %s |
> FileCheck -check-prefix=O32 %s
> +// RUN: %clang_cc1 -triple mipsel-unknown-linux-gnu -S -emit-llvm -o - %s
> | FileCheck -check-prefix=O32 %s
> +// RUN: %clang_cc1 -triple mips64-unknown-linux-gnu -S -emit-llvm -o -
> %s  -target-abi n32 | FileCheck -check-prefix=N32 %s
> +// RUN: %clang_cc1 -triple mips64el-unknown-linux-gnu -S -emit-llvm -o -
> %s  -target-abi n32 | FileCheck -check-prefix=N32 %s
> +// RUN: %clang_cc1 -triple mips64-unknown-linux-gnu -S -emit-llvm -o - %s
> | FileCheck -check-prefix=N64 %s
> +// RUN: %clang_cc1 -triple mips64el-unknown-linux-gnu -S -emit-llvm -o -
> %s | FileCheck -check-prefix=N64 %s
>
>  // O32: define void @fn28(%struct.T2* noalias sret %agg.result, i8
> signext %arg0)
>  // N32: define void @fn28(i8 signext %arg0)
>
> Modified: cfe/trunk/test/CodeGen/mips64-class-return.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mips64-class-return.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/mips64-class-return.cpp (original)
> +++ cfe/trunk/test/CodeGen/mips64-class-return.cpp Sun Mar 13 16:05:23 2016
> @@ -1,4 +1,4 @@
> -// RUN: %clang -target mips64el-unknown-linux -O3 -S -mabi=n64 -o -
> -emit-llvm %s | FileCheck %s
> +// RUN: %clang_cc1 -triple mips64el-unknown-linux -O3 -S -target-abi n64
> -o - -emit-llvm %s | FileCheck %s
>
>  class B0 {
>    double d;
>
> Modified: cfe/trunk/test/CodeGen/mips64-padding-arg.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mips64-padding-arg.c?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/mips64-padding-arg.c (original)
> +++ cfe/trunk/test/CodeGen/mips64-padding-arg.c Sun Mar 13 16:05:23 2016
> @@ -1,6 +1,6 @@
> -// RUN: %clang -target mipsel-unknown-linux -O3 -S -o - -emit-llvm %s |
> FileCheck %s -check-prefix=O32
> -// RUN: %clang -target mips64el-unknown-linux -O3 -S -mabi=n64 -o -
> -emit-llvm %s | FileCheck %s -check-prefix=N64
> -// RUN: %clang -target mipsel-unknown-linux -mfp64 -O3 -S -o - -emit-llvm
> %s | FileCheck %s -check-prefix=O32
> +// RUN: %clang_cc1 -triple mipsel-unknown-linux -O3 -S -o - -emit-llvm %s
> | FileCheck %s -check-prefix=O32
> +// RUN: %clang_cc1 -triple mips64el-unknown-linux -O3 -S -target-abi n64
> -o - -emit-llvm %s | FileCheck %s -check-prefix=N64
> +// RUN: %clang_cc1 -triple mipsel-unknown-linux -target-feature "+fp64"
> -O3 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=O32
>
>  typedef struct {
>    double d;
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info-class.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info-class.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info-class.cpp Sun Mar 13 16:05:23 2016
> @@ -83,9 +83,9 @@ int main(int argc, char **argv) {
>    return 0;
>  }
>
> -// RUN: %clang -target x86_64-unknown_unknown -emit-llvm -g -S %s -o - |
> FileCheck %s
> -// RUN: %clang -target i686-cygwin -emit-llvm -g -S %s -o - | FileCheck %s
> -// RUN: %clang -target armv7l-unknown-linux-gnueabihf -emit-llvm -g -S %s
> -o - | FileCheck %s
> +// RUN: %clang_cc1 -triple x86_64-unknown_unknown -emit-llvm
> -debug-info-kind=limited -fexceptions %s -o - | FileCheck %s
> +// RUN: %clang_cc1 -triple i686-cygwin -emit-llvm
> -debug-info-kind=limited -fexceptions %s -o - | FileCheck %s
> +// RUN: %clang_cc1 -triple armv7l-unknown-linux-gnueabihf -emit-llvm
> -debug-info-kind=limited -fexceptions %s -o - | FileCheck %s
>
>  // CHECK: invoke {{.+}} @_ZN1BD1Ev(%class.B* %b)
>  // CHECK-NEXT: unwind label %{{.+}}, !dbg ![[EXCEPTLOC:.*]]
>
> Added: cfe/trunk/test/CodeGenCXX/discard-name-values.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/discard-name-values.cpp?rev=263394&view=auto
>
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/discard-name-values.cpp (added)
> +++ cfe/trunk/test/CodeGenCXX/discard-name-values.cpp Sun Mar 13 16:05:23
> 2016
> @@ -0,0 +1,10 @@
> +// RUN: %clang_cc1 -emit-llvm  -triple=armv7-apple-darwin -emit-llvm
> -std=c++11 %s -o - -O1 | FileCheck %s
> +// RUN: %clang_cc1 -emit-llvm  -triple=armv7-apple-darwin -emit-llvm
> -std=c++11 %s -o - -O1 -discard-value-names | FileCheck %s
> --check-prefix=DISCARDVALUE
> +
> +int foo(int bar) {
> +  return bar;
> +}
> +
> +// CHECK: ret i32 %bar
> +// DISCARDVALUE: ret i32 %0
> +
>
> Modified: cfe/trunk/test/CodeGenCXX/stack-reuse.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/stack-reuse.cpp?rev=263394&r1=263393&r2=263394&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/stack-reuse.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/stack-reuse.cpp Sun Mar 13 16:05:23 2016
> @@ -1,4 +1,4 @@
> -// RUN: %clang -target armv7l-unknown-linux-gnueabihf -S %s -o -
> -emit-llvm -O1 -disable-llvm-optzns | FileCheck %s
> +// RUN: %clang_cc1 -triple armv7-unknown-linux-gnueabihf %s -o -
> -emit-llvm -O1 | FileCheck %s
>
>  // Stack should be reused when possible, no need to allocate two separate
> slots
>  // if they have disjoint lifetime.
> @@ -21,7 +21,7 @@ struct Combiner {
>    S_large a, b;
>
>    Combiner(S_large);
> -  Combiner f();
> +  Combiner f();
>  };
>
>  extern S_small foo_small();
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160314/bc41d41b/attachment-0001.html>


More information about the cfe-commits mailing list