Author: evancheng Date: Mon Jan 14 16:33:19 2008 New Revision: 45980 URL: http://llvm.org/viewvc/llvm-project?rev=45980&view=rev Log: More makefile changes to make it easier to override default optimization level. This also fixes errenous 252.eon CBE performance regression.
Modified: test-suite/trunk/External/SPEC/CINT2000/252.eon/Makefile test-suite/trunk/Makefile.programs test-suite/trunk/Makefile.rules test-suite/trunk/Makefile.tests test-suite/trunk/MultiSource/Applications/spiff/Makefile test-suite/trunk/MultiSource/Makefile.multisrc test-suite/trunk/SingleSource/Makefile.singlesrc Modified: test-suite/trunk/External/SPEC/CINT2000/252.eon/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CINT2000/252.eon/Makefile?rev=45980&r1=45979&r2=45980&view=diff ============================================================================== --- test-suite/trunk/External/SPEC/CINT2000/252.eon/Makefile (original) +++ test-suite/trunk/External/SPEC/CINT2000/252.eon/Makefile Mon Jan 14 16:33:19 2008 @@ -9,9 +9,6 @@ include $(LEVEL)/Makefile.config -# Yes, we know this is an old crufty C++ benchmark. Don't tell us about it GCC! -CFLAGS += -fno-exceptions -Wno-deprecated -Wno-non-template-friend - ifeq ($(ARCH),PowerPC) CPPFLAGS += -DFMAX_IS_DOUBLE endif @@ -64,6 +61,10 @@ mrSolidTexture.cc mrSphere.cc mrSurface.cc mrSurfaceTexture.cc \ mrXYRectangle.cc mrXZRectangle.cc mrYZRectangle.cc myrand.cc) include ../../Makefile.spec2000 + +# Yes, we know this is an old crufty C++ benchmark. Don't tell us about it GCC! +CXXFLAGS += -fno-exceptions -Wno-deprecated -Wno-non-template-friend + LDFLAGS = -lstdc++ -lm LIBS = -lstdc++ -lm Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=45980&r1=45979&r2=45980&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Mon Jan 14 16:33:19 2008 @@ -348,7 +348,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.cbe): \ Output/%.cbe: Output/%.cbe.c - -$(CC) $< -o $@ $(LDFLAGS) $(CFLAGS) -fno-strict-aliasing -fno-inline $(TARGET_FLAGS) $(LIBS) + -$(CC) $< -o $@ $(LDFLAGS) $(CFLAGS) $(OPTFLAGS) -fno-strict-aliasing -fno-inline $(TARGET_FLAGS) $(LIBS) # # Compile a linked program to machine code with LLC. Modified: test-suite/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.rules?rev=45980&r1=45979&r2=45980&view=diff ============================================================================== --- test-suite/trunk/Makefile.rules (original) +++ test-suite/trunk/Makefile.rules Mon Jan 14 16:33:19 2008 @@ -322,8 +322,19 @@ CPPFLAGS += -D_GNU_SOURCE # Pull in limit macros from stdint.h, even in C++: CPPFLAGS += -D__STDC_LIMIT_MACROS +CPPFLAGS += -DNDEBUG + +# Default optimization level: +OPTFLAGS := -O3 + +# If LTO is on, compile each .c .cpp file with -O0 and optimize with +# opt and llvm-ld. +ifdef DISABLE_LTO +LOPTFLAGS := $(OPTFLAGS) +else +LOPTFLAGS := -O0 +endif -CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions ifeq ($(OS),Darwin) ifndef TARGET_FLAGS @@ -358,18 +369,18 @@ # # Compile commands with libtool. # -Compile := $(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -CompileC := $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) +Compile := $(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) +CompileC := $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) # Compile a cpp file, don't link... CompileG := $(Compile) -g -D_DEBUG -CompileO := $(Compile) $(CompileOptimizeOpts) -felide-constructors -fomit-frame-pointer -CompileP := $(Compile) $(CompileOptimizeOpts) -felide-constructors $(PROFILE) +CompileO := $(Compile) $(OPTFLAGS) -felide-constructors -fomit-frame-pointer +CompileP := $(Compile) $(OPTFLAGS) -felide-constructors $(PROFILE) # Compile a c file, don't link... CompileCG := $(CompileC) -g -D_DEBUG -CompileCO := $(CompileC) $(CompileOptimizeOpts) -fomit-frame-pointer -CompileCP := $(CompileC) $(CompileOptimizeOpts) $(PROFILE) +CompileCO := $(CompileC) $(OPTFLAGS) -fomit-frame-pointer +CompileCP := $(CompileC) $(OPTFLAGS) $(PROFILE) ########################################################################### # Link Time Options Modified: test-suite/trunk/Makefile.tests URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.tests?rev=45980&r1=45979&r2=45980&view=diff ============================================================================== --- test-suite/trunk/Makefile.tests (original) +++ test-suite/trunk/Makefile.tests Mon Jan 14 16:33:19 2008 @@ -34,23 +34,6 @@ .PRECIOUS: Output/%.llvm.bc .PRECIOUS: Output/%.llvm -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 @@ -58,24 +41,24 @@ $(RM) -f a.out core $(RM) -rf Output/ -# Compile from X.c to Output/X.ll +# Compile from X.c to Output/X.bc Output/%.bc: %.c $(LCC1) Output/.dir $(INCLUDES) - -$(LLVMGCC) $(CPPFLAGS) $(LCCFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm + -$(LLVMGCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm -$(call UPGRADE_LL,$@) -# Compile from X.cpp to Output/X.ll +# Compile from X.cpp to Output/X.bc Output/%.bc: %.cpp $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm -$(call UPGRADE_LL,$@) -# Compile from X.cc to Output/X.ll +# Compile from X.cc to Output/X.bc Output/%.bc: %.cc $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm -$(call UPGRADE_LL,$@) -# Compile from X.C to Output/X.ll +# Compile from X.C to Output/X.bc Output/%.bc: %.C $(LCC1XX) Output/.dir $(INCLUDES) - -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm + -$(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm -$(call UPGRADE_LL,$@) # LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from Modified: test-suite/trunk/MultiSource/Applications/spiff/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/spiff/Makefile?rev=45980&r1=45979&r2=45980&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/spiff/Makefile (original) +++ test-suite/trunk/MultiSource/Applications/spiff/Makefile Mon Jan 14 16:33:19 2008 @@ -1,7 +1,6 @@ LEVEL = ../../.. PROG = spiff CPPFLAGS = -CFLAGS = LDFLAGS = #RUN_OPTIONS = $(PROJ_SRC_DIR)/Sample.1 $(PROJ_SRC_DIR)/Sample.2 Modified: test-suite/trunk/MultiSource/Makefile.multisrc URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Makefile.multisrc?rev=45980&r1=45979&r2=45980&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Makefile.multisrc (original) +++ test-suite/trunk/MultiSource/Makefile.multisrc Mon Jan 14 16:33:19 2008 @@ -28,16 +28,16 @@ .PRECIOUS: $(LObjects) $(NObjects) Output/%.o: %.c Output/.dir - -$(CC) $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) -c $< -o $@ + -$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.C Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ + -$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.cpp Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ + -$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ Output/%.o: %.cc Output/.dir - -$(CC) $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) -c $< -o $@ + -$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ bugpoint-opt: Output/$(PROG).bugpoint-opt bugpoint-gccas: Output/$(PROG).bugpoint-opt Modified: test-suite/trunk/SingleSource/Makefile.singlesrc URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Makefile.singlesrc?rev=45980&r1=45979&r2=45980&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Makefile.singlesrc (original) +++ test-suite/trunk/SingleSource/Makefile.singlesrc Mon Jan 14 16:33:19 2008 @@ -34,10 +34,10 @@ # FIXME: LIBS should be specified, not hardcoded to -lm Output/%.native: $(SourceDir)/%.c Output/.dir - -$(CC) $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) + -$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) Output/%.native: $(SourceDir)/%.cpp Output/.dir - -$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) + -$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OPTFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) bugpoint-gccas bugpoint-opt bugpoint-llvm-ld bugpoint-gccld bugpoint-jit bugpoint-llc bugpoint-llc-beta: _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits