summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/ConstantFolding/saturating-add-sub.ll
Commit message (Collapse)AuthorAgeFilesLines
* [ConstantFolding] Fold undef for integer intrinsicsNikita Popov2019-01-111-48/+24
| | | | | | | | | | | | | | | | | | | This fixes https://bugs.llvm.org/show_bug.cgi?id=40110. This implements handling of undef operands for integer intrinsics in ConstantFolding, in particular for the bitcounting intrinsics (ctpop, cttz, ctlz), the with.overflow intrinsics, the saturating math intrinsics and the funnel shift intrinsics. The undef behavior follows what InstSimplify does for the general cas e of non-constant operands. For the bitcount intrinsics (where InstSimplify doesn't do undef handling -- there cannot be a combination of an undef + non-constant operand) I'm using a 0 result if the intrinsic is defined for zero and undef otherwise. Differential Revision: https://reviews.llvm.org/D55950 llvm-svn: 350971
* [ConstantFolding] Add tests for sat add/sub with undefs; NFCNikita Popov2018-12-201-0/+218
| | | | llvm-svn: 349802
* [ConstantFolding] Split up saturating add/sub tests; NFCNikita Popov2018-12-201-97/+158
| | | | | | Split each test into a separate function. llvm-svn: 349801
* [ConstantFolding] Add support for saturating add/subSanjay Patel2018-11-201-0/+111
Support saturating add/sub in constant folding, based on the APInt methods introduced in D54332. Patch by: @nikic (Nikita Popov) Differential Revision: https://reviews.llvm.org/D54531 llvm-svn: 347328
OpenPOWER on IntegriCloud