[PATCH] D38099: Fix crashes with -fprofile-use + new pass manager in queens.c from the testsuite (bugzilla bug 33776)

Tony Jiang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 14:26:40 PDT 2017


jtony created this revision.

The problem was reported here: (bug 33776: https://bugs.llvm.org/show_bug.cgi?id=33776)

The other places which use getCachedResult(), they check the pointer is not NULL. So probably we just need to check the ORE pointer is not NULL as well (the crash happens at line 203 in lib/Transforms/Scalar/LICM.cpp).  Especially there is a comment in  the source code which says the fatal error emitting when ORE pointer is NULL should probably be optional rather than required.

With the proper checks in this patch,  the crash goes away. However, this may not be the eventual solution, if people have other better solutions for this issue, we are very interested to hear them.


https://reviews.llvm.org/D38099

Files:
  lib/Transforms/IPO/SampleProfile.cpp
  lib/Transforms/IPO/WholeProgramDevirt.cpp
  lib/Transforms/Scalar/GVN.cpp
  lib/Transforms/Scalar/LICM.cpp
  lib/Transforms/Scalar/LoopDataPrefetch.cpp
  lib/Transforms/Scalar/LoopDistribute.cpp
  lib/Transforms/Scalar/LoopInterchange.cpp
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  lib/Transforms/Scalar/TailRecursionElimination.cpp
  lib/Transforms/Utils/LoopUnroll.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38099.116067.patch
Type: text/x-patch
Size: 56646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170920/206f0db0/attachment.bin>


More information about the llvm-commits mailing list