[Attributor] Move heap2stack allocas to the entry block if possible
authorJohannes Doerfert <johannes@jdoerfert.de>
Fri, 1 Jul 2022 19:35:10 +0000 (14:35 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Sat, 2 Jul 2022 02:34:12 +0000 (21:34 -0500)
commit07766f4070301072840b92c02c215391c7b5a870
tree98900f4ae343ef95dec4ba6827177c31e0bdf490
parentb52d33e6de554fbabb6e80c661c4272a900daece
[Attributor] Move heap2stack allocas to the entry block if possible

If we are certainly not in a loop we can directly emit the heap2stack
allocas in the function entry block. This will help to get rid of them
(SROA) and avoid stacksave/restore intrinsics when the function is
inlined.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
llvm/test/Transforms/OpenMP/spmdization.ll