OSDN Git Service

Fix auto-upgrade of TBAA tags in Bitcode Reader
authorMehdi Amini <mehdi.amini@apple.com>
Wed, 14 Sep 2016 22:29:59 +0000 (22:29 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Wed, 14 Sep 2016 22:29:59 +0000 (22:29 +0000)
commita364825f51384b1a5a532e4759551219549bd6bd
tree0b2ddc3416c0890c6e757b1809f02b9383d231d9
parent86a6238dca2b84e17b036e898281378e2a0f0139
Fix auto-upgrade of TBAA tags in Bitcode Reader

If TBAA is on an intrinsic and it gets upgraded, it'll delete the call
instruction that we collected in a vector. Even if we were to use
WeakVH, it'll drop the TBAA and we'll hit the assert on the upgrade
path.

r263673 gave a shot to make sure the TBAA upgrade happens before
intrinsics upgrade, but failed to account for all cases.

Instead of collecting instructions in a vector, this patch makes it
just upgrade the TBAA on the fly, because metadata are always
already loaded at this point.

Differential Revision: https://reviews.llvm.org/D24533

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281549 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/AutoUpgrade.h
lib/AsmParser/LLParser.cpp
lib/Bitcode/Reader/BitcodeReader.cpp
lib/IR/AutoUpgrade.cpp
test/LTO/X86/Inputs/remangle_intrinsics_tbaa.ll [new file with mode: 0644]
test/LTO/X86/remangle_intrinsics_tbaa.ll [new file with mode: 0644]
tools/llvm-link/llvm-link.cpp