missed-optimizations
missed-optimizations copied to clipboard
Is the driver avaliable publicly?
Hello.
I don't think it was written anywhere, and i can't find it, but is the
differential testing framework itself (not the ldrgen
) available publicly?
I have a set of interesting [to me] codes i'd like to cross-compare, and
doing that manually is boring :)
No, sorry. The differential testing framework is a mess of Python and shell scripts that I have been meaning to clean up for release, but I haven't put in the work yet.
Note that even if it were public, it would not currently be applicable to real codes containing loops: The reduction process tends to reduce even terminating loops to infinite loops that are compiled differently by different C compilers.
Also, depending on what exactly you are looking for, you may be able to get there more easily. If you know how to write C-Reduce driver scripts (https://embed.cs.utah.edu/creduce/using/) and are, say, only interested in which compiler generates fewer instructions, you can hack that together in a few lines using objdump -d
on the binaries or grep
on the assembly codes followed by wc -l
. That's almost morally equivalent to what my tool does, at least in simple configurations.
Feel free to get back with more questions.
I will leave this issue open to shame myself into making a release soon...
Thank you for replying. Indeed, i don't need anything advanced. I won't need to creduce anything, i can generate the entire set of cases already. They are rather simple:
define i1 @t0(iQQQ %x) nounwind {
%tmp0 = shl iQQQ %x, WWW
%tmp1 = ashr exact iQQQ %tmp0, WWW
%tmp2 = icmp eq iQQQ %tmp1, %x
ret i1 %tmp2
}
Where QQQ
is 2..128
, WWW
is 1..QQQ-1
.
Interestingness test is:
-
cat test.ll | llc -o - -s | wc -l
-
cat test.ll | opt -instcombine | llc -o - -s | wc -l
- Is the number from
2
bigger than from1
.? (I.e. did instcombine regress things?) Indeed i will be able to hack something together myself, i just didn't want to invent a bicycle :)