+ * Do the Operator Scalar Replacement optimization and linear
+ * function test replacement for loop control.
+ *
+ * @param irg the graph which should be optimized
+ * @param flags one of osr_flags
+ *
+ * The linear function replacement test is controlled by the flags.
+ * If the osr_flag_lftr_with_ov_check is set, the replacement is only
+ * done if do overflow can occur.
+ * Otherwise it is ALWAYS done which might be insecure.
+ *
+ * For instance:
+ *
+ * for (i = 0; i < 100; ++i)
+ *
+ * might be replaced by
+ *
+ * for (i = 0; i < 400; i += 4)
+ *
+ * But
+ *
+ * for (i = 0; i < 0x7FFFFFFF; ++i)
+ *
+ * will not be replaced by
+ *
+ * for (i = 0; i < 0xFFFFFFFC; i += 4)
+ *
+ * because of overflow.
+ *
+ * More bad cases:
+ *
+ * for (i = 0; i <= 0xF; ++i)
+ *
+ * will NOT be transformed into
+ *
+ * for (i = 0xFFFFFFF0; i <= 0xFFFFFFFF; ++i)
+ *
+ * although here is no direct overflow. The OV occurs when the ++i
+ * is executed (and would created an endless loop here!).
+ *
+ * For the same reason, a loop
+ *
+ * for (i = 0; i <= 9; i += x)
+ *
+ * will NOT be transformed because we cannot estimate whether an overflow
+ * might happen adding x.
+ *
+ * Note that i < a + 400 is also not possible with the current implementation
+ * although this might be allowed by other compilers...
+ *
+ * Note further that tests for equality can be handled some simplier (but are not
+ * implemented yet).