[PATCH] [PATCH][SROA]Also slice the STORE when slicing a LOAD in AllocaSliceRewriter

Hao Liu Hao.Liu at arm.com
Mon Aug 18 03:29:50 PDT 2014


Hi chandlerc,

Hi,

When SROA AllocaSliceRewriter tries to slice a load, if the loaded value is stored directly, currently we'll generate some redundant IR like ZEXT, SHL, AND, OR.

For the example in my patch:
    %2 = load i64* %ref.tmp, align 8
    store i64 %2, i64* %1, align 4
The load will be sliced into two i32 loads, and such two i32 will be combined into a i64 by ZEXT, SHL, AND, OR, and then it will be stored. But if we slice the i64 store into two i32 store, such additional operations won't be necessary.

This patch tries to find out and slice such STORE when slicing a LOAD.

Review please.

Thanks,
-Hao

http://reviews.llvm.org/D4954

Files:
  lib/Transforms/Scalar/SROA.cpp
  test/Transforms/SROA/slice-load-store.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4954.12614.patch
Type: text/x-patch
Size: 6895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140818/97dd86b8/attachment.bin>


More information about the llvm-commits mailing list