[PATCH] D27220: [X86][SSE] Add support for target shuffle constant folding

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 08:09:12 PST 2016


zvi accepted this revision.
zvi added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Target/X86/X86ISelLowering.cpp:26414
+
+  // Only fold if at least one of the constants is only used once or
+  // the combined shuffle has included a variable mask shuffle.
----------------
RKSimon wrote:
> zvi wrote:
> > I'm asking for educational reasons and not because I don't agree with this:
> > Why is if at least one constant is used once (and not all or none) is the combine profitable?
> It's an attempt to avoid introducing extra constant vectors - if any are only used once then we're at worse just replacing one vector with another. Similarly if we'd used a variable mask shuffle then we'll be at worse replacing that. Otherwise we're making the assumption that a few extra basic shuffles is a price worth paying for avoiding extra constant pool vector loads.
Thanks, that makes sense.


Repository:
  rL LLVM

https://reviews.llvm.org/D27220





More information about the llvm-commits mailing list