[all-commits] [llvm/llvm-project] 84c15b: [SCEVExpander] Support opaque pointers

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Jul 7 11:50:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 84c15bc018fa2b64f36790ae06f76c418a5407ad
      https://github.com/llvm/llvm-project/commit/84c15bc018fa2b64f36790ae06f76c418a5407ad
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-07-07 (Wed, 07 Jul 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    A llvm/test/Transforms/LoopStrengthReduce/opaque-ptr.ll

  Log Message:
  -----------
  [SCEVExpander] Support opaque pointers

This adds support for opaque pointers to expandAddToGEP() by always
generating an i8 GEP for opaque pointers. After looking at some other
cases (constexpr GEP folding, SROA GEP generation), I've come around
to the idea that we should use i8 GEPs for opaque pointers, because
the alternative would be to guess a GEP type from surrounding code,
which will not be reliable. Ultimately, i8 GEPs is where we want to
end up anyway, and opaque pointers just make that the natural choice.

There are a couple of other places in SCEVExpander that check pointer
element types, I plan to update those when I run across usable test
coverage that doesn't assert elsewhere.

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




More information about the All-commits mailing list