[all-commits] [llvm/llvm-project] 8b89bc: [WebAssembly] Don't fold frame offset for global a...

Tom Stellard via All-commits all-commits at lists.llvm.org
Tue Dec 1 13:57:10 PST 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b89bc0de0e190be04991a9622c5866a2e93ef6d
      https://github.com/llvm/llvm-project/commit/8b89bc0de0e190be04991a9622c5866a2e93ef6d
  Author: Julien Jorge <jjorge at quarkslab.com>
  Date:   2020-12-01 (Tue, 01 Dec 2020)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
    M llvm/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp
    M llvm/test/CodeGen/WebAssembly/userstack.ll

  Log Message:
  -----------
  [WebAssembly] Don't fold frame offset for global addresses

When machine instructions are in the form of
```
%0 = CONST_I32 @str
%1 = ADD_I32 %stack.0, %0
%2 = LOAD 0, 0, %1
```

In the `ADD_I32` instruction, it is possible to fold it if `%0` is a
`CONST_I32` from an immediate number. But in this case it is a global
address, so we shouldn't do that. But we haven't checked if the operand
of `ADD` is an immediate so far. This fixes the problem. (The case
applies the same for `ADD_I64` and `CONST_I64` instructions.)

Fixes https://bugs.llvm.org/show_bug.cgi?id=47944.

Patch by Julien Jorge (jjorge at quarkslab.com)

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D90577

(cherry picked from commit 0fca6517118d435f9c2d7afe6135fd5f357509b5)




More information about the All-commits mailing list