We will now optimistically assume that the result of an unsigned comparison is the same as the result of the same comparison interpreted as signed. To this end we will simply assume that both operands are non-negative.
Details
- Reviewers
Meinersbur grosser
Diff Detail
Event Timeline
lib/Analysis/ScopInfo.cpp | ||
---|---|---|
1323–1326 | I assume that RTCs checks will always be signed therefor this will check whether the MSB is not 1. Could you add a comment for that? | |
test/ScopInfo/simple_loop_unsigned.ll | ||
3–7 | This has no unsigned comparison. Can you make it represent the IR below? Eg. for (i = 0; (uint64_t)i < (uint64_t)N; ++i) %i is of type i64, so I suggest to declare i as int64_t | |
13 | Why is this significant for the test case? | |
test/ScopInfo/simple_loop_unsigned_2.ll | ||
36 | Since i is unsigned, why does it have a nsw flag? |
test/ScopInfo/simple_loop_unsigned.ll | ||
---|---|---|
13 | Not a problem, but makes it harder to understand what's the point of the test. I could understand why checking the Statement because of its domain, but I don't know why checking the accessed array and its size should be relevant. | |
test/ScopInfo/simple_loop_unsigned_2.ll | ||
36 | This is a brand new test case, so who else could have added it? The problem I see is that the commented C-code does not accurately represent the IR, hence does a disfavor when trying to understand the code. If you do not intend to keep the C-representation in-sync with the IR, you can just remove it. |
test/ScopInfo/simple_loop_unsigned.ll | ||
---|---|---|
13 | Personally, I think this is overkill to argue about 3 trivial check lines of a test case that has 12 lines of IR. Anyway, you seem to care a lot about it and I will remove them. | |
test/ScopInfo/simple_loop_unsigned_2.ll | ||
36 |
Clang? One of our preparation passes? Somebody else and I just copied an existing test case as a basis for this one?
Did you actually compile the code to IR? The nsw you seem to care about is always there. Regarding the mismatch of C and IR, your comment seems rather odd. We surely can just drop all the C code but I think it helps people to understand the structure of the test case, even though it is/cannot always represent the IR exactly. In general I think this is again a discussion that is out of place and if you care about it I would suggest you move it to the mailinglist. |
I assume that RTCs checks will always be signed therefor this will check whether the MSB is not 1. Could you add a comment for that?