[PATCH] D27839: Strip invalid TBAA when reading bitcode

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 11:25:08 PST 2016

mehdi_amini marked an inline comment as done.
mehdi_amini added inline comments.

Comment at: llvm/lib/Bitcode/Reader/BitcodeReader.cpp:159
+    for (auto &I : instructions(F))
+      if (MDNode *TBAA = I.getMetadata(LLVMContext::MD_tbaa))
+        I.setMetadata(LLVMContext::MD_tbaa, nullptr);
sanjoy wrote:
> The checking is redundant -- you can just do `I.setMetadata(LLVMContext::MD_tbaa, nullptr)` unconditionally (that should not do anything if `MD_tbaa` was not present on the instruction).
Good point.

I also modified the test to check that we only strip the TBAA attachment on instructions.


More information about the llvm-commits mailing list