[llvm-commits] PATCH: clean up usage of the RelaxAll flag in MC

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Dec 11 08:25:31 PST 2012


On 10 December 2012 15:51, Eli Bendersky <eliben at google.com> wrote:
> Hello,
>
> The attached patch is small but requires a bit of explanation.
>
> It removes the RelaxAll overrule in MCAssembler::fixupNeedsRelaxation,
> because that method is only getting called for MCInstFragment. These
> fragments aren't even generated when RelaxAll is set, which is why the
> flag reference here is superfluous. Removing it simplifies the code
> with no harmful effects.

Nice catch.

How would you feel about replacing the if with

assert(!getRelaxAll() && "MCInstFragment created unnecessarily");

> To test this I added a test to the regression suite explicitly
> targeted at the RelaxAll flag, as well as assembing a largish program
> with -O0 (RelaxAll by default) and observing that all the assembler
> statistics remained the same.
>
> Eli


Cheers,
Rafael



More information about the llvm-commits mailing list