<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 10, 2015 at 9:08 PM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":d3m" class="a3s" style="overflow:hidden">- assert((NumElements == 16 || NumElements == 32) &&<br>
- "Only 128-bit and 256-bit vectors supported!");<br>
+ if (!DestTy)<br>
+ return;<br>
+<br>
+ if (DestTy != MaskTy) {<br>
+ if (!CastInst::castIsValid(Instruction::BitCast, const_cast<Constant *>(C),<br>
+ DestTy))<br>
+ return;<br>
+<br>
+ C = ConstantFoldInstOperands(Instruction::BitCast, DestTy,<br>
+ const_cast<Constant *>(C), TD);<br>
+ MaskTy = DestTy;<br>
+ }</div></blockquote></div><br>No no no, you don't get to play fast and loose by constant folding here. =]</div><div class="gmail_extra"><br></div><div class="gmail_extra">You may not have a module, your context may be very different than you expect. =/</div><div class="gmail_extra"><br></div><div class="gmail_extra">I would just do the bit math manually.</div></div>