[all-commits] [llvm/llvm-project] a2f6ae: [InstCombine] Fold PHIs with equal incoming pointers

Daniil Suchkov via All-commits all-commits at lists.llvm.org
Thu Nov 14 02:05:40 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a2f6ae9abffcba260c22bb235879f0576bf3b783
      https://github.com/llvm/llvm-project/commit/a2f6ae9abffcba260c22bb235879f0576bf3b783
  Author: Daniil Suchkov <suc-daniil at yandex.ru>
  Date:   2019-11-14 (Thu, 14 Nov 2019)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
    M llvm/test/Transforms/InstCombine/phi-equal-incoming-pointers.ll

  Log Message:
  -----------
  [InstCombine] Fold PHIs with equal incoming pointers

This is a resubmission of bbb29738b58aaf6f6518269abdcf8f64131665a9 that
was reverted due to clang tests failures. It includes the fix and
additional IR tests for the missed case.

Summary:
In case when all incoming values of a PHI are equal pointers, this
transformation inserts a definition of such a pointer right after
definition of the base pointer and replaces with this value both PHI and
all it's incoming pointers. Primary goal of this transformation is
canonicalization of this pattern in order to enable optimizations that
can't handle PHIs. Non-inbounds pointers aren't currently supported.

Reviewers: spatel, RKSimon, lebedev.ri, apilipenko

Reviewed By: apilipenko

Tags: #llvm

Subscribers: hiraditya, llvm-commits

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




More information about the All-commits mailing list