llvm-project/polly/lib/Support
Tobias Grosser 437200089d Improve documentation and testing for isl_valFromAPInt
The recent unit tests we gained made clear that the semantics of
isl_valFromAPInt are not clear, due to missing documentation. In this change we
document both the calling interface as well as the implementation of
isl_valFromAPInt.

We also make the implementation easier to read by removing integer wrappig in
abs() when passing in the minimal integer value for a given bitwidth. Even
though wrapping and subsequently interpreting the result as unsigned value gives
the correct result, this is far from obvious.  Instead, we explicitly add one
more bit to the input type to ensure that abs will never wrap. This change did
not uncover a bug in the old implementation, but was introduced to increase
readability.

We update the tests to add a test case for this special case and use this
opportunity to also test a number larger than 64 bit. Finally, we order the
arguments of the test cases to make sure the expected output is first. This
helps readability in case of failing test cases as gtest assumes the first value
to be the exected value.

Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D23917

llvm-svn: 279815
2016-08-26 12:01:07 +00:00
..
GICHelper.cpp Improve documentation and testing for isl_valFromAPInt 2016-08-26 12:01:07 +00:00
Mainpage.h docs: Add doxygen mainpage 2016-03-07 21:17:48 +00:00
RegisterPasses.cpp [GSoC] Add PolyhedralInfo pass - new interface to polly analysis 2016-07-25 12:48:45 +00:00
SCEVAffinator.cpp [SCEVAffinator] Fix assertion checking for constant divisor. 2016-07-12 15:08:47 +00:00
SCEVValidator.cpp [SCEVValidator] Don't reorder multiplies in extractConstantFactor. 2016-08-18 16:30:42 +00:00
ScopHelper.cpp Move getIndexExpressionsFromGEP() to ScopHelper. NFC. 2016-06-28 01:37:13 +00:00
ScopLocation.cpp clang-tidy: Add llvm namespace comments 2016-06-23 22:17:27 +00:00