[PATCH] D89151: [X86] Don't copy kill flag when expanding LCMPXCHG16B_SAVE_RBX

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 11:56:36 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG662024df331b: [X86] Don't copy kill flag when expanding LCMPXCHG16B_SAVE_RBX (authored by craig.topper).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89151/new/

https://reviews.llvm.org/D89151

Files:
  llvm/lib/Target/X86/X86ExpandPseudo.cpp
  llvm/test/CodeGen/X86/pr42064.ll


Index: llvm/test/CodeGen/X86/pr42064.ll
===================================================================
--- llvm/test/CodeGen/X86/pr42064.ll
+++ llvm/test/CodeGen/X86/pr42064.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc19.11.0 -mattr=+avx,+cx16 | FileCheck %s
+; RUN: llc < %s -verify-machineinstrs -mtriple=x86_64-pc-windows-msvc19.11.0 -mattr=+avx,+cx16 | FileCheck %s
 
 %struct.TestStruct = type { %union.Int128 }
 %union.Int128 = type { i128 }
Index: llvm/lib/Target/X86/X86ExpandPseudo.cpp
===================================================================
--- llvm/lib/Target/X86/X86ExpandPseudo.cpp
+++ llvm/lib/Target/X86/X86ExpandPseudo.cpp
@@ -346,7 +346,9 @@
 
     // Copy the input argument of the pseudo into the argument of the
     // actual instruction.
-    TII->copyPhysReg(MBB, MBBI, DL, X86::RBX, InArg.getReg(), InArg.isKill());
+    // NOTE: We don't copy the kill flag since the input might be the same reg
+    // as one of the other operands of LCMPXCHG16B.
+    TII->copyPhysReg(MBB, MBBI, DL, X86::RBX, InArg.getReg(), false);
     // Create the actual instruction.
     MachineInstr *NewInstr = BuildMI(MBB, MBBI, DL, TII->get(X86::LCMPXCHG16B));
     // Copy the operands related to the address.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89151.297292.patch
Type: text/x-patch
Size: 1334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201009/99c96794/attachment.bin>


More information about the llvm-commits mailing list