During lowering we try to combine 2 loads with the same opcodes and operands but different flags on the MMO which triggers the assertion 'llvm::MachineMemOperand::refineAlignment(const llvm::MachineMemOperand*): Assertion MMO->getFlags() == getFlags() && "Flags mismatch!"' failed.
The initial selection dag ends up with 2 LD16s of 'FrameIndex 1 + 80' but one MMO has the dereferenceable flag and one does not.
t20: ch = lifetime.start t17, TargetFrameIndex:i64<0>
t46: i64 = add FrameIndex:i64<1>, Constant:i64<80>
t47: v4i32,ch = load<LD16[%0+80](align=8)(dereferenceable)> t20, t46, undef:i64
t50: ch = TokenFactor t24:1, t25, t28:1, t30, t32:1, t34, t37:1, t39, t42:1, t44, t47:1, t49
t69: v4i32,ch = load<LD16[FixedStack1+80](align=8)> t50, t46, undef:i64
While trying to lower t47 to a target specific LXVD2X we end up looking up the already lowered node for t69 which now has the same operands and we assert when trying to refine the alignment between the 2 MMOs.
I've added the subclass data to the FoldingSetNode for MemIntrinsicSDNodes which will make the relevant flags part of its signature.