[PATCH] D101045: [IR][Verifier] Allow alloca outside alloca address space

Andy Wingo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 23:55:54 PDT 2021


wingo added a comment.

I posted https://reviews.llvm.org/D101140 just for context -- based on this patch, and @pmatos's work on https://reviews.llvm.org/D95425.

In D101045#2709494 <https://reviews.llvm.org/D101045#2709494>, @tlively wrote:

> @wingo, have you investigated what would happen if we tried to use the normal stack address space in IR, but extracted reftype stack slots into a separate stack in the WebAssembly backend, perhaps specifically in `WebAssemblyFrameLowering::emit{Prologue,Epilogue}`?

Humm, good question.  The issue as I understand it would be that letting reference-typed values slide all the way to frame lowering would be what to do with uses of the alloca at instruction-selection time.  For i32 locals, isel lowersa `(set i32:$dst (load frameindex:$idx))` to i32.load, but what would we do for externref values?

But if we took the same solution as in my downstream patch, maybe keeping the alloca in AS 0 might with, where the ElementType is our AS 1 externref representation.  Though, I do wonder what risk we might be introducing with regards to optimizations / transformations thinking that the pointer has a size and can be written to linear memory.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101045/new/

https://reviews.llvm.org/D101045



More information about the llvm-commits mailing list