[PATCH] [AArch64] Enhance rematerialization by adding a new API isAsCheapAsAMove in TargetInstroInfo

Quentin Colombet qcolombet at apple.com
Wed Jul 2 03:50:39 PDT 2014


> Sorry that I really didn't notice that this flag is deprecated. 

Well at this point, I think the documentation is just wrong :).

>  Do you mean because this flag is being used in an arbitrary manner everywhere, we want to work out another more centralized solution to describe rematerializable attribute?

More or less. What I am saying is that we should either:
- Really deprecate this flag, and thus update the implement of isTriviallyRematerializable, e.g., isAsCheapAsMove or
- Update the comments to express what isRematerialize really means.
Indeed, in this patch, it is not clear to me why we choose to mark some instruction rematerializable and some others not (e.g., if add immediate is rematerializable, why mul immediate is not... the notion of cost seems relevant). But you are right, this may be something general.

> Or we needn't this flag at all, and the algorithm of rematerialization should just check cost like the info provided by isAsCheapAsMove?

That might be a livable option. Honestly, I haven't thought a lot about that, it is just that this patch highlights two strange things: the use of isRematerializable flag, and its semantic.

What would you suggest?

Thanks,
-Quentin

http://reviews.llvm.org/D4361






More information about the llvm-commits mailing list