[PATCH] D67232: [Attributor][Fix] Initialize the cache prior to using it

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 10:23:04 PDT 2019


jdoerfert created this revision.
jdoerfert added reviewers: uenoku, sstefan1.
Herald added subscribers: bollu, hiraditya.
Herald added a project: LLVM.

There were segfaults as we modified and iterated the instruction maps in
the cache at the same time. This was happening because we created new
instructions while we populated the cache. This fix changes the order
in which we perform these actions. First, the caches for the whole
module are created, then we start to create abstract attributes.

I don't have a unit test but the LLVM test suite exposes this problem.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67232

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Transforms/IPO/Attributor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67232.218945.patch
Type: text/x-patch
Size: 7749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190905/597eff6c/attachment.bin>


More information about the llvm-commits mailing list