[PATCH] D56761: Add a parameter to the objectsize intrinsic that controls whether to evaluate size dynamically

Erik Pilkington via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 16:53:11 PST 2019


erik.pilkington created this revision.
erik.pilkington added reviewers: george.burgess.iv, ahatanak, majnemer.
Herald added subscribers: dexonsmith, jkorous, hiraditya, nhaehnle, jvesely, arsenm.

This will be used by a new clang builtin `__builtin_dynamic_object_size`. This builtin is meant to be used as drop-in replacement for `__builtin_object_size`. When BDOS can't be folded statically, then it computes the object size at runtime. You can see the clang patch here: https://reviews.llvm.org/D56760

rdar://problem/32212419 ER: evaluate builtin_objectsize (or a successor) at runtime, at least when alloc_size is available

Thanks for taking a look!
Erik


Repository:
  rL LLVM

https://reviews.llvm.org/D56761

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm/Analysis/MemoryBuiltins.h
  llvm/include/llvm/IR/Intrinsics.td
  llvm/lib/Analysis/MemoryBuiltins.cpp
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/IR/AutoUpgrade.cpp
  llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp
  llvm/test/Assembler/auto_upgrade_intrinsics.ll
  llvm/test/CodeGen/AMDGPU/promote-alloca-mem-intrinsics.ll
  llvm/test/CodeGen/X86/is-constant.ll
  llvm/test/Other/cgscc-libcall-update.ll
  llvm/test/Transforms/CodeGenPrepare/basic.ll
  llvm/test/Transforms/CodeGenPrepare/crash-on-large-allocas.ll
  llvm/test/Transforms/InferAddressSpaces/AMDGPU/intrinsics.ll
  llvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll
  llvm/test/Transforms/InstCombine/invoke.ll
  llvm/test/Transforms/InstCombine/memset_chk-1.ll
  llvm/test/Transforms/InstCombine/objsize.ll
  llvm/test/Transforms/InstCombine/stpcpy_chk-1.ll
  llvm/test/Transforms/InstCombine/strcpy_chk-1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56761.181916.patch
Type: text/x-patch
Size: 43543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190116/79f1fb41/attachment.bin>


More information about the llvm-commits mailing list