[PATCH] D82876: [Alignment][NFC] Migrate TargetTransformInfo::allowsMisalignedMemoryAccesses to Align
Clement Courbet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 30 08:06:43 PDT 2020
courbet added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:898
TLI.allowsMisalignedMemoryAccesses(
- VT, DstAS, Op.isFixedDstAlign() ? Op.getDstAlign().value() : 0,
+ VT, DstAS, Op.isFixedDstAlign() ? Op.getDstAlign() : Align(1),
MachineMemOperand::MONone, &Fast) &&
----------------
gchatelet wrote:
> [`allowsMisalignedMemoryAccesses`](https://github.com/llvm/llvm-project/blob/70f6389257a85a8fa7f128a05a1ccbd0dbba191c/llvm/include/llvm/CodeGen/TargetLowering.h#L1576) can only consider valid alignment. `0` here is not a valid value, that's why it is turned into a `1`.
This is not necessarily and NFC (see my other comment below).
================
Comment at: llvm/lib/Target/ARM/ARMISelLowering.cpp:16150
if ((Ty == MVT::v4i8 || Ty == MVT::v8i8 || Ty == MVT::v4i16) &&
Alignment >= VT.getScalarSizeInBits() / 8) {
if (Fast)
----------------
When `alignment` was `0`, and `v8i8`, this is not an NFC.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82876/new/
https://reviews.llvm.org/D82876
More information about the llvm-commits
mailing list