|
1 |
| ---- verificarlo 2020-12-17 11:27:57.074070576 -0500 |
2 |
| -+++ /home/yohan/local/bin/verificarlo 2020-12-16 18:37:46.866142995 -0500 |
3 |
| -@@ -294,11 +294,17 @@ |
| 1 | +diff --git a/verificarlo.in.in b/verificarlo.in.in |
| 2 | +index 14cd655..a9090b8 100644 |
| 3 | +--- a/verificarlo.in.in |
| 4 | ++++ b/verificarlo.in.in |
| 5 | +@@ -136,7 +136,8 @@ def compile_vfcwrapper(source, output, args, emit_llvm=False): |
| 6 | + |
| 7 | + internal_options = (" -S -emit-llvm " if emit_llvm else "") + \ |
| 8 | + f" -c -Wno-varargs -I {mcalib_includes} " |
| 9 | +- shell(f'{clang} -O3 -march=native {internal_options} {extra_args} {source} -o {output} ') |
| 10 | ++ conservative = '-march=x86-64' if args.conservative else '-march=native' |
| 11 | ++ shell(f'{clang} -O3 {conservative} {internal_options} {extra_args} {source} -o {output} ') |
| 12 | + |
| 13 | + |
| 14 | + def linker_mode(sources, options, libraries, output, args): |
| 15 | +@@ -204,9 +205,11 @@ def compiler_mode(sources, options, output, args): |
| 16 | + compile_only([source], ' -c ' + options, basename_output, args) |
| 17 | + continue |
| 18 | + |
| 19 | ++ conservative = '-march=x86-64' if args.conservative else '' |
| 20 | ++ |
| 21 | + # Compile to ir (fortran uses flang, c uses clang) |
| 22 | + shell( |
| 23 | +- f'{compiler} -c -S {debug} {source} {include} -emit-llvm {options} -o {ir.name}') |
| 24 | ++ f'{compiler} -c -S {debug} {source} {include} -emit-llvm {options} -o {ir.name} {conservative}') |
| 25 | + |
| 26 | + selectfunction = "" |
| 27 | + if args.function: |
| 28 | +@@ -246,7 +249,7 @@ def compiler_mode(sources, options, output, args): |
| 29 | + basename_output = output |
| 30 | + |
| 31 | + # Produce object file |
| 32 | +- shell(f'{compiler} -c {basename_output} {ins.name} {options}') |
| 33 | ++ shell(f'{compiler} -c {basename_output} {ins.name} {options} {conservative}') |
| 34 | + |
| 35 | + |
| 36 | + if __name__ == "__main__": |
| 37 | +@@ -282,6 +285,8 @@ if __name__ == "__main__": |
4 | 38 | parser.add_argument('--version', action='version', version=PACKAGE_STRING)
|
5 | 39 | parser.add_argument('--linker', choices=linkers.keys(), default=default_linker,
|
6 | 40 | help="linker to use, {dl} by default".format(dl=default_linker))
|
7 |
| -+ parser.add_argument('--disable-debug-flag', action="store_true", |
8 |
| -+ help="Remove -g from the flag since it can cause error with flang") |
| 41 | ++ parser.add_argument( |
| 42 | ++ '--conservative', action='store_true', help='conservative') |
9 | 43 |
|
10 | 44 | args, other = parser.parse_known_args()
|
11 | 45 |
|
12 |
| - sources, llvm_options = parse_extra_args(other) |
13 |
| - |
14 |
| -+ if args.disable_debug_flag: |
15 |
| -+ if "-g" in llvm_options: |
16 |
| -+ llvm_options = llvm_options.replace("-g", "") |
17 |
| -+ |
18 |
| - # check input files |
19 |
| - if (args.E or args.S or args.c) and len(sources) > 1 and args.o: |
20 |
| - fail('cannot specify -o when generating multiple output files') |
|
0 commit comments