[all-commits] [llvm/llvm-project] 68c1ee: [ArgPromotion] Make implementation offset based

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Feb 9 00:35:16 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 68c1eeb4bad18753dbaa053a6c919c8f1a23fb9c
      https://github.com/llvm/llvm-project/commit/68c1eeb4bad18753dbaa053a6c919c8f1a23fb9c
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-02-09 (Wed, 09 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
    M llvm/test/Transforms/ArgumentPromotion/align.ll
    M llvm/test/Transforms/ArgumentPromotion/bitcasts.ll
    M llvm/test/Transforms/ArgumentPromotion/fp80.ll
    A llvm/test/Transforms/ArgumentPromotion/opaque-ptr.ll

  Log Message:
  -----------
  [ArgPromotion] Make implementation offset based

This rewrites ArgPromotion to be based on offsets rather than GEP
structure. We inspect all loads at constant offsets and remember
which types are loaded at which offsets. Then we promote based on
those types.

This generalizes ArgPromotion to work with bitcasted loads, and
is compatible with opaque pointers.

This patch also fixes incorrect handling of alignment during
argument promotion. Previously, the implementation only checked
that the pointer is dereferenceable, but was happy to speculate
overaligned loads. (I would have fixed this separately in advance,
but I found this hard to do with the previous implementation
approach).

Differential Revision: https://reviews.llvm.org/D118685




More information about the All-commits mailing list