Has anyone converted llvm/projects/test-suite to use the llvm assembler instead of gcc?
If so, what was needed to change and how?
My assumption is that this would be a good way to test the llvm assembler.
Jack
Has anyone converted llvm/projects/test-suite to use the llvm assembler instead of gcc?
If so, what was needed to change and how?
My assumption is that this would be a good way to test the llvm assembler.
Jack
Not quite sure what you mean, as far as I know there isn't any
assembler in there
so if it's using clang it should be dependent upon the use of -integrated-as for
your target?
I miss something?
-eric
Yes, absolutely. There’s two pieces of this that are handy. First, checking the normal integrated-assembler code path. That doesn’t check the actual assembler, but rather the binary encoder and object file emitter. To test that, I did runs with a locally modified clang that enabled the integrated assembler by default for my target (ARM/Darwin at the time). The second piece is checking the assembler itself. For that, I ran the full test suite and kept the .s files around. Then I ran each .s file through plain ‘as’ and llvm-mc and did a binary comparison of the results. Anything that showed up, I analyzed to see if it was innocuous or an error.
-Jim
Let me see if I understand the response
When you are saying integrated assembler do you mean llc --filetype=obj? If so, we currently have that for an option when running the test-suite.
When you say that to test the llvm-mc assembler for your target you don’t substitute the gcc assembler invocation for llvm-mc which would expect the resultant executable run to pass. Instead you have to do another pass running llvm-mc on the preserved .s files
Did I get this right?
If so, I am way too lazy and greedy. I want to run the suite and with an option, substitute the llvm standalone assembler for the gcc one (not for the control compile of course).
Jack
Eric,
This invocation creates the .s file using llc:
build/Debug+Asserts/bin/llc -march=mipsel -mcpu=mips32r2 -mattr=o32 -disable-mips-delay-filler -filetype=asm -relocation-model=pic -asm-verbose=false -O3 Output/mandel-2.llvm.mipsel.ll -o Output/mandel-2.llc.mips32r2.s -info-output-file=/home/jcarter/workarea/assembler_jack/build/projects/test-suite/SingleSource/Benchmarks/Misc/Output/mandel-2.llc.mips32r2.s.info -stats -time-passes
The next line assembles it with gcc. The gcc driver will invoke gas on it. This is the part that I want to use llvm-mc.
mips-linux-gnu-g++ Output/mandel-2.llc.mips32r2.s -o Output/mandel-2.llc.mips32r2 -mips32r2 -EL -lm -lstdc++ -lpthread -fPIC -mabi=32
Let me see if I understand the response
When you are saying integrated assembler do you mean llc --filetype=obj? If so, we currently have that for an option when running the test-suite.
That’s the equivalent, yes. Sounds like you have that covered.
When you say that to test the llvm-mc assembler for your target you don’t substitute the gcc assembler invocation for llvm-mc which would expect the resultant executable run to pass. Instead you have to do another pass running llvm-mc on the preserved .s files
Did I get this right?
Yes, however…
If so, I am way too lazy and greedy. I want to run the suite and with an option, substitute the llvm standalone assembler for the gcc one (not for the control compile of course).
Doing it by assembling the .s files and comparing those allowed me to do the vast majority of the assembler testing without ever running the test suite on a target device (which takes a long time), or re-compiling the test-suite (which also takes a fair bit of time), thus speeding up my turnaround time.
There aren’t, that I know of, makefile rules to do things the way you’re asking. It could be added, of course.
-Jim