<div dir="ltr"><div><div><div>Some code in GVN.cpp:<br>static Value *CoerceAvailableValueToLoadType(Value *StoredVal,<br> Type *LoadedTy,<br> Instruction *InsertPt,<br>
const DataLayout &DL) {<br>....<br> // Convert vectors and fp to integer, which can be manipulated.<br> if (!StoredValTy->isIntegerTy()) {<br> StoredValTy = IntegerType::get(StoredValTy->getContext(), StoreSize);<br>
StoredVal = new BitCastInst(StoredVal, StoredValTy, "", InsertPt);<br> }<br>...<br></div>here if LoadedTy is Vector type like <4 x i32>, then StoreSize will be 128 bit integer.<br></div><div>I will show you some example later.<br>
<br></div>I find in pass ScalarReplAggregates it offers some configuration parameters to control the maximum width of wide integer, which is quite friendly.<br></div><div class="gmail_extra">In SROA, i don't found that kind configuration parameters.<br>
</div><div class="gmail_extra">Can anybody familiar with 'Scalar' passes give some insights?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-04 14:23 GMT+08:00 Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Yes, the LLVM backend does type legalization on the SelectionDAG formed from the LLVM IR. This eliminates too-wide integer types by decomposing the operations.<div>
<br></div><div>However, SROA never produces an integer wider than what was used in the input IR that I know of... I would be surprised if GVN did this either.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
<div><div class="h5">On Wed, Sep 3, 2014 at 10:53 PM, Ruiling Song <span dir="ltr"><<a href="mailto:ruiling.song83@gmail.com" target="_blank">ruiling.song83@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="h5"><div dir="ltr"><div><div><div>Hi,<br><br>I am currently working on an opencl project based on LLVM, the target device is 32bit.<br></div>I met a problem that some llvm passes like GVN SROA will generate some IR operating<br>
</div>on wide integer types like i128 or i512. But the device does not support such kind of data type.<br>Is there any idea on how to lower this kind of IR to only operate on i32 or vector of i32? Or is there any existing code handle this?<br>
<br></div>Thanks!<span><font color="#888888"><br>Ruiling<br></font></span></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>