[LLVMdev] Issue with GetElementPtrInst in Instruction Combining pass

Pankaj Gode godepankaj at yahoo.com
Thu Apr 19 05:39:17 PDT 2012


I think, finally, I want to conclude on this.
 
The problem I see is that if I comment the case for "simplificaiton of bitcast to gep of original struct in instruction combining", wherein there is a case for if the offset by which GEP moves the pointer is non-zero.
 
If I disable this code, then structure elements size, I get is
--------------------------------------------------------------------------------------------
Type       | struct elements                      | Size in bytes | Correct size in bytes
--------------------------------------------------------------------------------------------
short          nScaleFactors                               4            2
FRAME_INFO     frameInfo                                  36           36
short          domain_vec[MAX_ENVELOPES]                  10           10
short          domain_vec_noise[MAX_NOISE_ENVELOPES]       6            4
INVF_MODE      sbr_invf_mode[MAX_INVF_BANDS]              20           20
COUPLING_MODE  coupling                                    4            4
short          ampResolutionCurrentFrame                   2            2
Flag           addHarmonics[MAX_FREQ_COEFFS]             192          192
short          maxQmfSubbandAac                            2            2
short          iEnvelope[MAX_NUM_ENVELOPE_VALUES]        480          480
short          sbrNoiseFloorLevel[MAX_NUM_NOISE_VALUES]   20           20
--------------------------------------------------------------------------------------------
Though the size i get is wrong, but still my application passes. I don't have any reason for that though.
 
But, if I enable this code, then the structure elements size, I get is:
--------------------------------------------------------------------------------------------
Type       | struct elements                      | Size in bytes | Correct size in bytes
--------------------------------------------------------------------------------------------
short          nScaleFactors                               2            2
FRAME_INFO     frameInfo                                  36           36
short          domain_vec[MAX_ENVELOPES]                  10           10
short          domain_vec_noise[MAX_NOISE_ENVELOPES]       4            4
INVF_MODE      sbr_invf_mode[MAX_INVF_BANDS]              20           20
COUPLING_MODE  coupling                                    4            4
short          ampResolutionCurrentFrame                   2            2
Flag           addHarmonics[MAX_FREQ_COEFFS]             192          192
short          maxQmfSubbandAac                            2            2
short          iEnvelope[MAX_NUM_ENVELOPE_VALUES]        480          480
short          sbrNoiseFloorLevel[MAX_NUM_NOISE_VALUES]   20           20
--------------------------------------------------------------------------------------------
 
These sizes are the same as I get with llvm2.9 and which matches with expected/correct as well. For llvm2.9, my test passes as well with these sizes.
 
So I wanted to know, if there is a major change in llvm infrastructure required to calculate this offset/size for each structure element or something related to this? 
 
If nothing is changed related to this, i will simply comment out this code, as after commenting, it works for me and forget the problem.
 
 
Regards,
Pankaj
 
 
_______________________________________________LLVM Developers mailing listLLVMdev at cs.uiuc.edu        http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120419/5f7321dc/attachment.html>


More information about the llvm-dev mailing list