OSDN Git Service

AMDGPU: Fix maximum instruction size for amdgcn
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 16 Jun 2016 21:14:05 +0000 (21:14 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 16 Jun 2016 21:14:05 +0000 (21:14 +0000)
This was causing the conservative estimate of inline asm
size to be twice as big as expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272956 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp

index 4bc80a0..d7eb9f9 100644 (file)
@@ -9,12 +9,14 @@
 //===----------------------------------------------------------------------===//
 
 #include "AMDGPUMCAsmInfo.h"
+#include "llvm/ADT/Triple.h"
 
 using namespace llvm;
+
 AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(const Triple &TT) : MCAsmInfoELF() {
   HasSingleParameterDotFile = false;
   //===------------------------------------------------------------------===//
-  MaxInstLength = 16;
+  MaxInstLength = (TT.getArch() == Triple::amdgcn) ? 8 : 16;
   SeparatorString = "\n";
   CommentString = ";";
   PrivateLabelPrefix = "";