[PATCH] [X86] Improved lowering of v4x32 build_vector dag nodes.

Andrea Di Biagio Andrea_DiBiagio at sn.scee.net
Tue Nov 18 12:59:29 PST 2014


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:5752-5754
@@ +5751,5 @@
+  }
+  assert(std::count_if(&Zeroable[0], &Zeroable[4],
+                       [](bool M) { return !M; }) >= 1 &&
+         "We expect at least one non-zero element!");
+
----------------
I just realized that this check could be improved.
This assertion should check that the number of non-zero elements is strictly bigger than 1 (and not >= 1). The reason why it cannot be 1 is because build_vector nodes of i32 or f32 elements that only have one non-zero element are expanded earlier before we call this function.
I will correct it before sending.

http://reviews.llvm.org/D6311






More information about the llvm-commits mailing list