[all-commits] [llvm/llvm-project] d1dd1f: [WebAssembly] Fix FastISel of condition in differe...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Aug 31 20:58:54 PDT 2021


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: d1dd1fb104a68f365da67e4a8496e5e5c9b2ade9
      https://github.com/llvm/llvm-project/commit/d1dd1fb104a68f365da67e4a8496e5e5c9b2ade9
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-08-31 (Tue, 31 Aug 2021)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
    A llvm/test/CodeGen/WebAssembly/pr51651.ll

  Log Message:
  -----------
  [WebAssembly] Fix FastISel of condition in different block (PR51651)

If the icmp is in a different block, then the register for the icmp
operand may not be initialized, as it nominally does not have
cross-block uses. Add a check that the icmp is in the same block
as the branch, which should be the common case.

This matches what X86 FastISel does:
https://github.com/llvm/llvm-project/blob/5b6b090cf2129228f05d7d0f504676b67f7524cf/llvm/lib/Target/X86/X86FastISel.cpp#L1648

The "not" transform that could have a similar issue is dropped
entirely, because it is currently dead: The incoming value is
a branch or select condition of type i1, but this code requires
an i32 to trigger.

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

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

(cherry picked from commit 16086d47c0d0cd08ffae8e69a69c88653e654d01)




More information about the All-commits mailing list