Remove unused variables and methods to address compiler warnings
authorLei Zhang <antiagainst@google.com>
Thu, 26 Sep 2019 02:04:59 +0000 (19:04 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 26 Sep 2019 02:05:30 +0000 (19:05 -0700)
PiperOrigin-RevId: 271256784

mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
mlir/lib/TableGen/Pattern.cpp
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

index 6f08442..8a8e747 100644 (file)
@@ -450,8 +450,7 @@ public:
     auto sliceOp = cast<SliceOp>(op);
     BaseViewConversionHelper helper(op, sliceOp.getViewType(), rewriter,
                                     lowering);
-    LLVMType elementTy = helper.elementTy, int64Ty = helper.int64Ty,
-             viewDescriptorTy = helper.viewDescriptorTy;
+    LLVMType elementTy = helper.elementTy, int64Ty = helper.int64Ty;
     Value *desc = helper.desc;
 
     auto viewType = sliceOp.getBaseViewType();
index d8ec508..f5868e5 100644 (file)
@@ -293,9 +293,6 @@ private:
   sliceInstruction(spirv::Opcode &opcode, ArrayRef<uint32_t> &operands,
                    Optional<spirv::Opcode> expectedOpcode = llvm::None);
 
-  /// Returns the next instruction's opcode if exists.
-  Optional<spirv::Opcode> peekOpcode();
-
   /// Processes a SPIR-V instruction with the given `opcode` and `operands`.
   /// This method is the main entrance for handling SPIR-V instruction; it
   /// checks the instruction opcode and dispatches to the corresponding handler.
@@ -1751,12 +1748,6 @@ Deserializer::sliceInstruction(spirv::Opcode &opcode,
   return success();
 }
 
-Optional<spirv::Opcode> Deserializer::peekOpcode() {
-  if (curOffset >= binary.size())
-    return llvm::None;
-  return extractOpcode(binary[curOffset]);
-}
-
 LogicalResult Deserializer::processInstruction(spirv::Opcode opcode,
                                                ArrayRef<uint32_t> operands,
                                                bool deferInstructions) {
index e8f18e6..e2c61dc 100644 (file)
@@ -267,6 +267,7 @@ std::string tblgen::SymbolInfoMap::SymbolInfo::getValueAndRangeUse(
     return formatv(fmt, name);
   }
   }
+  llvm_unreachable("unknown kind");
 }
 
 std::string tblgen::SymbolInfoMap::SymbolInfo::getAllRangeUse(
index 2029490..62318f3 100644 (file)
@@ -807,7 +807,7 @@ static void emitStrToSymFnForBitEnum(const Record &enumDef, raw_ostream &os) {
     // Skip the special enumerant for None.
     if (auto val = enumerant.getValue())
       os.indent(6) << formatv(".Case(\"{0}\", {1})\n", enumerant.getSymbol(),
-                              enumerant.getValue());
+                              val);
   }
   os.indent(6) << ".Default(llvm::None);\n";