[PATCH] D31418: [globalisel][tablegen] Import SelectionDAG's rule predicates and support the equivalent in GIRule.

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 03:38:53 PDT 2017


dsanders added inline comments.


================
Comment at: lib/Target/AArch64/AArch64InstructionSelector.cpp:485
+    const MachineFunction &MF) {
+  ForCodeSize = MF.getFunction()->optForSize();
+  AvailableFeatures = computeAvailableFeatures(&MF, &STI);
----------------
dsanders wrote:
> ab wrote:
> > We already specialize the selector (and everything else) per-subtarget.  Should we also treat 'optsize' and 'optnone' the same way?  We wouldn't need to do anything per-function then.
> > 
> > That might not be a good idea, but some of our features are already not hardware-related, and seem closer to 'optsize' than to other hardware features.
> My first attempt tried to deal with optsize/optnone inside <Target>TargetMachine::getSubtargetImpl() so that we didn't need this hook but I had problems with getting the wrong subtarget during the instruction selector. Unfortunately, I didn't manage to get to the bottom of that and I needed to move on to some dependent work so I had to fall back on this approach.
I believe this is the remaining thread we still need to reach a conclusion on.

Seeing as there's quite a few LGTM'd patches queued up behind this one and this is about where we handle this rather than how, I'm going to commit this patch and I'll handle whatever conclusion we reach on this post-commit. I hope that's ok with you.


https://reviews.llvm.org/D31418





More information about the llvm-commits mailing list