[SelectionDAG] Remove deprecated MemSDNode->getAlignment()
authorAlex Richardson <alexrichardson@google.com>
Mon, 21 Nov 2022 12:46:00 +0000 (12:46 +0000)
committerAlex Richardson <alexrichardson@google.com>
Wed, 23 Nov 2022 09:04:42 +0000 (09:04 +0000)
commit88218d5c5282c7b13bee667a0ce975a540aed74c
tree181abd98373438ad0db81a97a4d008cc42cf1ef2
parent64f5fedb59e82a79c0c669c3d6591ca9eadb82fb
[SelectionDAG] Remove deprecated MemSDNode->getAlignment()

I noticed a an assertion error when building MIPS code that loaded from
NULL. Loading from NULL ends up being a load with maximum alignment, and
due to integer truncation the value maximum was interpreted as 0 and the
assertion in MipsDAGToDAGISel::Select() failed. This previously happened
to work, but the maximum alignment was increased in
df84c1fe78130a86445d57563dea742e1b85156a, so it no longer fits into a 32
bit integer.
Instead of just fixing the one MIPS case, this patch removes all uses of
the deprecated getAlignment() call and replaces them with getAlign().

Differential Revision: https://reviews.llvm.org/D138420
13 files changed:
llvm/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/include/llvm/Target/TargetSelectionDAG.td
llvm/lib/Target/AMDGPU/R600ISelLowering.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.td
llvm/lib/Target/ARM/ARMInstrMVE.td
llvm/lib/Target/ARM/ARMInstrNEON.td
llvm/lib/Target/ARM/ARMInstrVFP.td
llvm/lib/Target/M68k/M68kInstrInfo.td
llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.td
llvm/lib/Target/X86/X86InstrFragmentsSIMD.td
llvm/lib/Target/X86/X86InstrInfo.td
llvm/test/CodeGen/Mips/load-max-alignment.ll [new file with mode: 0644]