Skip to content

JIT: LowerHWIntrinsicCreate can create illegal IR #92766

Closed
@jakobbotsch

Description

@jakobbotsch
LowerHWIntrinsicCreate before:
N002 (  1,  1) [000017] -----------                   t17 =    LCL_VAR   byref  V01 arg0         u:1 $81
                                                            ┌──▌  t17    byref  
N004 (  3,  4) [000054] -c---------                   t54 =   LEA(b+4)  byref 
                                                            ┌──▌  t54    byref  
N005 (  4,  3) [000019] n---GO-----                   t19 =   IND       float  <l:$203, c:$202>
                                                            ┌──▌  t3     float  
               [000089] ---XG------                   t89 =   HWINTRINSIC simd16 float CreateScalarUnsafe
               [000090] -c---------                   t90 =    CNS_INT   int    1
N003 (  1,  2) [000004] -----------                    t4 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t89    simd16 
                                                            ├──▌  t90    int    
                                                            ├──▌  t4     float  
               [000091] ---XG------                   t91 =   HWINTRINSIC simd16 float Insert
               [000092] -c---------                   t92 =    CNS_INT   int    2
N004 (  1,  2) [000005] -----------                    t5 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t91    simd16 
                                                            ├──▌  t92    int    
                                                            ├──▌  t5     float  
               [000093] ---XG------                   t93 =   HWINTRINSIC simd16 float Insert
               [000094] -c---------                   t94 =    CNS_INT   int    3
N005 (  1,  2) [000006] -----------                    t6 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t93    simd16 
                                                            ├──▌  t94    int    
                                                            ├──▌  t6     float  
N006 (  7,  9) [000011] ---XG------                   t11 =   HWINTRINSIC simd16 float Insert $2c0
                                                            ┌──▌  t11    simd16 
N007 ( 11, 12) [000014] DA-XG------                           STORE_LCL_VAR simd16 V07 tmp4         d:1 $1c1
               [000085] -----------                            IL_OFFSET void   INLRT @ 0x03D[--]
N001 (  1,  2) [000016] -----------                   t16 =    CNS_DBL   float  0.0000000000000000 $240
N006 (  1,  2) [000020] -----------                   t20 =    CNS_DBL   float  0.0000000000000000 $240
N007 (  1,  2) [000021] -----------                   t21 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t16    float  
                                                            ├──▌  t19    float  
                                                            ├──▌  t20    float  
                                                            ├──▌  t21    float  
N008 (  8, 10) [000026] ----GO-----                   t26 =   HWINTRINSIC simd16 float Create $2c1
LowerHWIntrinsicCreate after:
               [000084] -----------                            IL_OFFSET void   INLRT @ 0x01C[--]
N001 (  1,  1) [000001] -----------                    t1 =    LCL_VAR   byref  V01 arg0         u:1 $81
                                                            ┌──▌  t1     byref  
N002 (  3,  2) [000003] ---XG------                    t3 =   IND       float  <l:$201, c:$200>
N002 (  1,  1) [000017] -----------                   t17 =    LCL_VAR   byref  V01 arg0         u:1 $81
                                                            ┌──▌  t17    byref  
N004 (  3,  4) [000054] -c---------                   t54 =   LEA(b+4)  byref 
               [000096] -c---------                   t96 =    CNS_INT   int    1
                                                            ┌──▌  t54    byref  
N005 (  4,  3) [000019] n---GO-----                   t19 =   IND       float  <l:$203, c:$202>
                                                            ┌──▌  t95    simd16 
                                                            ├──▌  t96    int    
                                                            ├──▌  t19    float  
               [000097] ----GO-----                   t97 =   HWINTRINSIC simd16 float Insert
                                                            ┌──▌  t3     float  
               [000089] ---XG------                   t89 =   HWINTRINSIC simd16 float CreateScalarUnsafe
               [000090] -c---------                   t90 =    CNS_INT   int    1
N003 (  1,  2) [000004] -----------                    t4 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t89    simd16 
                                                            ├──▌  t90    int    
                                                            ├──▌  t4     float  
               [000091] ---XG------                   t91 =   HWINTRINSIC simd16 float Insert
               [000092] -c---------                   t92 =    CNS_INT   int    2
N004 (  1,  2) [000005] -----------                    t5 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t91    simd16 
                                                            ├──▌  t92    int    
                                                            ├──▌  t5     float  
               [000093] ---XG------                   t93 =   HWINTRINSIC simd16 float Insert
               [000094] -c---------                   t94 =    CNS_INT   int    3
N005 (  1,  2) [000006] -----------                    t6 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t93    simd16 
                                                            ├──▌  t94    int    
                                                            ├──▌  t6     float  
N006 (  7,  9) [000011] ---XG------                   t11 =   HWINTRINSIC simd16 float Insert $2c0
                                                            ┌──▌  t11    simd16 
N007 ( 11, 12) [000014] DA-XG------                           STORE_LCL_VAR simd16 V07 tmp4         d:1 $1c1
               [000085] -----------                            IL_OFFSET void   INLRT @ 0x03D[--]
               [000095] -----------                   t95 =    CNS_VEC   simd16<0x00000000, 0x00000000, 0x00000000, 0x00000000>
               [000098] -c---------                   t98 =    CNS_INT   int    2
N006 (  1,  2) [000020] -----------                   t20 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t97    simd16 
                                                            ├──▌  t98    int    
                                                            ├──▌  t20    float  
               [000099] ----GO-----                   t99 =   HWINTRINSIC simd16 float Insert
               [000100] -----------                  t100 =    CNS_INT   int    3
N007 (  1,  2) [000021] -----------                   t21 =    CNS_DBL   float  0.0000000000000000 $240
                                                            ┌──▌  t99    simd16 
                                                            ├──▌  t100   int    
                                                            ├──▌  t21    float  
N008 (  8, 10) [000026] ----GO-----                   t26 =   HWINTRINSIC simd16 float Insert $2c1
                                                            ┌──▌  t26    simd16 

Notice that the use of t95 appears before the def.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions