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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 06:47:22 PST 2016


RKSimon marked 2 inline comments as done.
RKSimon added inline comments.


================
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.
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D27220





More information about the llvm-commits mailing list