[PATCH] D15144: [mips[microMIPS]] Adding code size reduction pass for MicroMIPS

Milena Vujosevic Janicic via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 08:13:23 PDT 2016


milena.vujosevic.janicic added inline comments.

================
Comment at: lib/Target/Mips/MicroMips32SizeReduction.cpp:388-394
@@ +387,9 @@
+static bool InRange(int64_t value, unsigned short shift, int lbound,
+                    int hbound) {
+  int64_t value2 = value >> shift;
+  if ((value2 << shift) == value && (value2 >= lbound) && (value2 < hbound))
+    return true;
+  return false;
+}
+
+// Returns true if the instruction is not appropriate to be between
----------------
These functions are similar but are not equivalent and cannot be used in this case. isShiftedInt is a template which should be instantiated with a constant shift value, while here the value of shift is a parameter to the function. Also, in this case, low bound and high bound does not necessary correspond to bit width. 



http://reviews.llvm.org/D15144





More information about the llvm-commits mailing list