Skip to content

Commit 1af0536

Browse files
committed
[X86] getShuffleComment - use MI description to determine AVX512 masked predicates instead of src index offsets.
1 parent daea082 commit 1af0536

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

llvm/lib/Target/X86/X86MCInstLower.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,16 +1448,11 @@ static std::string getShuffleComment(const MachineInstr *MI, unsigned SrcOp1Idx,
14481448
// Handle AVX512 MASK/MASXZ write mask comments.
14491449
// MASK: zmmX {%kY}
14501450
// MASKZ: zmmX {%kY} {z}
1451-
if (SrcOp1Idx > 1) {
1452-
assert((SrcOp1Idx == 2 || SrcOp1Idx == 3) && "Unexpected writemask");
1453-
1451+
if (X86II::isKMasked(MI->getDesc().TSFlags)) {
14541452
const MachineOperand &WriteMaskOp = MI->getOperand(SrcOp1Idx - 1);
1455-
if (WriteMaskOp.isReg()) {
1456-
CS << " {%" << GetRegisterName(WriteMaskOp.getReg()) << "}";
1457-
1458-
if (SrcOp1Idx == 2) {
1459-
CS << " {z}";
1460-
}
1453+
CS << " {%" << GetRegisterName(WriteMaskOp.getReg()) << "}";
1454+
if (!X86II::isKMergeMasked(MI->getDesc().TSFlags)) {
1455+
CS << " {z}";
14611456
}
14621457
}
14631458

0 commit comments

Comments
 (0)