[PATCH] D140747: [Transform] Rewrite LowerSwitch using APInt

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 13:33:37 PST 2023


nikic requested changes to this revision.
nikic added a comment.
This revision now requires changes to proceed.

In D140747#4022123 <https://reviews.llvm.org/D140747#4022123>, @Peter wrote:

> In D140747#4019289 <https://reviews.llvm.org/D140747#4019289>, @nikic wrote:
>
>> Why do some parts of this use APSInt?
>
> The old code assumes the branch case to be signed integer (`int64_t`), therefore some place use `APSInt` to make signess more clear.

APSInt is only used if you need to dynamically switch between signed and unsigned operations. Otherwise APInt with appropriate operations is used -- there are signed and unsigned variants for all operations where it makes a difference.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140747



More information about the llvm-commits mailing list