[PATCH] D73341: [GlobalISel] Use pointer type size for offset constant when lowering load/stores

Dominik Montada via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 06:13:46 PST 2020


gargaroff added a comment.

In D73341#1838596 <https://reviews.llvm.org/D73341#1838596>, @arsenm wrote:

> While this is correct, this also shouldn't cause legalization to fail with non 64-bit pointers. Are you missing a legalize rule for the second type index for G_PTR_ADD?


I don't think we do to be honest. This is our legalizer rule for `G_PTR_ADD`:

  getActionDefinitionsBuilder(G_PTR_ADD)
      .legalFor({{p0, s32}})
      .clampScalar(1, s32, s32);

So we try to narrow the 64-bit constant to a 32-bit constant. In the `LegalizerHelper::narrowScalar` there is no rule for `G_PTR_ADD`, so it returns with `UnableToLegalize`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73341





More information about the llvm-commits mailing list