[PATCH] D76966: [GlobalOpt/GlobalStatus][Mem2Reg] Handle PtrToInt passed as function call operand

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 19:17:52 PDT 2020


ddcc created this revision.
ddcc added a reviewer: jdoerfert.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
ddcc added a comment.

I'm not quite sure what the intended semantics for `inaccessiblememonly` and `readnone` are here. If a pointer operand is converted to an integer and passed as an argument to a function call, when can that pointer be optimized out? Does that function need to have either attribute, or does it not matter that an integer argument is casted from a pointer? This patch currently assumes that the attribute must still be present on the function (since it can't be set on a non-pointer argument).


Support optimizing calls to readnone function with ptrtoint operand in global variable optimization and mem2reg

Depends on: D76894 <https://reviews.llvm.org/D76894>, D76965 <https://reviews.llvm.org/D76965>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76966

Files:
  llvm/lib/Transforms/IPO/GlobalOpt.cpp
  llvm/lib/Transforms/Utils/GlobalStatus.cpp
  llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
  llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca2.ll
  llvm/test/Transforms/GlobalOpt/localize-fnattr.ll
  llvm/test/Transforms/Mem2Reg/fnattr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76966.253276.patch
Type: text/x-patch
Size: 6636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200328/d6d9fc55/attachment.bin>


More information about the llvm-commits mailing list