[all-commits] [llvm/llvm-project] f9b384: [ARM] Fix crash in chained BFI combine due to inco...

Amara Emerson via All-commits all-commits at lists.llvm.org
Thu Jun 24 23:36:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f9b3840c3daf050d748f452a8105dfe661f8122e
      https://github.com/llvm/llvm-project/commit/f9b3840c3daf050d748f452a8105dfe661f8122e
  Author: Amara Emerson <amara at apple.com>
  Date:   2021-06-24 (Thu, 24 Jun 2021)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    A llvm/test/CodeGen/ARM/bfi-chain-cse-crash.ll

  Log Message:
  -----------
  [ARM] Fix crash in chained BFI combine due to incorrectly RAUW'ing a node.

For a bfi chain like:
a = bfi input, x, y
b = bfi a, x', y'

The previous code was RAUW'ing a with x, mutating the second 'b' bfi, and when
SelectionDAG's CSE code ended up deleting it unexpectedly, bad things happend.
There's no need to RAUW in this case because we can just return our newly
created replacement BFI node. It also looked incorrect because it didn't account
for other users of the 'a' bfi.

Since it seems that chains of more than 2 BFI nodes are hard/impossible to
produce without this combine kicking in at some point, I've removed that
functionality since it had no test coverage.

rdar://79095399

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




More information about the All-commits mailing list