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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 00:48:48 PDT 2015


arsenm created this revision.
arsenm added reviewers: tstellarAMD, rampitec.
arsenm added a subscriber: llvm-commits.

The test should need an update / serve as the test forD11969

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,36 @@
+; 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 !16
+}
+
+attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
+!llvm.dbg.cu = !{!0}
+!opencl.kernels = !{!7}
+!llvm.module.flags = !{!13, !14}
+!llvm.ident = !{!15}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 244715) (llvm/trunk 244718)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, 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 = !{void ()* @basic_debug_info, !8, !9, !10, !11, !12}
+!8 = !{!"kernel_arg_addr_space"}
+!9 = !{!"kernel_arg_access_qual"}
+!10 = !{!"kernel_arg_type"}
+!11 = !{!"kernel_arg_base_type"}
+!12 = !{!"kernel_arg_type_qual"}
+!13 = !{i32 2, !"Dwarf Version", i32 4}
+!14 = !{i32 2, !"Debug Info Version", i32 3}
+!15 = !{!"clang version 3.8.0 (trunk 244715) (llvm/trunk 244718)"}
+!16 = !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.31905.patch
Type: text/x-patch
Size: 2647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150812/92c70bb1/attachment.bin>


More information about the llvm-commits mailing list