<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">Yes, it is valid bit code. The command you gave does not give any error to me. </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"><SPAN style="RIGHT: auto">Actually there is some company specific information and functions in it for the concerned file, so I was not able to share the complete code.</SPAN></SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"><SPAN style="RIGHT: auto">I don't know what I can remove and share so that it is valid and shareable as well :( <VAR id=yui-ie-cursor></VAR>. </SPAN></SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">As suggested I have also enabled assertions and debug mode.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN><SPAN style="RIGHT: auto"></SPAN><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Regards,</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Pankaj</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div><BR></div>
<DIV style="FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; FONT-SIZE: 10pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV dir=ltr><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr contentEditable=false readonly="true"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Duncan Sands <baldrick@free.fr><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> llvmdev@cs.uiuc.edu <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thursday, April 19, 2012 6:47 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [LLVMdev] Issue with GetElementPtrInst in Instruction Combining pass<BR></FONT></DIV><BR>Hi Pankaj, are you testing this on valid bitcode?  The bitcode you sent me did<BR>not pass the verifier, i.e. was not valid.  Optimizers can be expected to do<BR>strange and wrong things if passed invalid bitcode.  That is not
 a bug in LLVM:<BR>it is user error if a user doesn't use valid bitcode.<BR><BR>Ciao, Duncan.<BR><BR>> I think, finally, I want to conclude on this.<BR>> The problem I see is that if I comment the case for "simplificaiton of bitcast<BR>> to gep of original struct in instruction combining", wherein there is a case for<BR>> if the offset by which GEP moves the pointer is non-zero.<BR>> If I disable this code, then structure elements size, I get is<BR>> --------------------------------------------------------------------------------------------<BR>> Type | struct elements | Size in bytes | Correct size in bytes<BR>> --------------------------------------------------------------------------------------------<BR>> short nScaleFactors *4 2<BR>> *FRAME_INFO frameInfo 36 36<BR>> short domain_vec[MAX_ENVELOPES] 10 10<BR>> short domain_vec_noise[MAX_NOISE_ENVELOPES] 6 4<BR>> INVF_MODE sbr_invf_mode[MAX_INVF_BANDS] 20
 20<BR>> COUPLING_MODE coupling 4 4<BR>> short ampResolutionCurrentFrame 2 2<BR>> Flag addHarmonics[MAX_FREQ_COEFFS] 192 192<BR>> short maxQmfSubbandAac 2 2<BR>> short iEnvelope[MAX_NUM_ENVELOPE_VALUES] 480 480<BR>> short sbrNoiseFloorLevel[MAX_NUM_NOISE_VALUES] 20 20<BR>> --------------------------------------------------------------------------------------------<BR>> Though the size i get is wrong, but still my application passes. I don't have<BR>> any reason for that though.<BR>> But, if I enable *this* code, then the structure elements size, I get is:<BR>> --------------------------------------------------------------------------------------------<BR>> Type | struct elements | Size in bytes | Correct size in bytes<BR>> --------------------------------------------------------------------------------------------<BR>> short nScaleFactors 2 2<BR>> FRAME_INFO frameInfo 36 36<BR>> short
 domain_vec[MAX_ENVELOPES] 10 10<BR>> short domain_vec_noise[MAX_NOISE_ENVELOPES] 4 4<BR>> INVF_MODE sbr_invf_mode[MAX_INVF_BANDS] 20 20<BR>> COUPLING_MODE coupling 4 4<BR>> short ampResolutionCurrentFrame 2 2<BR>> Flag addHarmonics[MAX_FREQ_COEFFS] 192 192<BR>> short maxQmfSubbandAac 2 2<BR>> short iEnvelope[MAX_NUM_ENVELOPE_VALUES] 480 480<BR>> short sbrNoiseFloorLevel[MAX_NUM_NOISE_VALUES] 20 20<BR>> --------------------------------------------------------------------------------------------<BR>> These sizes are the same as I get with llvm2.9 and which matches with<BR>> expected/correct as well. For llvm2.9, my test passes as well with these sizes.<BR>> So I wanted to know, if there is a major change in llvm infrastructure required<BR>> to calculate this offset/size for each structure element or something related to<BR>> this?<BR>> If nothing is changed related to this, i will simply comment out this code,
 as<BR>> after commenting, it works for me and forget the problem.<BR>> Regards,<BR>> Pankaj<BR>> _______________________________________________LLVM Developers mailing<BR>> <A href="mailto:listLLVMdev@cs.uiuc.edu" ymailto="mailto:listLLVMdev@cs.uiuc.edu">listLLVMdev@cs.uiuc.edu</A> <mailto:<A href="mailto:LLVMdev@cs.uiuc.edu" ymailto="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A>><BR>> http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev<BR>><BR>><BR>> _______________________________________________<BR>> LLVM Developers mailing list<BR>> <A href="mailto:LLVMdev@cs.uiuc.edu" ymailto="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A>        http://llvm.cs.uiuc.edu<BR>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev<BR><BR>_______________________________________________<BR>LLVM Developers mailing list<BR><A href="mailto:LLVMdev@cs.uiuc.edu"
 ymailto="mailto:LLVMdev@cs.uiuc.edu">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><BR></DIV></DIV></div></body></html>