ArgumentPromotion: correctly transfer TBAA tags and alignments.
authorManman Ren <manman.ren@gmail.com>
Fri, 15 Nov 2013 20:41:15 +0000 (20:41 +0000)
committerManman Ren <manman.ren@gmail.com>
Fri, 15 Nov 2013 20:41:15 +0000 (20:41 +0000)
commitc160efc28b815dbea73f0243f0729c1f0e1fabdb
treeeaf402e998166f034659e42d45351c60cddd6348
parent3a226015a0ca52936763a079da582656164c2908
ArgumentPromotion: correctly transfer TBAA tags and alignments.

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.

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.

PR17906

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194846 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/ArgumentPromotion.cpp
test/Transforms/ArgumentPromotion/reserve-tbaa.ll [new file with mode: 0644]