<div dir="ltr"><br><div><p style="margin:0px;font-size:14px;font-family:Menlo">We used to use std::map<IndicesVector, LoadInst*> for OriginalLoads, and when we try to promote two arguments, they will both write to OriginalLoads causing created loads for the two arguments to have the same original load. And the same tbaa tag and alignment will be put to the created loads for the two arguments.</p>

<p style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;font-family:Menlo">The fix is to use std::map<std::pair<Argument*, IndicesVector>, LoadInst*> for OriginalLoads, so each Argument will write to different parts of the map.</p>
<p style="margin:0px;font-size:14px;font-family:Menlo"><br></p><p style="margin:0px;font-size:14px;font-family:Menlo">Please review,</p><p style="margin:0px;font-size:14px;font-family:Menlo"><br></p><p style="margin:0px;font-size:14px;font-family:Menlo">
Thanks,</p><p style="margin:0px;font-size:14px;font-family:Menlo">Manman</p><p style="margin:0px;font-size:14px;font-family:Menlo"><br></p></div></div>