StgCmmPrim: remove an unnecessary instruction in doNewArrayOp

Authored by michalt on Apr 14 2019, 2:21 PM.

Description

StgCmmPrim: remove an unnecessary instruction in doNewArrayOp

Previously we would generate a local variable pointing after the array
header and use it to initialize the array elements. But we already use
stores with offset, so it's easy to just add the header to those offsets
during compilation and avoid generating the local variable (which would
become a LEA instruction when using native codegen; LLVM already
optimizes it away).

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Details

Committed
Marge Bot <ben+marge-bot@smart-cactus.org>Apr 19 2019, 10:32 PM
Parents
rGHCfdfd97310128: Add test case for #16384
Branches
Unknown
Tags
Unknown