<div dir="ltr"><div>Hello,</div><div><br></div><div>I would like to find a way to do this removal properly. I found DSE and "eliminateNoopStore" can be useful for this thing.</div><div><br></div><div>What I mean?</div><div>int *test = malloc(15 * sizeof(int));</div><div>test[10] = 12; < ----- remove this store</div><div>memset(test,0,sizeof(int) * 15);</div><div><br></div><div>I already checked the function "eliminateNoopStore". </div><div>Looks good, I think I would be to get the value ("A") we store to, is from malloc. Then a pointer capture analysis would be performed. These steps should not be hard.</div><div><br></div><div>The problem: how to do the detection that the value "A" is later zeroed using memset? Traverse over all uses of "A"? Can you recommend me the proper way how to check this? </div><div><br></div><div>Thank you</div><div><br></div><div>p.s: In the future it could be used for proper malloc + memset folding to calloc, currently it is a bit suboptimal.</div></div>