Closed romits800 closed 5 years ago
I compile the following program test-issue.c:
test-issue.c
int global_var = 21; int test(int n) { if (n>0) { return n; } else { return global_var - n; } }
I use the following procedure to generate the .mir and .asm.mir files: Generate the .ll file:
.mir
.asm.mir
.ll
clang -O2 -S -target mips -emit-llvm test-issue.c
Generate the .mir, .asm.mir files (which also generates an error):
llc test-issue.ll -O2 -march=mips -mcpu=mips32 -unison -unison-no-clean
Copy the generated files (/tmp/unison-20eb1e.*):
cp /tmp/unison-20eb1e.asm.mir test-issue.asm.mir cp /tmp/unison-20eb1e.mir test-issue.mir
Run unsion as follows:
uni import --target=Mips test-issue.mir -o test-issue.uni --function=test --maxblocksize=25 --goal=speed uni linearize --target=Mips test-issue.uni -o test-issue.lssa.uni uni extend --target=Mips test-issue.lssa.uni -o test-issue.ext.uni uni augment --target=Mips test-issue.ext.uni -o test-issue.alt.uni uni normalize --target=Mips test-issue.asm.mir -o test-issue.llvm.mir uni model --target=Mips test-issue.alt.uni -o test-issue.json --basefile=test-issue.llvm.mir +RTS -K20M -RTS gecode-presolver -o test-issue.ext.json -dzn test-issue.dzn --verbose test-issue.json gecode-solver -o test-issue.out.json --verbose test-issue.ext.json
Then, by running uni export:
uni export
uni export --keepnops --target=Mips test-issue.alt.uni -o test-issue.unison.mir --basefile=test-issue.llvm.mir --solfile=test-issue.out.json
The result test-issue.out.json does not contain nops after the LW instructions:
test-issue.out.json
nops
LW
.... bb.0 (freq 1): %v0 = LUi $_gp_disp %v0 = ADDiu %v0, $_gp_disp %at = ADDu %v0, %t9 %at = LW %at, @global_var %at = LW %at, 0 %v0 = SUBu %at, %a0 %at = SLTi %a0, 1 PseudoReturn %ra { %v0 = MOVZ_I_I %a0, %at, %v0 } ...
The version of uni I use is:
uni
$ uni -V Unison v0, Roberto Castaneda Lozano [roberto.castaneda@ri.se]
The version of clang I use is:
clang
$ clang --version clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
The version of llc that I use is:
llc
$ llc --version LLVM (http://llvm.org/): LLVM version 3.8.1 DEBUG build with assertions. Built Mar 13 2019 (19:05:44). Default target: x86_64-unknown-linux-gnu Host CPU: broadwell Registered Targets: arm - ARM armeb - ARM (big endian) hexagon - Hexagon mips - Mips mips64 - Mips64 [experimental] mips64el - Mips64el [experimental] mipsel - Mipsel thumb - Thumb thumbeb - Thumb (big endian)
Hi @romits800, thanks for the detailed report! Could you also attach the test-issue.mir and test-issue.asm.mir files to make it easier to reproduce?
Hi @robcasloz, I attach the files. test-issue.tar.gz
I compile the following program
test-issue.c
:I use the following procedure to generate the
.mir
and.asm.mir
files: Generate the.ll
file:Generate the
.mir
,.asm.mir
files (which also generates an error):Copy the generated files (/tmp/unison-20eb1e.*):
Run unsion as follows:
Then, by running
uni export
:The result
test-issue.out.json
does not containnops
after theLW
instructions:The version of
uni
I use is:The version of
clang
I use is:The version of
llc
that I use is: