This converts a signed remainder instruction to unsigned remainder, which enables the code size optimisation to fold a rem and div into a single aeabi_uidivmod call. This was not happening before because sdiv was converted but srem not, and instructions with different signedness are not combined.
Details
Details
Diff Detail
Diff Detail
Event Timeline
test/Transforms/CorrelatedValuePropagation/srem.ll | ||
---|---|---|
26 | Do you need all these basic blocks and instructions? (i.e: is this test minimal?) |
Comment Actions
Simplified the regression test. The transformation triggers when value range can determine that the operands are >= 0. This is accomplished with and if-statement instead of a while loop, which simplifies the test.
You can simplify this by using "auto"