[PATCH] D67783: [WebAssembly] Remove unused memory instructions and patterns

Dan Gohman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 21 05:27:25 PDT 2019


sunfish added a comment.

This kind of thing ought to have helped code like

  extern int A[];
  
  int foo(long x) {
      return A[x];
  }

where instead of doing an `i32.add` to add `A` and `x<<2`, we could put the address of `A` in the offset of the `i32.load`. It's nice in theory, but in practice, the `.hasNoUnsignedWrap()` predicate is almost never something LLVM knows in practice, and I don't think the pattern is safe without it, because wasm load offset arithmetic doesn't wrap. So I'm ok removing these patterns.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67783





More information about the llvm-commits mailing list