<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div><div>-  assert(VT.getSizeInBits() == Op1.getValueType().getSizeInBits()<br>-         && "Invalid mask size");<br>+  // If the mask and the type do not match and Select is legal,<br>+  // go ahead and unroll the vector op.<br>+  // This occurs when getSetCCResultType returns something that<br>+  // is different than the operand types. For example,<br>+  // v4i8 = select v4i32, v4i8, v4i8.<br>+  if (Op1.getValueType() != VT &&<br>+      TLI.getTypeAction(*DAG.getContext(), VT.getScalarType())<br>+        == TargetLowering::TypeLegal &&<br>+      TLI.getOperationAction(ISD::SELECT, VT.getScalarType())<br>+        == TargetLowering::Legal) {<br>+    return DAG.UnrollVectorOp(Op.getNode());<br>+  }<br>+<br></div><div><br></div><div>You don't need to check if the scalar SELECT operation is legal, just scalarize it and let the code that legalizes the scalar selects worry about it.   I am okay with replacing the assert with DAG.UnrollVectorOp. </div></div><div><br></div><br><div><div>On May 6, 2013, at 2:30 PM, Matt Arsenault <<a href="mailto:Matthew.Arsenault@amd.com">Matthew.Arsenault@amd.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br> I haven't managed to get the same situation to arise with any of the in tree backends<br><br><a href="http://llvm-reviews.chandlerc.com/D743">http://llvm-reviews.chandlerc.com/D743</a></div></blockquote></div><br></body></html>