[PATCH] D95257: [RGT][GlobalISel] Add missing setUp() calls to legalizer unittests

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 09:58:34 PST 2021


arsenm added a comment.

In D95257#2530928 <https://reviews.llvm.org/D95257#2530928>, @probinson wrote:

> I asked about this on llvm-dev but it seemed worth reporting here as well.
> Some of the differences between the expected output (per the FileCheck directives) and the actual output appear to be little more than reordering of the instructions.  However, oddly, in some cases the use of a value might precede its definition.  For example, in NarrowSEXTINREG, the test is looking for this:
>
>   CHECK: [[T0:%[0-9]+]]:_(s16) = G_TRUNC
>   CHECK: [[T1:%[0-9]+]]:_(s10) = G_TRUNC [[T0]]:_s(16)
>   CHECK: [[T2:%[0-9]+]]:_(s10) = G_SEXT_INREG [[T1]]:_, 8
>   CHECK: [[T3:%[0-9]+]]:_(s16) = G_SEXT [[T2]]:_(s10)
>
> But, what I see is this:
>
>   %5:_(s16) = G_SEXT %7:_(s10)
>   %4:_(s16) = G_TRUNC %0:_(s64)
>   %7:_(s10) = G_SEXT_INREG %6:_, 8
>   %6:_(s10) = G_TRUNC %4:_(s16)
>
> So the SEXT uses the result of SEXT_INREG, which uses the result of the second TRUNC; these are all forward references.  That doesn't seem correct; uses before defs?  If there's a problem with instruction ordering, fixing that seems like its own issue, and would probably make many of the failures I'm seeing just go away.  (Global ISel is very much not my area, so I'd appreciate it if someone else could figure out the ordering question.)

Yes, this is plainly broken


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95257



More information about the llvm-commits mailing list