[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 07:42:41 PDT 2022
pengfei created this revision.
pengfei added reviewers: craig.topper, LuoYuanke, RKSimon, skan.
Herald added subscribers: jsji, StephenFan, hiraditya.
Herald added a project: All.
pengfei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
We will insert a new operand which is identical to the Dest for complex
FMUL with a mask. https://godbolt.org/z/eTEdnYv3q
Complex FMA and FMUL with maskz don't have this problem.
Repository:
rG LLVM Github Monorepo
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,10 @@
} 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;
+ 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.448040.patch
Type: text/x-patch
Size: 1367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220727/e3e253c5/attachment.bin>
More information about the llvm-commits
mailing list