[PATCH] D31058: Store Arguments in a flat array instead of an iplist

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 14:57:28 PDT 2017


rnk created this revision.

This saves two pointers from Argument and eliminates some extra
allocations.

Arguments cannot be inserted or removed from a Function because that
would require changing its Type, which LLVM does not allow. Instead,
passes that change prototypes, like DeadArgElim, create a new Function
and copy over argument names and attributes. The primary benefit of
iplist is O(1) random insertion and removal. We just don't need that for
arguments, so don't use it.


https://reviews.llvm.org/D31058

Files:
  include/llvm/IR/Argument.h
  include/llvm/IR/Function.h
  lib/IR/Core.cpp
  lib/IR/Function.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31058.92065.patch
Type: text/x-patch
Size: 10261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170316/82238cdc/attachment.bin>


More information about the llvm-commits mailing list