[PATCH] D101100: [ConstFold] Simplify a load's GEP operand through local aliases

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 12:26:27 PDT 2021


aeubanks created this revision.
aeubanks added reviewers: rnk, pcc, nikic.
Herald added subscribers: dexonsmith, hiraditya, Prazek.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

MSVC-style RTTI produces loads through a GEP of a local alias which
itself is a GEP. Currently we aren't able to devirtualize any virtual
calls when MSVC RTTI is enabled.

This patch attempts to simplify a load's GEP operand by calling
SymbolicallyEvaluateGEP() with an option to look through local aliases.
This calls for a new pointer stripping method which can look through
local aliases, but cannot look through zero-indices GEPs since we need
to preserve GEP indices to pass to
ConstantFoldLoadThroughGEPConstantExpr().


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101100

Files:
  llvm/include/llvm/IR/Value.h
  llvm/lib/Analysis/ConstantFolding.cpp
  llvm/lib/IR/Value.cpp
  llvm/test/Transforms/InstSimplify/ConstProp/gep-alias-gep-load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101100.339756.patch
Type: text/x-patch
Size: 7275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210422/839f5dee/attachment.bin>


More information about the llvm-commits mailing list