瀏覽代碼

Updated spirv-tools.

Бранимир Караџић 3 年之前
父節點
當前提交
d01e6e8b12

+ 1 - 1
3rdparty/spirv-tools/include/generated/build-version.inc

@@ -1 +1 @@
-"v2021.5-dev", "SPIRV-Tools v2021.5-dev ad6abbd669261cf3728d71e263d5d16f6c5f2b22"
+"v2021.5-dev", "SPIRV-Tools v2021.5-dev 4581f14cd481bad1e0d6292f0dd0a6e298c2ee18"

+ 1 - 1
3rdparty/spirv-tools/source/binary.cpp

@@ -300,7 +300,7 @@ spv_result_t Parser::parseInstruction() {
   const uint32_t first_word = peek();
 
   // If the module's endianness is different from the host native endianness,
-  // then converted_words contains the the endian-translated words in the
+  // then converted_words contains the endian-translated words in the
   // instruction.
   _.endian_converted_words.clear();
   _.endian_converted_words.push_back(first_word);

+ 1 - 1
3rdparty/spirv-tools/source/cfa.h

@@ -42,7 +42,7 @@ class CFA {
 
   /// Returns true if a block with @p id is found in the @p work_list vector
   ///
-  /// @param[in] work_list  Set of blocks visited in the the depth first
+  /// @param[in] work_list  Set of blocks visited in the depth first
   /// traversal
   ///                       of the CFG
   /// @param[in] id         The ID of the block being checked

+ 1 - 1
3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.h

@@ -98,7 +98,7 @@ class DeadBranchElimPass : public MemPass {
   // Fix phis in reachable blocks so that only live (or unremovable) incoming
   // edges are present. If the block now only has a single live incoming edge,
   // remove the phi and replace its uses with its data input. If the single
-  // remaining incoming edge is from the phi itself, the the phi is in an
+  // remaining incoming edge is from the phi itself, the phi is in an
   // unreachable single block loop. Either the block is dead and will be
   // removed, or it's reachable from an unreachable continue target. In the
   // latter case that continue target block will be collapsed into a block that

+ 1 - 1
3rdparty/spirv-tools/source/opt/desc_sroa.h

@@ -132,7 +132,7 @@ class DescriptorScalarReplacement : public Pass {
 
   // A map from an OpVariable instruction to the set of variables that will be
   // used to replace it. The entry |replacement_variables_[var][i]| is the id of
-  // a variable that will be used in the place of the the ith element of the
+  // a variable that will be used in the place of the ith element of the
   // array |var|. If the entry is |0|, then the variable has not been
   // created yet.
   std::map<Instruction*, std::vector<uint32_t>> replacement_variables_;

+ 1 - 1
3rdparty/spirv-tools/source/opt/dominator_tree.h

@@ -278,7 +278,7 @@ class DominatorTree {
 
  private:
   // Wrapper function which gets the list of pairs of each BasicBlocks to its
-  // immediately  dominating BasicBlock and stores the result in the the edges
+  // immediately  dominating BasicBlock and stores the result in the edges
   // parameter.
   //
   // The |edges| vector will contain the dominator tree as pairs of nodes.

+ 1 - 1
3rdparty/spirv-tools/source/opt/loop_fission.cpp

@@ -453,7 +453,7 @@ Pass::Status LoopFissionPass::Process() {
   for (Function& f : *context()->module()) {
     // We collect all the inner most loops in the function and run the loop
     // splitting util on each. The reason we do this is to allow us to iterate
-    // over each, as creating new loops will invalidate the the loop iterator.
+    // over each, as creating new loops will invalidate the loop iterator.
     std::vector<Loop*> inner_most_loops{};
     LoopDescriptor& loop_descriptor = *context()->GetLoopDescriptor(&f);
     for (Loop& loop : loop_descriptor) {

+ 11 - 3
3rdparty/spirv-tools/source/opt/pass_manager.cpp

@@ -35,10 +35,18 @@ Pass::Status PassManager::Run(IRContext* context) {
     if (print_all_stream_) {
       std::vector<uint32_t> binary;
       context->module()->ToBinary(&binary, false);
-      SpirvTools t(SPV_ENV_UNIVERSAL_1_2);
+      SpirvTools t(target_env_);
+      t.SetMessageConsumer(consumer());
       std::string disassembly;
-      t.Disassemble(binary, &disassembly, 0);
-      *print_all_stream_ << preamble << (pass ? pass->name() : "") << "\n"
+      std::string pass_name = (pass ? pass->name() : "");
+      if (!t.Disassemble(binary, &disassembly, 0)) {
+        std::string msg = "Disassembly failed before pass ";
+        msg += pass_name + "\n";
+        spv_position_t null_pos{0, 0, 0};
+        consumer()(SPV_MSG_WARNING, "", null_pos, msg.c_str());
+        return;
+      }
+      *print_all_stream_ << preamble << pass_name << "\n"
                          << disassembly << std::endl;
     }
   };

+ 1 - 1
3rdparty/spirv-tools/source/opt/register_pressure.cpp

@@ -378,7 +378,7 @@ void RegisterLiveness::SimulateFusion(
   // The loop fusion is injecting the l1 before the l2, the latch of l1 will be
   // connected to the header of l2.
   // To compute the register usage, we inject the loop live-in (union of l1 and
-  // l2 live-in header blocks) into the the live in/out of each basic block of
+  // l2 live-in header blocks) into the live in/out of each basic block of
   // l1 to get the peak register usage. We then repeat the operation to for l2
   // basic blocks but in this case we inject the live-out of the latch of l1.
   auto live_loop = MakeFilterIteratorRange(

+ 1 - 1
3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp

@@ -134,7 +134,7 @@ class SENodeSimplifyImpl {
   // offset.
   SENode* EliminateZeroCoefficientRecurrents(SENode* node);
 
-  // A reference the the analysis which requested the simplification.
+  // A reference the analysis which requested the simplification.
   ScalarEvolutionAnalysis& analysis_;
 
   // The node being simplified.

+ 1 - 1
3rdparty/spirv-tools/source/opt/strength_reduction_pass.h

@@ -34,7 +34,7 @@ class StrengthReductionPass : public Pass {
   // Returns true if something changed.
   bool ReplaceMultiplyByPowerOf2(BasicBlock::iterator*);
 
-  // Scan the types and constants in the module looking for the the integer
+  // Scan the types and constants in the module looking for the integer
   // types that we are
   // interested in.  The shift operation needs a small unsigned integer.  We
   // need to find

+ 0 - 1
3rdparty/spirv-tools/source/opt/types.cpp

@@ -425,7 +425,6 @@ std::string Array::str() const {
 void Array::GetExtraHashWords(std::vector<uint32_t>* words,
                               std::unordered_set<const Type*>* seen) const {
   element_type_->GetHashWords(words, seen);
-  // This should mirror the logic in IsSameImpl
   words->insert(words->end(), length_info_.words.begin(),
                 length_info_.words.end());
 }

+ 1 - 1
3rdparty/spirv-tools/source/val/validate.cpp

@@ -202,7 +202,7 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
                  /* diagnostic = */ nullptr);
 
   // Parse the module and perform inline validation checks. These checks do
-  // not require the the knowledge of the whole module.
+  // not require the knowledge of the whole module.
   if (auto error = spvBinaryParse(&context, vstate, words, num_words,
                                   /*parsed_header =*/nullptr,
                                   ProcessInstruction, pDiagnostic)) {

+ 1 - 1
3rdparty/spirv-tools/source/val/validate_memory.cpp

@@ -1411,7 +1411,7 @@ spv_result_t ValidateArrayLength(ValidationState_t& state,
            << state.getIdName(inst->id()) << "' must be an OpTypeRuntimeArray.";
   }
 
-  // The array member must the the index of the last element (the run time
+  // The array member must the index of the last element (the run time
   // array).
   if (inst->GetOperandAs<uint32_t>(3) != num_of_members - 1) {
     return state.diag(SPV_ERROR_INVALID_ID, inst)