OSDN Git Service

[FunctionAttrs] Remove readonly and writeonly assertion
authorJohannes Doerfert <jdoerfert@anl.gov>
Mon, 15 Jul 2019 17:31:26 +0000 (17:31 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Mon, 15 Jul 2019 17:31:26 +0000 (17:31 +0000)
commite0b4696b74ca9436e4e48c2ccfef3be91925e388
tree38b0053350336206f971bf787fcf5e63c03beb18
parentcc2cc7ff3de10907d4481b0585d3cbbc819f55b5
[FunctionAttrs] Remove readonly and writeonly assertion

There are scenarios where mutually recursive functions may cause the SCC
to contain both read only and write only functions. This removes an
assertion when adding read attributes which caused a crash with a the
provided test case, and instead just doesn't add the attributes.

Patch by Luke Lau <luke.lau@intel.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366090 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/FunctionAttrs.cpp
test/Transforms/FunctionAttrs/read-write-scc.ll [new file with mode: 0644]