[all-commits] [llvm/llvm-project] 870f39: Fix assertion failure in getMemOperandWithOffsetWidth

Kristof Beyls via All-commits all-commits at lists.llvm.org
Tue Dec 17 03:03:36 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 870f39d310d6a575fb5d303f4027e988bec9e78e
      https://github.com/llvm/llvm-project/commit/870f39d310d6a575fb5d303f4027e988bec9e78e
  Author: Kristof Beyls <kristof.beyls at arm.com>
  Date:   2019-12-17 (Tue, 17 Dec 2019)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetInstrInfo.h
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    M llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
    M llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
    M llvm/lib/Target/Lanai/LanaiInstrInfo.cpp
    M llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
    M llvm/lib/Target/X86/X86InstrInfo.cpp
    A llvm/test/CodeGen/AArch64/machine-sink-getmemoperandwithoffset.mir

  Log Message:
  -----------
  Fix assertion failure in getMemOperandWithOffsetWidth

This fixes an assertion failure that triggers inside
getMemOperandWithOffset when Machine Sinking calls it on a MachineInstr
that is not a memory operation.

Different backends implement getMemOperandWithOffset differently: some
return false on non-memory MachineInstrs, others assert.

The Machine Sinking pass in at least SinkingPreventsImplicitNullCheck
relies on getMemOperandWithOffset to return false on non-memory
MachineInstrs, instead of asserting.

This patch updates the documentation on getMemOperandWithOffset that it
should return false on any MachineInstr it cannot handle, instead of
asserting. It also adapts the in-tree backends accordingly where
necessary.

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




More information about the All-commits mailing list