[PATCH] D130638: [X86][MC] Avoid to emit fake warning for complex FMUL
Phoebe Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 27 08:16:27 PDT 2022
pengfei updated this revision to Diff 448047.
pengfei marked an inline comment as done.
pengfei added a comment.
Add comment.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130638/new/
https://reviews.llvm.org/D130638
Files:
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/test/MC/X86/avx512fp16.s
Index: llvm/test/MC/X86/avx512fp16.s
===================================================================
--- llvm/test/MC/X86/avx512fp16.s
+++ llvm/test/MC/X86/avx512fp16.s
@@ -1,4 +1,7 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple x86_64-unknown-unknown < %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-WARN
+
+// CHECK-NO-WARN-NOT: warning
// CHECK: vmovsh %xmm28, %xmm29, %xmm30
// CHECK: encoding: [0x62,0x05,0x16,0x00,0x10,0xf4]
Index: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -3847,7 +3847,12 @@
} else if (isVFCMULCPH(Opcode) || isVFCMULCSH(Opcode) || isVFMULCPH(Opcode) ||
isVFMULCSH(Opcode)) {
unsigned Dest = Inst.getOperand(0).getReg();
- for (unsigned i = 1; i < Inst.getNumOperands(); i++)
+ unsigned i = 1;
+ // Skip the identical operand with Dest for mask variant, e.g.:
+ // VFMULCPHZrrk Dest, Dest, Mask, Src1, Src2
+ if ((TSFlags & (X86II::EVEX_K | X86II::EVEX_Z)) == X86II::EVEX_K)
+ ++i;
+ for (; i < Inst.getNumOperands(); i++)
if (Inst.getOperand(i).isReg() && Dest == Inst.getOperand(i).getReg())
return Warning(Ops[0]->getStartLoc(), "Destination register should be "
"distinct from source registers");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130638.448047.patch
Type: text/x-patch
Size: 1489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220727/0107157f/attachment.bin>
More information about the llvm-commits
mailing list