[PATCH] D35471: [Polly] [RFC] Calculate AST expression type

Maximilian Falkenstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 16 19:36:02 PDT 2017


maxf created this revision.
Herald added a reviewer: bollu.

(This is a work-in-progress, feedback is welcome).
Until now, Polly always uses 64 bits for each expression as there is no
way to figure out the correct type. This patch changes the behavour:

- (isl) At AST generation time the type of each AST expression is calculated. In the base case, this is the exact minimal type, optionally types can be approximated to reduce compile-time overhead
- (isl) During this phase, we now take the concept of the 'biggest native type' into account. The biggest native type (fixed 64 bit atm) is the largest type we *want* to generate. Whenever an expression exceeds this size, a precondition is generated that, when satisfied, assures that the biggest native type is enough to hold said expression

Polly then uses this information to:

- Take all preconditions into account when creating the run condition of a SCoP
- Use a correct type for each expression. The default behaviour at the moment is to still use 64 bits per default to save on sext's.

The isl part of this patch has been partially discussed previously on
the isl mailinglist. Before upstreaming this into isl, we need to agree
on an interface, therefore it seems resonable to also put this on
Phabricator.


https://reviews.llvm.org/D35471

Files:
  include/polly/CodeGen/IslAst.h
  include/polly/CodeGen/IslExprBuilder.h
  lib/CodeGen/IslAst.cpp
  lib/CodeGen/IslExprBuilder.cpp
  lib/CodeGen/IslNodeBuilder.cpp
  lib/CodeGen/LoopGenerators.cpp
  lib/External/isl/codegen.c
  lib/External/isl/include/isl/ast.h
  lib/External/isl/include/isl/ast_build.h
  lib/External/isl/include/isl/ast_type.h
  lib/External/isl/include/isl/stream.h
  lib/External/isl/include/isl/val.h
  lib/External/isl/isl_ast.c
  lib/External/isl/isl_ast_build.c
  lib/External/isl/isl_ast_build_expr.c
  lib/External/isl/isl_ast_build_expr.h
  lib/External/isl/isl_ast_build_private.h
  lib/External/isl/isl_ast_codegen.c
  lib/External/isl/isl_ast_graft.c
  lib/External/isl/isl_ast_graft_private.h
  lib/External/isl/isl_ast_private.h
  lib/External/isl/isl_gmp.c
  lib/External/isl/isl_imath.c
  lib/External/isl/isl_int_gmp.h
  lib/External/isl/isl_int_imath.h
  lib/External/isl/isl_int_sioimath.c
  lib/External/isl/isl_int_sioimath.h
  lib/External/isl/isl_options.c
  lib/External/isl/isl_options_private.h
  lib/External/isl/isl_test.c
  lib/External/isl/isl_val.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35471.106830.patch
Type: text/x-patch
Size: 94779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170717/50dbf44f/attachment.bin>


More information about the llvm-commits mailing list