<div dir="ltr"><div>Sorry if this has been discussed before, but I would appreciate any pointers.</div><div> </div><div>I am trying to understand why mem2reg only looks at allocas in entry blocks, and not for any allocas in a function. One case where allocas could be used to build local data structures like linked list (and so on make it unsafe), and for that the existing conditions in IsAllocaPromotable (i.e. the alloca pointer cannot escape or be stored or cast etc) should guard against that, regardless of the position of the alloca. right? Is there a reason for this?</div>
<div> </div><div>Thanks </div><div>Vinod</div><div> </div></div>