The recent unit tests we gained made clear that the semantics of APIntFromVal
are not clear, due to missing documentation. In this change we document both
the calling interface as well as the implementation of APIntFromVal. We also
make the implementation easier to read by removing the use of magic numbers.
Finally, we add tests to check the bitwidth of the created values as well as
the correct modeling of very large numbers.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thank you for the extensive documentation and adding more test cases.
include/polly/Support/GICHelper.h | ||
---|---|---|
46 ↗ | (On Diff #69323) | assert() is not a guaranteed behavior. Better mention that the function can only be called on integer isl_vals. |
55–64 ↗ | (On Diff #69323) | Cool! More than I hoped for. I'd remove the Unsigned column. It gives the impression that an unsigned interpretation would make sense. But maybe add a bitwidth column? |
lib/Support/GICHelper.cpp | ||
65 ↗ | (On Diff #69323) | Can you mention 'negate'=='two's complement'? |
unittests/Isl/IslTest.cpp | ||
68 ↗ | (On Diff #69323) | Suggestion: |
69–70 ↗ | (On Diff #69323) | Remove fixme |
150 ↗ | (On Diff #69323) | Wow! Truly large integers. |