浏览代码

[spirv] allow debug info generation to use full optmization (#3201)

As SPIRV-Tools supports the debug info preservation for the full
optimization, we want to allow DXC users to use the full optimization
for the debug info generation.

This change updates SPIRV-Tools and SPIRV-Headers.
Jaebaek Seo 4 年之前
父节点
当前提交
12fa61c61b
共有 3 个文件被更改,包括 4 次插入6 次删除
  1. 1 1
      external/SPIRV-Headers
  2. 1 1
      external/SPIRV-Tools
  3. 2 4
      tools/clang/lib/SPIRV/SpirvEmitter.cpp

+ 1 - 1
external/SPIRV-Headers

@@ -1 +1 @@
-Subproject commit 060627f0b0d2fa8581b5acb939f46e3b9e500593
+Subproject commit c43a43c7cc3af55910b9bec2a71e3e8a622443cf

+ 1 - 1
external/SPIRV-Tools

@@ -1 +1 @@
-Subproject commit 9e17b9d07a2536dc0a717ba0ed7c419659400078
+Subproject commit 5c64374dd6cbfff1294ec78cdae1bc9de870a07d

+ 2 - 4
tools/clang/lib/SPIRV/SpirvEmitter.cpp

@@ -587,8 +587,7 @@ void SpirvEmitter::HandleTranslationUnit(ASTContext &context) {
     needsLegalization = needsLegalization ||
     needsLegalization = needsLegalization ||
                         declIdMapper.requiresLegalization() ||
                         declIdMapper.requiresLegalization() ||
                         spirvOptions.flattenResourceArrays ||
                         spirvOptions.flattenResourceArrays ||
-                        declIdMapper.requiresFlatteningCompositeResources() ||
-                        spirvOptions.debugInfoRich;
+                        declIdMapper.requiresFlatteningCompositeResources();
 
 
     // Run legalization passes
     // Run legalization passes
     if (needsLegalization) {
     if (needsLegalization) {
@@ -606,8 +605,7 @@ void SpirvEmitter::HandleTranslationUnit(ASTContext &context) {
     }
     }
 
 
     // Run optimization passes
     // Run optimization passes
-    if (!spirvOptions.debugInfoRich &&
-        theCompilerInstance.getCodeGenOpts().OptimizationLevel > 0) {
+    if (theCompilerInstance.getCodeGenOpts().OptimizationLevel > 0) {
       std::string messages;
       std::string messages;
       if (!spirvToolsOptimize(&m, &messages)) {
       if (!spirvToolsOptimize(&m, &messages)) {
         emitFatalError("failed to optimize SPIR-V: %0", {}) << messages;
         emitFatalError("failed to optimize SPIR-V: %0", {}) << messages;