mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-18 21:24:32 -04:00
[NFC] Unify guards detection
We have multiple places in code where we try to identify whether or not some instruction is a guard. This patch factors out this logic into a separate utility function which works uniformly in all places. Differential Revision: https://reviews.llvm.org/D51152 Reviewed By: fedor.sergeev git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340921 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Transforms/Utils/GuardUtils.h"
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
@@ -172,8 +173,7 @@ void AliasSet::addUnknownInst(Instruction *I, AliasAnalysis &AA) {
|
||||
// Guards are marked as modifying memory for control flow modelling purposes,
|
||||
// but don't actually modify any specific memory location.
|
||||
using namespace PatternMatch;
|
||||
bool MayWriteMemory = I->mayWriteToMemory() &&
|
||||
!match(I, m_Intrinsic<Intrinsic::experimental_guard>()) &&
|
||||
bool MayWriteMemory = I->mayWriteToMemory() && !isGuard(I) &&
|
||||
!(I->use_empty() && match(I, m_Intrinsic<Intrinsic::invariant_start>()));
|
||||
if (!MayWriteMemory) {
|
||||
Alias = SetMayAlias;
|
||||
|
||||
Reference in New Issue
Block a user