Skip to content

[AArch64] Clarify that Anyext is OK for MOPS instructions. NFC #70298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,8 @@ bool AArch64LegalizerInfo::legalizeIntrinsic(LegalizerHelper &Helper,
}
case Intrinsic::aarch64_mops_memset_tag: {
assert(MI.getOpcode() == TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS);
// Zext the value to 64 bit
// Anyext the value being set to 64 bit (only the bottom 8 bits are read by
// the instruction).
MachineIRBuilder MIB(MI);
auto &Value = MI.getOperand(3);
Register ZExtValueReg = MIB.buildAnyExt(LLT::scalar(64), Value).getReg(0);
Expand Down Expand Up @@ -1776,7 +1777,8 @@ bool AArch64LegalizerInfo::legalizeMemOps(MachineInstr &MI,

// Tagged version MOPSMemorySetTagged is legalised in legalizeIntrinsic
if (MI.getOpcode() == TargetOpcode::G_MEMSET) {
// Zext the value operand to 64 bit
// Anyext the value being set to 64 bit (only the bottom 8 bits are read by
// the instruction).
auto &Value = MI.getOperand(1);
Register ZExtValueReg =
MIRBuilder.buildAnyExt(LLT::scalar(64), Value).getReg(0);
Expand Down