[PATCH] D64203: [OpaquePtr] add Type parameter to Loads.h analysis API.

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 04:37:12 PDT 2019


t.p.northover created this revision.
t.p.northover added a reviewer: dblaikie.
Herald added subscribers: asbirlea, hiraditya, mcrosier.
Herald added a project: LLVM.

As part of getting the rest of LLVM ready for opaque pointers, this adds a mandatory type/size argument to the analysis APIs in Loads.h (to avoid relying on `V->getPointerElementType()`).

Most callers already had a memory instruction locally they could use to provide this parameter, but two (SROA and ArgumentPromotion) were doing a more complicated analysis. I updated them to track the combined properties of the loads they are tracking.

Some of the logic is currently trivial (if one load has type `T` then all loads of that value will) but this implementation should be robust even when that's false and saves updating them twice.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64203

Files:
  llvm/include/llvm/Analysis/Loads.h
  llvm/lib/Analysis/Loads.cpp
  llvm/lib/Analysis/MemDerefPrinter.cpp
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  llvm/lib/Transforms/Scalar/LICM.cpp
  llvm/lib/Transforms/Scalar/MergeICmps.cpp
  llvm/lib/Transforms/Scalar/SROA.cpp
  llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64203.208016.patch
Type: text/x-patch
Size: 19748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190704/930de4e6/attachment.bin>


More information about the llvm-commits mailing list