Skip to content

Commit

Permalink
[X86] getShuffleComment - use MI description to determine AVX512 mask…
Browse files Browse the repository at this point in the history
…ed predicates instead of src index offsets.
  • Loading branch information
RKSimon committed Feb 5, 2024
1 parent daea082 commit 1af0536
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions llvm/lib/Target/X86/X86MCInstLower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1448,16 +1448,11 @@ static std::string getShuffleComment(const MachineInstr *MI, unsigned SrcOp1Idx,
// Handle AVX512 MASK/MASXZ write mask comments.
// MASK: zmmX {%kY}
// MASKZ: zmmX {%kY} {z}
if (SrcOp1Idx > 1) {
assert((SrcOp1Idx == 2 || SrcOp1Idx == 3) && "Unexpected writemask");

if (X86II::isKMasked(MI->getDesc().TSFlags)) {
const MachineOperand &WriteMaskOp = MI->getOperand(SrcOp1Idx - 1);
if (WriteMaskOp.isReg()) {
CS << " {%" << GetRegisterName(WriteMaskOp.getReg()) << "}";

if (SrcOp1Idx == 2) {
CS << " {z}";
}
CS << " {%" << GetRegisterName(WriteMaskOp.getReg()) << "}";
if (!X86II::isKMergeMasked(MI->getDesc().TSFlags)) {
CS << " {z}";
}
}

Expand Down

0 comments on commit 1af0536

Please sign in to comment.