[PATCH] [LSR] Canonicalize reg1 + ... + regN into reg1 + ... + 1*regN

Quentin Colombet qcolombet at apple.com
Tue May 20 10:06:43 PDT 2014


Hi Andy,

Thanks again for the feedbacks and the review!

> Right. I was looking at the use of this function in exactly this code. isAMCompletelyFolded seems to mean that we can use two registers in the addressing mode for free. If we have 2 baseregs + scaled reg, the code will assume we need an extra add.

Correct!

> I guess “completely” folded means 1 base + 1 scaled + offset can be folded, but never anything else. That’s what I would expect, but the name is a tad misleading without any comments.

Exactly. This matches indeed the existing behavior. I have updated the comments to detail that.
What do you think?

I derived the naming from the original comment of isLegalUse and retrospectively, this is not great. If you have ideas I take them :).

Thanks,
-Quentin

http://reviews.llvm.org/D3830






More information about the llvm-commits mailing list