P4 to Git Change 1135916 by smekhano@stas-nova-hsa on 2015/03/30 18:31:55
ECR #333753 - TargetMachine is created not only for codegen, but for optimizer as well This is to provide target specific optimizations in the intermediate optimizer. LLVM 3.6 provides TargetTransformInfo for this purpose which requires TargetMachine. No correctness issues will occur if TargetInfo is not created, but optmizations will target generic machine. Testing: smoke, precheckin Reviewed by Evgeny Mankov Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/codegen.cpp#60 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/opt_level.cpp#23 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/opt_level.hpp#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/optimizer.cpp#25 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.cpp#6 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.h#16 edit
This commit is contained in:
@@ -412,6 +412,17 @@ aclutInsertKernelStatistics(aclCompiler *cl, aclBinary *bin)
|
||||
return err;
|
||||
}
|
||||
|
||||
std::string aclutGetCodegenName(const aclTargetInfo &tgtInfo)
|
||||
{
|
||||
assert(tgtInfo.arch_id <= aclLast && "Unknown device id!");
|
||||
const FamilyMapping *family = familySet + tgtInfo.arch_id;
|
||||
if (!family) return "";
|
||||
|
||||
assert((tgtInfo.chip_id) < family->children_size && "Unknown family id!");
|
||||
const TargetMapping *target = &family->target[tgtInfo.chip_id];
|
||||
return (target) ? target->codegen_name : "";
|
||||
}
|
||||
|
||||
void initElfDeviceCaps(aclBinary *elf)
|
||||
{
|
||||
if (aclutGetCaps(elf)->encryptCode) {
|
||||
|
||||
@@ -112,6 +112,9 @@ aclutCopyBinOpts(aclBinaryOptions *dst,
|
||||
// and insert to elf as symbol
|
||||
acl_error aclutInsertKernelStatistics(aclCompiler*, aclBinary*);
|
||||
|
||||
// Returns target chip name.
|
||||
std::string aclutGetCodegenName(const aclTargetInfo &tgtInfo);
|
||||
|
||||
// Helper function that returns the
|
||||
// allocation function from the binary.
|
||||
AllocFunc
|
||||
|
||||
Reference in New Issue
Block a user