Skip to content

Bad lowering of CreateScalar when EnableHWIntrinsic=0 #133746

Closed

Description

@dhartglassMSFT

With DOTNET_EnableHWIntrinsic=0, this prints <-1, 0, 0, ...> with tieredcompilation=1 but prints <-1, -1, ...> with tieredcompilation=0.

using System;
using System.Runtime.Intrinsics;

public class Mini
{
    public static int Main()
    {
        Vector64<sbyte> value = Vector64.CreateScalar((sbyte)-1);
        Console.WriteLine(value);
        return 100;
    }
}

Problem is lowering/store coalescing making this transform, byte->long:

lowering store lcl var/field (before):
N001 (  1,  2) [000055] -----+-----                   t55 =    CNS_INT   int    -1 $40
                                                            /--*  t55    int    
N002 (  6,  8) [000056] UA---+-----                         *  STORE_LCL_FLD byte   V02 tmp2         ud:1->2[+0] $VN.Void

lowering store lcl var/field (after):
N001 (  1,  2) [000055] -----+-----                   t55 =    CNS_INT   long   -1 $40
                                                            /--*  t55    long   
N002 (  6,  8) [000056] UA---+-----                         *  STORE_LCL_FLD long   V02 tmp2         ud:1->2[+0] $VN.Void

Activity

  1. added this to the 12.0.0 milestone on Sep 11, 2026
  2. added
    area-CodeGen-coreclr
    on Sep 11, 2026
  3. dotnet-policy-service commented on Sep 11, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
    See info in area-owners.md if you want to be subscribed.

  4. tannergooding commented on Sep 11, 2026

    @tannergooding
    Member

    ah, @dhartglassMSFT I missed that you had self-assigned already. I have a fix if you've not actually started work

    otherwise, feel free to continue

  5. dhartglassMSFT commented on Sep 13, 2026

    @dhartglassMSFT
    ContributorAuthor

    ah, @dhartglassMSFT I missed that you had self-assigned already. I have a fix if you've not actually started work

    otherwise, feel free to continue

    sure grab it I unassigned myself

  6. removed their assignment
    on Sep 13, 2026
  7. added a commit that references this issue on Sep 21, 2026
    d5b10c7
  8. locked and limited conversation to collaborators on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclr

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions