Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the driver avaliable publicly? #3

Open
LebedevRI opened this issue Jul 18, 2018 · 2 comments
Open

Is the driver avaliable publicly? #3

LebedevRI opened this issue Jul 18, 2018 · 2 comments

Comments

@LebedevRI
Copy link

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 :)

@gergo-
Copy link
Owner

gergo- commented Jul 18, 2018

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...

@LebedevRI
Copy link
Author

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:

  1. cat test.ll | llc -o - -s | wc -l
  2. cat test.ll | opt -instcombine | llc -o - -s | wc -l
  3. Is the number from 2 bigger than from 1.? (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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants