[PATCH] D131387: [WebAssembly] Produce error when encountering unlowerable Wasm global accesses

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 10:37:13 PDT 2022


asb added inline comments.


================
Comment at: llvm/test/CodeGen/WebAssembly/global-set-unlowerable.ll:22
+  %sel = phi ptr addrspace(1) [ @g1, %entry ], [ @g2, %if.then.i ]
+  store i32 100, ptr addrspace(1) %sel
+  ret void
----------------
sbc100 wrote:
> Do these examples need to be this complex?  Can you just elide of the branching?  Why do we need to to different globals?
I've simplified from `phi` to `select`. The reason for two globals is the test case needs to demonstrate a case where the current ISel code won't match. Loading/storing a single global will work fine.

Arguably we should have coverage for loading/storing a global after getelementptr on it for completeness, but unlike these test cases that code _shouldn't_ occur unless the frontend fails to obey the semantic restrictions.


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

https://reviews.llvm.org/D131387



More information about the llvm-commits mailing list