[PATCH] [Polly][FIX] Collection of base values for the IslExprBuilder

Tobias Grosser tobias at grosser.es
Fri Sep 19 08:44:59 PDT 2014


On September 19, 2014 4:49:05 PM CEST, Johannes Doerfert <doerfert at cs.uni-saarland.de> wrote:
>Hi grosser, sebpop, dpeixott, simbuerg,
>
>  When we collect base values for the isl expression builder two corner
>  cases where not implemented before:
>   1) The memory access base value is invariant but still a load inside
>       the region. These invariant loads are allowed in ScopDetection
>       but need to be copied or moved if we want to use the loaded
>       pointer value for e.g., runtime alias checks. We now move the
>       load to the region entering block, basically licm for these kind
>       of instructions.
>   2) The IslExprBuilder doesn't know about types but assumes the value
>       and the offset is in the unit of the base pointers type (or
>       better the base pointers element type). This wasn't ensured
>       before in case the base pointer was e.g., a struct pointer type.
>      However, the offset provided by ScalarEvolution is already in the
>       correct unit (the memory access element type). We now cast the
>       base pointer into a pointer to the memory access element type.
>
>  Test cases for both situations are added and existing test cases
>  adjusted to the new type casting.
>
>http://reviews.llvm.org/D5414
>
>Files:
>  include/polly/ScopInfo.h
>  lib/Analysis/ScopInfo.cpp
>  lib/CodeGen/IslCodeGeneration.cpp
>  lib/CodeGen/IslExprBuilder.cpp
>  test/Isl/CodeGen/MemAccess/codegen_constant_offset.ll
>  test/Isl/CodeGen/MemAccess/codegen_simple.ll
>  test/Isl/CodeGen/MemAccess/codegen_simple_float.ll
>  test/Isl/CodeGen/MemAccess/codegen_simple_md.ll
>  test/Isl/CodeGen/MemAccess/codegen_simple_md_float.ll
>  test/Isl/CodeGen/aliasing_indirect_accesses.ll
>  test/Isl/CodeGen/aliasing_struct_elements.ll
>  test/Isl/CodeGen/aliasing_struct_elements_float.ll

Hi Johannes,

Just a quick comment. The patch makes sense, but we need to be careful to not perform loads that may not have been executed at all if they would have remained  in within the loop 



More information about the llvm-commits mailing list