[PATCH] D11972: AMDGPU: Set MCAsmInfo::PointerSize

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 12:48:33 PDT 2015


arsenm updated this revision to Diff 32988.
arsenm added a comment.
Herald added a subscriber: arsenm.

Remove extra metadata


http://reviews.llvm.org/D11972

Files:
  lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp
  test/CodeGen/AMDGPU/basic-debug-info.ll

Index: test/CodeGen/AMDGPU/basic-debug-info.ll
===================================================================
--- /dev/null
+++ test/CodeGen/AMDGPU/basic-debug-info.ll
@@ -0,0 +1,27 @@
+; RUN: llc -march=amdgcn -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s
+
+; FIXME: Should be .byte 8 for pointer size
+
+; CHECK-LABEL: {{^}}basic_debug_info:
+; CHECK: .section	.debug_info
+; CHECK: .byte	4                               ; Address Size (in bytes)
+define void @basic_debug_info() #0 {
+entry:
+  ret void, !dbg !9
+}
+
+attributes #0 = { nounwind }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!7, !8}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: 0, enums: !2, subprograms: !3)
+!1 = !DIFile(filename: "/tmp/basic-debug-info.cl", directory: "/Users/matt/src/llvm/build_debug")
+!2 = !{}
+!3 = !{!4}
+!4 = !DISubprogram(name: "basic_debug_info", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, function: void ()* @basic_debug_info, variables: !2)
+!5 = !DISubroutineType(types: !6)
+!6 = !{null}
+!7 = !{i32 2, !"Dwarf Version", i32 4}
+!8 = !{i32 2, !"Debug Info Version", i32 3}
+!9 = !DILocation(line: 4, column: 1, scope: !4)
Index: lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp
===================================================================
--- lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp
+++ lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp
@@ -9,9 +9,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "AMDGPUMCAsmInfo.h"
+#include "llvm/ADT/Triple.h"
 
 using namespace llvm;
+
 AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(const Triple &TT) : MCAsmInfoELF() {
+  PointerSize = (TT.getArch() == Triple::amdgcn) ? 8 : 4;
   HasSingleParameterDotFile = false;
   //===------------------------------------------------------------------===//
   MaxInstLength = 16;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11972.32988.patch
Type: text/x-patch
Size: 1975 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150824/e83c4c88/attachment.bin>


More information about the llvm-commits mailing list