[PATCH] make reciprocal estimate code generation more flexible by adding command-line options

Sanjay Patel spatel at rotateright.com
Wed May 20 15:20:53 PDT 2015


================
Comment at: include/llvm/Target/TargetRecip.h:66
@@ +65,3 @@
+
+  bool ParseGlobalParams(const std::string &Arg);
+  void ParseIndividualParams(const std::vector<std::string> &Args);
----------------
hfinkel wrote:
> function names should start with a lower-case letter.
Fixed.

================
Comment at: lib/Target/TargetRecip.cpp:49
@@ +48,3 @@
+
+static bool ParseRefinementStep(const StringRef &In, size_t &Position,
+                                uint8_t &Value) {
----------------
hfinkel wrote:
> Function names start with a lower-case letter.
Fixed.

================
Comment at: lib/Target/TargetRecip.cpp:112
@@ +111,3 @@
+void TargetRecip::ParseIndividualParams(const std::vector<std::string> &Args) {
+  static const char DISABLED_PREFIX = '!';
+  unsigned NumArgs = Args.size();
----------------
hfinkel wrote:
> DisabledPrefix (this is not a macro, don't name it like one)
Fixed.

================
Comment at: lib/Target/TargetRecip.cpp:132
@@ +131,3 @@
+
+    RecipIter Iter  = RecipMap.find(Val);
+    if (Iter == RecipMap.end()) {
----------------
hfinkel wrote:
> Extra space?
Fixed. Nice catch. :)

================
Comment at: lib/Target/TargetRecip.cpp:136
@@ +135,3 @@
+      Iter = RecipMap.find(Val.str() + 'f');
+      if (Iter == RecipMap.end())
+        report_fatal_error("Invalid option for -recip.");
----------------
hfinkel wrote:
> Please also try with the 'd' suffix.
If we matched a 'd' entry but failed 'f', that would be an assertion failure given the logic below. Let me know if you were thinking of something else.

http://reviews.llvm.org/D8982

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list