diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-01-11 21:20:45 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-01-11 21:20:45 +0000 |
commit | 876279a512321c921675c693200c45a2c068f087 (patch) | |
tree | 5b1c0822afade94a7522d724d9139e76339e211f | |
parent | 2688dadae93afe31dc6e5c0f64652a13f7b8edc3 (diff) |
- Clean up.
- Added DISABLE_LTO option to disable link time optimization. If this is not
set, each file is compiled with -O0 and optimization is performed with
opt -std-compile-opts and llvm-ld. If it is set, each file is compiled with
-O3 (same as gcc, g++) and -disable-inlining and -disable-opt are passed to
opt and llvm-ld. This is useful for performance comparison and finding ABI
problems.
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@45883 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | External/SPEC/Makefile.spec | 4 | ||||
-rw-r--r-- | Makefile.programs | 2 | ||||
-rw-r--r-- | Makefile.rules | 5 | ||||
-rw-r--r-- | Makefile.tests | 28 | ||||
-rw-r--r-- | MultiSource/Makefile.multisrc | 9 | ||||
-rw-r--r-- | SingleSource/Makefile.singlesrc | 4 | ||||
-rw-r--r-- | TEST.nightly.Makefile | 1 |
7 files changed, 33 insertions, 20 deletions
diff --git a/External/SPEC/Makefile.spec b/External/SPEC/Makefile.spec index 072f076a..e3398daa 100644 --- a/External/SPEC/Makefile.spec +++ b/External/SPEC/Makefile.spec @@ -7,10 +7,6 @@ include $(LEVEL)/MultiSource/Makefile.multisrc -# Do not pass -Wall to compile commands... -LCCFLAGS := -O3 -LCXXFLAGS := -O3 - CPPFLAGS += -I $(SPEC_BENCH_DIR)/src/ SPEC_SANDBOX := $(PROGDIR)/External/SPEC/Sandbox.sh diff --git a/Makefile.programs b/Makefile.programs index 15ad1c0a..4259e0e4 100644 --- a/Makefile.programs +++ b/Makefile.programs @@ -348,7 +348,7 @@ Output/%.cbe.c: Output/%.llvm.bc $(LLC) $(PROGRAMS_TO_TEST:%=Output/%.cbe): \ Output/%.cbe: Output/%.cbe.c - -$(CC) $< -o $@ $(LDFLAGS) $(CFLAGS) -fno-strict-aliasing -O2 -fno-inline $(TARGET_FLAGS) $(LIBS) + -$(CC) $< -o $@ $(LDFLAGS) $(CFLAGS) -fno-strict-aliasing -fno-inline $(TARGET_FLAGS) $(LIBS) # # Compile a linked program to machine code with LLC. diff --git a/Makefile.rules b/Makefile.rules index b1dd1a53..709bf0f0 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -350,6 +350,11 @@ ifdef SMALL_PROBLEM_SIZE CPPFLAGS += -DSMALL_PROBLEM_SIZE endif +ifdef DISABLE_LTO +EXTRA_LOPT_OPTIONS += -disable-opt -disable-inlining +EXTRA_LINKTIME_OPT_FLAGS += -disable-opt -disable-inlining +endif + # # Compile commands with libtool. # diff --git a/Makefile.tests b/Makefile.tests index d4439d8a..11a9e2c9 100644 --- a/Makefile.tests +++ b/Makefile.tests @@ -34,9 +34,23 @@ endif .PRECIOUS: Output/%.llvm.bc .PRECIOUS: Output/%.llvm -LCCFLAGS += -O2 -LCXXFLAGS += -O2 -LLCFLAGS = +ifndef CFLAGS +CFLAGS = -O3 +endif +ifndef CXXFLAGS +CXXFLAGS = -O3 +endif + +# If LTO is on, compile each .c .cpp file with -O0 and optimize with +# opt and llvm-ld. +ifndef DISABLE_LTO +LCCFLAGS := -O0 $(CPPFLAGS) +LCXXFLAGS := -O0 $(CPPFLAGS) +else +LCCFLAGS := $(CFLAGS) $(CPPFLAGS) +LCXXFLAGS := $(CXXFLAGS) $(CPPFLAGS) +endif + FAILURE = $(LLVM_SRC_ROOT)/test/Failure.sh LLCLIBS := $(LLCLIBS) -lm @@ -46,22 +60,22 @@ clean:: # Compile from X.c to Output/X.ll Output/%.bc: %.c $(LCC1) Output/.dir $(INCLUDES) - -$(LLVMGCC) $(CPPFLAGS) $(LCCFLAGS) $(TARGET_FLAGS) -O0 -c $< -o $@ -emit-llvm + -$(LLVMGCC) $(CPPFLAGS) $(LCCFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm -$(call UPGRADE_LL,$@) # Compile from X.cpp to Output/X.ll Output/%.bc: %.cpp $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -O0 -c $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm -$(call UPGRADE_LL,$@) # Compile from X.cc to Output/X.ll Output/%.bc: %.cc $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -O0 -c $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm -$(call UPGRADE_LL,$@) # Compile from X.C to Output/X.ll Output/%.bc: %.C $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -O0 -c $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm -$(call UPGRADE_LL,$@) # LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from diff --git a/MultiSource/Makefile.multisrc b/MultiSource/Makefile.multisrc index b2841220..a20b73a4 100644 --- a/MultiSource/Makefile.multisrc +++ b/MultiSource/Makefile.multisrc @@ -10,7 +10,6 @@ # ##===----------------------------------------------------------------------===## -LCCFLAGS := $(CFLAGS) $(CPPFLAGS) PROGRAMS_TO_TEST := $(PROG) ## LLVM bytecode libraries that must be linked with an application @@ -29,16 +28,16 @@ NObjects := $(addprefix Output/,$(NObjs)) .PRECIOUS: $(LObjects) $(NObjects) Output/%.o: %.c Output/.dir - -$(CC) $(CPPFLAGS) $(CFLAGS) -O2 $(TARGET_FLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.C Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_FLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.cpp Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_FLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.cc Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) -O2 $(TARGET_FLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ bugpoint-opt: Output/$(PROG).bugpoint-opt bugpoint-gccas: Output/$(PROG).bugpoint-opt diff --git a/SingleSource/Makefile.singlesrc b/SingleSource/Makefile.singlesrc index c7c0d326..84d62664 100644 --- a/SingleSource/Makefile.singlesrc +++ b/SingleSource/Makefile.singlesrc @@ -34,10 +34,10 @@ endif # FIXME: LIBS should be specified, not hardcoded to -lm Output/%.native: $(SourceDir)/%.c Output/.dir - -$(CC) -O2 $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) + -$(CC) $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) Output/%.native: $(SourceDir)/%.cpp Output/.dir - -$(CXX) -O2 $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) + -$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) bugpoint-gccas bugpoint-opt bugpoint-llvm-ld bugpoint-gccld bugpoint-jit bugpoint-llc bugpoint-llc-beta: diff --git a/TEST.nightly.Makefile b/TEST.nightly.Makefile index 4a82c477..bf37615a 100644 --- a/TEST.nightly.Makefile +++ b/TEST.nightly.Makefile @@ -8,7 +8,6 @@ CURDIR := $(shell cd .; pwd) PROGDIR := $(PROJ_SRC_ROOT) RELDIR := $(subst $(PROGDIR),,$(CURDIR)) -CFLAGS := -O3 REPORTS_TO_GEN := compile nat ifndef DISABLE_LLC |