Comments (7)
The issue may be in the Alive2 UI for values, especially those not marked “[based on undef value],” but
%obit
and%spec.select
are each used only once (and the value for%spec.select
(#x1
) is not marked as based on undef value). If the display of%spec.select = #x1
is not relevant to Alive2’s assumption for the value’s sole use in the chosen counterexample, I’m misunderstanding the UI.
I understand the frustration. The issue is that it's quite expensive to mark things as based-on-undef. We use a cheap technique, but it cannot detect all cases. It's annoying, but I don't think we want to spend several minutes to print a counterexample.
Our hope was that we would remove undef from LLVM altogether. That's the main reason why I haven't invested much in making undef perfect in Alive2.
I hate to say this, but in the end this project is maintained by poorly paid academics, while the users are handsomely paid compiler developers. Moreover, companies are not willing to sponsor Alive2. While I try to fix most bugs that come our way, I prioritize the things that are useful for the majority of the users and for my own research. My priority is to remove undef from LLVM.
from alive2.
well... if Alive is happy with the transformation under the --disable-undef-input
then maybe just call it good? there are certainly a number of things in the tree already that don't work when inputs are undef
also, this is a pretty big example to think about and I can't llvm-reduce it since you're providing both the src and tgt. can you llvm-reduce it under the criterion that Alive reports a value mismatch and post the results here?
from alive2.
I don't know if you are an llvm-reduce user but if not, this is the interestingness test that you want, but obv adjust the path
#!/bin/bash
timeout 1 $HOME/alive2-regehr/build/alive-tv $1 2>&1 | grep 'Value mismatch'
from alive2.
The optimization is not correct for undef inputs. Each time an undef is used it can yield a different value.
Since %obit
in tgt is undef, the select can return either of the operands each time it is used. I know the counterexample may look confusing because you get a value for the select and a different for the phi, but that's just how undef works!
from alive2.
The optimization is not correct for undef inputs.
Thanks for the explanation in the subsequent issue, which may have revealed an important bug in our code; but that’s not the point to this bug:
We’re not confident in what the expected behavior is. Alive2 notes, reasonably, that in both src and tgt, %obit is based on undef value. Thus the value of %spec.select might have been different, but Alive2 proclaimed it to be #x1.
Each time an undef is used it can yield a different value. Since
%obit
in tgt is undef, the select can return either of the operands each time it is used.
The issue may be in the Alive2 UI for values, especially those not marked “[based on undef value],” but %obit
and %spec.select
are each used only once (and the value for %spec.select
(#x1
) is not marked as based on undef value). If the display of %spec.select = #x1
is not relevant to Alive2’s assumption for the value’s sole use in the chosen counterexample, I’m misunderstanding the UI.
from alive2.
I quite understand your point (Matter Labs is hiring, and my wife is a professor). Alive2 has done a lot of good for the LLVM community and for our compiler, so we’d like to become a sponsor; please send me the details.
We’ve now fixed our undef
bug; I’m not sure where it would fit in your BugList.md. It’s our PR#385, and will become open source when we update our public repo, though the PR number may be transient.
from alive2.
…I haven't invested much in making undef perfect in Alive2.
That makes sense, and it’s no longer crucial for us, given the freeze fix plus using noundef
where needed. I would suggest, for others still depending on undef
, tweaking the UI (or perhaps the documentation) to make it clearer what the user can’t rely on when analyzing an unsoundness report involving undef
— or perhaps just remove some of the output. (I don’t understand the reports well enough to submit a ReadMe PR.)
from alive2.
Related Issues (20)
- unexpected result when tgt is asm
- Implicit conversion and static analysis warnings HOT 1
- arm-tv bug that won't repro in alive-tv HOT 2
- issue with returned arguments in asm memory mode HOT 4
- issue with aligned pointers
- Source function always being UB warning may be missing HOT 3
- undesirable poison in return value HOT 1
- target-side padding for non-byte-sized loads/stores HOT 1
- missed alarm? HOT 2
- add support for range attribute in args and ret val
- Unknown command line argument '-tv' HOT 7
- Add support for poison-generating flags `nuw`/`nsw` to `trunc`
- False positive and different refined value of `zext undef` HOT 3
- Errors about unsupported instruction `invoke` HOT 4
- Load widening for higher aligned pointer incorrectly reported as undefined HOT 2
- byval arg & memory(argmem) don't work together
- Consider the new 2-phase memory model HOT 2
- Add support for pointers larger than 64 bits HOT 5
- Add support for gep's nuw nusw attributes HOT 1
- bug relating to too-big store? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alive2.