[llvm] [X86] Resolve FIXME: Add FPCW as a rounding control register (PR #82452)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 21:36:56 PST 2024
================
@@ -115,7 +115,9 @@ bool WaitInsert::runOnMachineFunction(MachineFunction &MF) {
// If the following instruction is an X87 instruction and isn't an X87
// non-waiting control instruction, we can omit insert wait instruction.
MachineBasicBlock::iterator AfterMI = std::next(MI);
- if (AfterMI != MBB.end() && X86::isX87Instruction(*AfterMI) &&
+ if (AfterMI != MBB.end() && !AfterMI->isCall() &&
+ !AfterMI->isTerminator() && !AfterMI->isReturn() &&
+ !AfterMI->isInlineAsm() && X86::isX87Instruction(*AfterMI) &&
----------------
phoebewang wrote:
The `isTerminator` and `isReturn` are covered by `isX87Instruction`.
The `isInlineAsm` may not needed because we don't support x87 operand in inline asm IIRC.
The goal to move `isCall` to `isX87Instruction` because we call it in other places. All will be affected by this patch. It's better than adding `isCall` every where.
https://github.com/llvm/llvm-project/pull/82452
More information about the llvm-commits
mailing list