[PATCH] D105398: [SCEVExpander] Support opaque pointers

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 3 11:52:05 PDT 2021


nikic created this revision.
nikic added a reviewer: opaque-pointers.
Herald added subscribers: dexonsmith, javed.absar, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105398

Files:
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
  llvm/test/Transforms/LoopStrengthReduce/opaque-ptr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105398.356352.patch
Type: text/x-patch
Size: 10610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210703/c5992d7b/attachment.bin>


More information about the llvm-commits mailing list