StgCmmPrim: remove an unnecessary instruction in doNewArrayOp
authorMichal Terepeta <michal.terepeta@gmail.com>
Sun, 14 Apr 2019 19:21:17 +0000 (21:21 +0200)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Sat, 20 Apr 2019 03:32:08 +0000 (23:32 -0400)
commiteb2a4df84cd7d66bb27f8ccb08ef10d5c984e892
treefc511d4cc8df9fe3c7d66944a62a9dd380ef264d
parentfdfd97310128d82ac5316d357f0422c9939c1edc
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>
compiler/codeGen/StgCmmPrim.hs