[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-19 Thread Jay Foad via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6bec3e9303d6: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf (authored by foad). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-17 Thread Chris Lattner via Phabricator via cfe-commits
lattner added inline comments. Comment at: llvm/lib/Analysis/ConstantFolding.cpp:2884 if (IntrinsicID == Intrinsic::smul_fix_sat) { - APInt Max = APInt::getSignedMaxValue(Width).sextOrSelf(ExtendedWidth); - APInt Min =

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-17 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: llvm/lib/IR/ConstantRange.cpp:724 auto BW = getBitWidth(); -APInt Min = APInt::getMinValue(BW).zextOrSelf(ResultBitWidth); -APInt Max = APInt::getMaxValue(BW).zextOrSelf(ResultBitWidth); +APInt Min =

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-17 Thread Philip Reames via Phabricator via cfe-commits
reames added a comment. Coming into this late, but I'd have preferred to see this separated into at least two pieces. One for each "non-obvious" adjustment, and one final one which just did the replace on the renaming sites. This differs from feedback from other reviewers above, so don't

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-17 Thread Jay Foad via Phabricator via cfe-commits
foad added inline comments. Comment at: llvm/lib/IR/ConstantRange.cpp:724 auto BW = getBitWidth(); -APInt Min = APInt::getMinValue(BW).zextOrSelf(ResultBitWidth); -APInt Max = APInt::getMaxValue(BW).zextOrSelf(ResultBitWidth); +APInt Min =

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-14 Thread Jay Foad via Phabricator via cfe-commits
foad marked 2 inline comments as done. foad added inline comments. Comment at: llvm/lib/Analysis/ConstantFolding.cpp:2884 if (IntrinsicID == Intrinsic::smul_fix_sat) { - APInt Max = APInt::getSignedMaxValue(Width).sextOrSelf(ExtendedWidth); - APInt Min =

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-14 Thread Jay Foad via Phabricator via cfe-commits
foad updated this revision to Diff 429466. foad added a comment. Address some review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125557/new/ https://reviews.llvm.org/D125557 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-13 Thread Chris Lattner via Phabricator via cfe-commits
lattner accepted this revision. lattner added a comment. This revision is now accepted and ready to land. nice cleanup! Comment at: llvm/lib/Analysis/ConstantFolding.cpp:2884 if (IntrinsicID == Intrinsic::smul_fix_sat) { - APInt Max =

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-13 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added subscribers: reames, efriedma. efriedma added inline comments. Comment at: llvm/lib/IR/ConstantRange.cpp:724 auto BW = getBitWidth(); -APInt Min = APInt::getMinValue(BW).zextOrSelf(ResultBitWidth); -APInt Max =

[PATCH] D125557: [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf

2022-05-13 Thread Jay Foad via Phabricator via cfe-commits
foad created this revision. foad added reviewers: lattner, RKSimon, lebedev.ri, spatel. Herald added subscribers: kosarev, jsilvanus, hsmhsm, jeroen.dobbelaere, frasercrmck, ecnelises, martong, kerbowa, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o,