OSDN Git Service

ARM64: Instruction simplification for array accesses.
authorAlexandre Rames <alexandre.rames@linaro.org>
Mon, 19 Oct 2015 09:10:41 +0000 (10:10 +0100)
committerAlexandre Rames <alexandre.rames@linaro.org>
Mon, 19 Oct 2015 09:10:41 +0000 (10:10 +0100)
commite6dbf48d7a549e58a3d798bbbdc391e4d091b432
treee9edbb884c0143a38e0b32350119999bc11b4dee
parent45513eb694fe55cf02ca6e8f0884621a6c3f6268
ARM64: Instruction simplification for array accesses.

HArrayGet and HArraySet with variable indexes generate two
instructions on arm64, like

    add temp, obj, #data_offset
    ldr out, [temp, index LSL #shift_amount]

When we have multiple accesses to the same array, the initial `add`
instruction is redundant.

This patch introduces the first instruction simplification in the
arm64-specific instruction simplification pass. It splits HArrayGet
and HArraySet using the new arm64-specific IR HIntermediateAddress.
After that we run GVN again to squash the multiple occurrences of
HIntermediateAddress.

Change-Id: I2e3d12fbb07fed07b2cb2f3f47f99f5a032f8312
compiler/optimizing/code_generator_arm64.cc
compiler/optimizing/code_generator_arm64.h
compiler/optimizing/common_arm64.h
compiler/optimizing/instruction_simplifier_arm64.cc
compiler/optimizing/instruction_simplifier_arm64.h
compiler/optimizing/nodes.h
compiler/optimizing/nodes_arm64.h [new file with mode: 0644]
test/527-checker-array-access-split/expected.txt [new file with mode: 0644]
test/527-checker-array-access-split/info.txt [new file with mode: 0644]
test/527-checker-array-access-split/src/Main.java [new file with mode: 0644]