[PATCH] D121879: [X86] Set Int_MemBarrier as a meta-instruction

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 22:12:35 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1a70febf825f: [X86] Set Int_MemBarrier as a meta-instruction (authored by skan).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121879

Files:
  llvm/lib/Target/X86/X86InstrCompiler.td
  llvm/test/DebugInfo/X86/dwarf-mem-barrier.ll
  llvm/unittests/MIR/MachineMetadata.cpp


Index: llvm/unittests/MIR/MachineMetadata.cpp
===================================================================
--- llvm/unittests/MIR/MachineMetadata.cpp
+++ llvm/unittests/MIR/MachineMetadata.cpp
@@ -332,6 +332,7 @@
   LIFETIME_END 0
   PSEUDO_PROBE 6699318081062747564, 1, 0, 0
   $xmm0 = ARITH_FENCE $xmm0
+  Int_MemBarrier
 ...
 )MIR";
 
Index: llvm/test/DebugInfo/X86/dwarf-mem-barrier.ll
===================================================================
--- /dev/null
+++ llvm/test/DebugInfo/X86/dwarf-mem-barrier.ll
@@ -0,0 +1,31 @@
+; Check .loc directive is emitted at correct position
+; RUN: llc -O0 -mtriple x86_64-linux-gnu <%s | FileCheck %s
+
+; CHECK:	#MEMBARRIER
+; CHECK:	#MEMBARRIER
+; CHECK:	movl	$0, -4(%rsp)
+; CHECK:	.loc	1 1 14 prologue_end             # none.c:1:14
+
+define dso_local i32 @main() !dbg !7 {
+entry:
+  fence acquire, !dbg !9
+  fence release, !dbg !9
+  %retval = alloca i32, align 4
+  store i32 0, i32* %retval, align 4
+  ret i32 0, !dbg !9
+}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: DebugDirectivesOnly, enums: !2, splitDebugInlining: false, nameTableKind: None)
+!1 = !DIFile(filename: "none.c", directory: "/temp")
+!2 = !{}
+!3 = !{i32 2, !"Tracing", i32 1}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{!"clang version 11.0.0"}
+!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!8 = !DISubroutineType(types: !2)
+!9 = !DILocation(line: 1, column: 14, scope: !7)
Index: llvm/lib/Target/X86/X86InstrCompiler.td
===================================================================
--- llvm/lib/Target/X86/X86InstrCompiler.td
+++ llvm/lib/Target/X86/X86InstrCompiler.td
@@ -670,7 +670,7 @@
                          Requires<[Not64BitMode]>, OpSize32, LOCK,
                          Sched<[WriteALURMW]>;
 
-let hasSideEffects = 1 in
+let hasSideEffects = 1, isMeta = 1 in
 def Int_MemBarrier : I<0, Pseudo, (outs), (ins),
                      "#MEMBARRIER",
                      [(X86MemBarrier)]>, Sched<[WriteLoad]>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121879.416389.patch
Type: text/x-patch
Size: 2301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220318/2b92e4b2/attachment.bin>


More information about the llvm-commits mailing list