[PATCH] D129224: [InstCombine] Fold strtoul and strtoull and avoid PR #56293

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 05:31:29 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:110
+  Type *RetTy = CI->getType();
+  unsigned NBytes = RetTy->getPrimitiveSizeInBits();
+  switch (NBytes) {
----------------
NBytes -> NBits?


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:120
+    Max += AsSigned ? INT64_MAX : UINT64_MAX;
+    break;
+  default:
----------------
Can avoid the separate cases via `AsSigned ? maxUIntN(NBits) : maxIntN(NBits)`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129224/new/

https://reviews.llvm.org/D129224



More information about the llvm-commits mailing list