|
Add configure flags --enable-target-oses=os1,os2 and --enable-target-envs=env1,env2 similar to --enable-target=arch1,arch2.
These flags generate pre-processor defines that are then checked within the Triple module to force certain code paths to be considered dead (if llvm is built with an LTO-enabled-compiler).
The if-defs could be spread further to give the same benefit for non-LTO compilers, but that isn't done right now...
Concretely, if you build LLVM w/ clang -O4 and --enable-target-oses=Linux, there is about a 170 KB savings (most of the MC COFF support, plus some branches in various places). If --enable-target-envs=gnu is also specified then most of MC MachO code is also pruned:
lto, all oses, all environments: 12757900
lto, only Linux, all environments: 12584978
lto, only Linux, only gnu environment: 12528216
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+556 lines, -31 lines) |
Patch |
 |
M |
Makefile.rules
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Makefile.config.in
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
autoconf/configure.ac
|
View
|
|
1 chunk |
+96 lines, -0 lines |
0 comments
|
Download
|
 |
M |
configure
|
View
|
|
8 chunks |
+121 lines, -4 lines |
0 comments
|
Download
|
 |
M |
include/llvm/ADT/Triple.h
|
View
|
|
2 chunks |
+206 lines, -0 lines |
0 comments
|
Download
|
 |
M |
lib/MC/MCObjectFileInfo.cpp
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
lib/Support/Triple.cpp
|
View
|
|
2 chunks |
+99 lines, -0 lines |
0 comments
|
Download
|
 |
M |
lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
lib/Target/TargetLibraryInfo.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
|
View
|
|
3 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
lib/Target/X86/X86Subtarget.h
|
View
|
|
2 chunks |
+8 lines, -14 lines |
0 comments
|
Download
|
|