[PATCH] D70392: [Attributor] Track a GEP Instruction in align deduction

Hideto Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 05:54:42 PST 2019


uenoku created this revision.
uenoku added reviewers: jdoerfert, sstefan1.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

This patch enables us to track GEP instruction in align deduction. 
If a pointer `B` is defined as `A+Offset` and known to have alignment `C`, there exists some integer Q such that

  A + Offset = C * Q = B

So we can say that the maximum power of two which is a divisor of gcd(Offset, C) is an alignment.


https://reviews.llvm.org/D70392

Files:
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/test/Transforms/FunctionAttrs/align.ll
  llvm/test/Transforms/FunctionAttrs/arg_nocapture.ll
  llvm/test/Transforms/FunctionAttrs/nocapture.ll
  llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70392.229821.patch
Type: text/x-patch
Size: 5314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191118/dd588404/attachment.bin>


More information about the llvm-commits mailing list