Skip to content

crossgen2 getClassAlignmentRequirement returns wrong value on arm #38822

@t-mustafin

Description

@t-mustafin

I hit on different input argument r1 usage generated by crossgen2 and Tier-1 compilation on lambda-expression MyStruct { int a; int b; long c; }:

var soldOutProducts = products.Where(p => p.MyStruct.a > 0x300 || p.MyStruct.b > 0x50000 || p.MyStruct.c > 0x6000000);

Code generated by crossgen2 uses r1+36:

000006  6A48           ldr     r0, [r1+36]
000008  F5B0 7F40      cmp     r0, 768
00000C  DC14           bgt     SHORT G_M16079_IG06
                        ;; bbWeight=1    PerfScore 3.00
G_M16079_IG03:
00000E  6A88           ldr     r0, [r1+40]
000010  F5B0 2FA0      cmp     r0, 0x50000
000014  DC10           bgt     SHORT G_M16079_IG06
000016  F101 002C      add     r0, r1, 44
00001A  6803           ldr     r3, [r0]
00001C  6840           ldr     r0, [r0+4]

Code generated by Tier-1 uses r1+40:

G_M16079_IG02:
000006  6A88           ldr     r0, [r1+40]
000008  F5B0 7F40      cmp     r0, 768
00000C  DC14           bgt     SHORT G_M16079_IG06
                        ;; bbWeight=1    PerfScore 3.00
G_M16079_IG03:
00000E  6AC8           ldr     r0, [r1+44]
000010  F5B0 2FA0      cmp     r0, 0x50000
000014  DC10           bgt     SHORT G_M16079_IG06
000016  F101 0030      add     r0, r1, 48
00001A  6803           ldr     r3, [r0]
00001C  6840           ldr     r0, [r0+4]

MyStruct.cg2.dump.txt
MyStruct.cg2.S.txt
MyStruct.cg2-tier.dump.txt
MyStruct.cg2-tier.S.txt
Discussion started in PR38390

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions