radeon/llvm: Fix MachineInstr dump
authorTom Stellard <thomas.stellard@amd.com>
Wed, 2 May 2012 15:53:13 +0000 (11:53 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 2 May 2012 15:53:13 +0000 (11:53 -0400)
src/gallium/drivers/radeon/AMDILSubtarget.cpp
src/gallium/drivers/radeon/radeon_llvm_emit.cpp

index 11b6bbe0c0129c37a6c9530b78f930e9181f49fa..4fdbe755af60c362a0d73cece3f4dc464a604f3f 100644 (file)
@@ -27,7 +27,8 @@ using namespace llvm;
 #define GET_SUBTARGETINFO_TARGET_DESC
 #include "AMDILGenSubtargetInfo.inc"
 
-AMDILSubtarget::AMDILSubtarget(llvm::StringRef TT, llvm::StringRef CPU, llvm::StringRef FS) : AMDILGenSubtargetInfo( TT, CPU, FS )
+AMDILSubtarget::AMDILSubtarget(llvm::StringRef TT, llvm::StringRef CPU, llvm::StringRef FS) : AMDILGenSubtargetInfo( TT, CPU, FS ),
+  mDumpCode(false)
 {
   memset(CapsOverride, 0, sizeof(*CapsOverride)
       * AMDILDeviceInfo::MaxNumberCapabilities);
index 3431316cd3ce1462850a5f552bf0deea6d9f02bc..ebc32106b52356c9833c857d7043e8adfbf55b20 100644 (file)
@@ -93,20 +93,20 @@ radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes,
    AMDGPUTriple.setArch(Arch);
 
    Module * mod = unwrap(M);
-   std::string FS = gpu_family;
+   std::string FS;
    TargetOptions TO;
 
+   if (dump) {
+      mod->dump();
+      FS += "+DumpCode";
+   }
+
    std::auto_ptr<TargetMachine> tm(AMDGPUTarget->createTargetMachine(
-                     AMDGPUTriple.getTriple(), gpu_family, "" /* Features */,
+                     AMDGPUTriple.getTriple(), gpu_family, FS,
                      TO, Reloc::Default, CodeModel::Default,
                      CodeGenOpt::Default
                      ));
    TargetMachine &AMDGPUTargetMachine = *tm.get();
-   /* XXX: Use TargetMachine.Options in 3.0 */
-   if (dump) {
-      mod->dump();
-      FS += ",DumpCode";
-   }
    PassManager PM;
    PM.add(new TargetData(*AMDGPUTargetMachine.getTargetData()));
    PM.add(createPromoteMemoryToRegisterPass());