Minor fixes on the typo/naming/style in the Pattern.cpp file
authorFeng Liu <fengliuai@google.com>
Mon, 1 Apr 2019 16:39:59 +0000 (09:39 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 1 Apr 2019 17:59:45 +0000 (10:59 -0700)
--

PiperOrigin-RevId: 241341334

mlir/lib/TableGen/Pattern.cpp

index de620e1..bc95c2f 100644 (file)
@@ -266,11 +266,13 @@ std::vector<tblgen::AppliedConstraint> tblgen::Pattern::getConstraints() const {
 }
 
 int tblgen::Pattern::getBenefit() const {
-  // The default benefit value is a heristic with number of ops in the source
+  // The initial benefit value is a heuristic with number of ops in the source
   // pattern.
-  int defaultBenefit = getSourcePattern().getNumOps();
+  int initBenefit = getSourcePattern().getNumOps();
   llvm::DagInit *delta = def.getValueAsDag("benefitDelta");
-  if (delta->getNumArgs() != 1 || !isa<llvm::IntInit>(delta->getArg(0)))
-    PrintFatalError(def.getLoc(), "The 'AddedBenefit' can only be an integer");
-  return defaultBenefit + dyn_cast<llvm::IntInit>(delta->getArg(0))->getValue();
+  if (delta->getNumArgs() != 1 || !isa<llvm::IntInit>(delta->getArg(0))) {
+    PrintFatalError(def.getLoc(),
+                    "The 'addBenefit' takes and only takes one integer value");
+  }
+  return initBenefit + dyn_cast<llvm::IntInit>(delta->getArg(0))->getValue();
 }