[PATCH] D116971: [AttributorAttributes] Remove hardcoded parameters

Bryce Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 13:45:05 PST 2022


Bryce-MW created this revision.
Herald added subscribers: ormris, okura, jdoerfert, kuter, uenoku, hiraditya.
Herald added a reviewer: uenoku.
Bryce-MW requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Following up with some of the recent refactoring of MemoryBuiltins, the size and allignment parameters used in heap-to-stack can be removed. This allows heap-to-stack to work with any allocation functions (that allocate undefined or zeroed memory). The alignment is important now because in the past, aligned operator new may not create a properly aligned allocation when being moved to the stack.

There are however a few remaining issues that I would apprecitate someone looking at.

- Is it possible to get away without adding getAllocSizeArgs to MemoryBuiltins. Based on some email conversations that I have had, getObjectSize would be prefered but in this case, we want to get the size arguments even if actual size is not a known constant. It's also used to get one of the types for the memset on line 5999. I don't fully understand what that type is doing so there may be a better way to do that.
- If the alignment is specified but is not a known constant, I use the maximum alignment as the alignment. Is this acceptable or should we use the minimum alignment or perhaps there is some way or change that could allow the alignment to be dynamic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116971

Files:
  llvm/include/llvm/Analysis/MemoryBuiltins.h
  llvm/lib/Analysis/MemoryBuiltins.cpp
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116971.398732.patch
Type: text/x-patch
Size: 8823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220110/7daa473f/attachment.bin>


More information about the llvm-commits mailing list