[FunctionAttrs] Use MemoryLocation::getOrNone() when infering memory attrs
authorNikita Popov <npopov@redhat.com>
Fri, 23 Sep 2022 11:55:07 +0000 (13:55 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 23 Sep 2022 11:56:55 +0000 (13:56 +0200)
commitfe196380ccd4f2ed0e78151e11387a299a72b337
tree6169123d79a0cf4fc611b7b6b1606d5fdcd413c6
parent623c4a7a55f716b96070a5c2f83fe0096cb38d38
[FunctionAttrs] Use MemoryLocation::getOrNone() when infering memory attrs

MemoryLocation::getOrNone() already has the necessary logic to
handle different instruction types. Use it, rather than repeating
a subset of the logic. This adds support for previously unhandled
instructions like atomicrmw.
llvm/lib/Transforms/IPO/FunctionAttrs.cpp
llvm/test/Transforms/FunctionAttrs/nosync.ll