view lib/Target/R600/AMDGPUMachineFunction.cpp @ 20:a5b470e0d09d

set FastCC(Calling Convention) when the function is code segment and set GuaranteedTailCallOpt. but llvm still output not jmp but call...
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Sun, 06 Oct 2013 18:16:15 +0900
parents 9ad51c7bc036
children
line wrap: on
line source

#include "AMDGPUMachineFunction.h"
#include "AMDGPU.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Function.h"

namespace llvm {

const char *AMDGPUMachineFunction::ShaderTypeAttribute = "ShaderType";

AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
    MachineFunctionInfo() {
  ShaderType = ShaderType::COMPUTE;
  AttributeSet Set = MF.getFunction()->getAttributes();
  Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
                                 ShaderTypeAttribute);

  if (A.isStringAttribute()) {
    StringRef Str = A.getValueAsString();
    if (Str.getAsInteger(0, ShaderType))
      llvm_unreachable("Can't parse shader type!");
  }
}

}