Skip to content

Simplify mutable globals with single write in "start" #4892

@MaxGraey

Description

@MaxGraey

It looks like simplify global pass doesn't take into account v128 types.
For example:

(module
 (global $g (mut v128) (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000))
 (start $~start)
 (func (export "getG") $getG (result v128)
  (global.get $g)
 )
 (func $~start
  (global.set $g
   (v128.const i32x4 0x00000003 0x00000003 0x00000003 0x00000003)
  )
 )
)

Cannot be optimized to:

(module
 (global $g (mut v128) (v128.const i32x4 0x00000003 0x00000003 0x00000003 0x00000003))
 (func (export "getG") $getG (result v128)
  (global.get $g)
 )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions