[PATCH] [PBQP] Composable constraints.

Arnaud A. de Grandmaison arnaud.degrandmaison at arm.com
Wed Oct 8 00:22:35 PDT 2014

Hi Lang,


This looks OK to me for the AArch64 backend side.


I can not wait to use the PBQPRAConstraintSet, as it will enable to partition code elegantly between different constraint builder and compose them ! The ‘Set’ part in the name however may be a bit misleading (and I was at first) as I am not sure a Set implies an order on its elements. Maybe something like PBQPRAConstraint{Pipe,Sequence} would better convey the idea that the constraint builders will be applied in the order they were added.






From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Lang Hames
Sent: 08 October 2014 06:05
To: Commit Messages and Patches for LLVM
Subject: [PATCH] [PBQP] Composable constraints.


Hi All,


This patch removes the PBQPBuilder class and its subclasses and replaces them with a composable constraints class: PBQPRAConstraint. This allows constraints that are only required for optimisation (e.g. coalescing, soft pairing) to be mixed and matched. It also makes it easy for targets to supply custom constraints.


Most of this patch is PBQP-implementation nitty-gritty, but there's one part that I'd like some general feedback on: To enable targets to supply custom constraints I have added a new method to TargetRegisterInfo:


virtual std::unique_ptr<PBQPRAConstraints> getCustomPBQPConstraints() const;


By default this returns a nullptr (indicating no custom constraints are to be used). TargetRegisterInfo seems like a reasonable place to have this, but if I've missed a more appropriate spot it would be good to know. (E.g. If we want to keep TargetRegisterInfo, as much as possible, as an interface for querying the target about the register file then perhaps it would make more sense to put this in TargetSubtargetInfo, but the policy in this area isn't clear to me).


On the assumption that TargetRegisterInfo is the right place for the aforementioned method, AArch64 has been updated to override this to supply its custom constraints. Arnaud - I'd appreciate it if you could take a quick look and let me know whether you're happy with these AArch64 changes.


This patch should have no impact on allocation quality, and in almost all cases I would expect the resulting allocations to be identical. The only caveat is that PBQP uses FP, and this patch may slightly alter the order of FP operations during initialisation, which could alter some allocations. I would expect that to be very rare, if it happens at all.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141008/ff334eb1/attachment.html>

More information about the llvm-commits mailing list