Skip to content

JIT: Control-flow guard checked interface calls should not materialize cell addresses twice #65076

Description

@jakobbotsch

Description

We currently materialize indirection cell addresses twice for CFG checked interface calls on arm64:

Reproduction Steps

$env:COMPlus_TieredCompilation=0
$env:COMPlus_JitForceControlFlowGuard=1
[MethodImpl(MethodImplOptions.NoInlining)]
public static void M(I i)
{
    i.Foo();
}

We produce the following code:

G_M6547_IG02:              ;; offset=0008H
        D280010F          movz    x15, #8
        F2B9218F          movk    x15, #0xc90c LSL #16
        F2CFFFCF          movk    x15, #0x7ffe LSL #32
        F94001EF          ldr     x15, [x15]
        94000000          bl      CORINFO_HELP_VALIDATE_INDIRECT_CALL
        AA0F03E1          mov     x1, x15
        D280010B          movz    x11, #8
        F2B9218B          movk    x11, #0xc90c LSL #16
        F2CFFFCB          movk    x11, #0x7ffe LSL #32
        D63F0020          blr     x1

Expected behavior

We should only load the indirection cell address once.

Actual behavior

We load it twice.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. self-assigned this
    on Feb 9, 2022
  2. ghost added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Feb 9, 2022
  3. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Feb 9, 2022
  4. removed
    untriagedNew issue has not been triaged by the area owner
    on Feb 9, 2022
  5. added this to the 7.0.0 milestone on Feb 11, 2022
  6. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 15, 2022
  7. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 28, 2022
  8. added a commit that references this issue on Jun 9, 2022
    1b7ff39
  9. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 9, 2022
  10. added a commit that references this issue on Jun 13, 2022
    025b763
  11. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 13, 2022
  12. added a commit that references this issue on Jun 23, 2022
    5776aad
  13. ghost locked as resolved and limited conversation to collaborators on Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions