[PATCH] Convert a vselect into a concat_vector if possible

Filipe Cabecinhas filcab+llvm.phabricator at gmail.com
Mon May 26 23:59:38 PDT 2014


Actually, seeing as it's generic, maybe I should move it to a more generic part of DAGCombiner, instead of the X86 backend.

What do you think, Elena? Nadav?

Filipe

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:17876
@@ -17840,1 +17875,3 @@
 
+  if (LHS.getOpcode() == ISD::CONCAT_VECTORS &&
+      RHS.getOpcode() == ISD::CONCAT_VECTORS &&
----------------
Elena Demikhovsky wrote:
> You do not check that the types are legal. On what stage this optimization should happen? <2 x float> that you take in your test is illegal.
This is a generic optimization, which allows us to eliminate a vselect and replace it with a simpler concat_vectors, that's why I'm doing it before legalize types.

http://reviews.llvm.org/D3916






More information about the llvm-commits mailing list