aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-10-09 21:26:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-10-09 21:26:50 -0700
commit37347e52fc6b7110783efba5fad19c195dd375ec (patch)
tree88633bf7aad016d7b07175e7541513c4abecb1db /tools/shared.py
parent7f947dd899db6e4b58eedf2dbc81d2a03fc60653 (diff)
restructure usage of llvm opts. customize use of opts in specific benchmarks
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 3601b9b3..e223c447 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -91,12 +91,21 @@ def limit_size(string, MAX=800*20):
if len(string) < MAX: return string
return string[0:MAX/2] + '\n[..]\n' + string[-MAX/2:]
-def pick_llvm_opts(optimization_level, optimize_size, allow_nonportable=False, quantum_size=4, use_aa=False):
+def pick_llvm_opts(optimization_level, handpicked, quantum_size=4, use_aa=False):
+ '''
+ It may be safe to use nonportable optimizations (like -OX) if we remove the platform info from the .ll
+ (which we do in do_ll_opts) - but even there we have issues (even in TA2) with instruction combining
+ into i64s. In any case, the handpicked ones here should be safe and portable. They are also tuned for
+ things that look useful.
+ '''
opts = []
if optimization_level > 0:
- if allow_nonportable:
+ if not handpicked:
opts.append('-O%d' % optimization_level)
else:
+ allow_nonportable = False
+ optimize_size = True
+
# PassManagerBuilder::populateModulePassManager
if allow_nonportable and use_aa: # ammo.js results indicate this can be nonportable
opts.append('-tbaa')