1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

[AST] Simplify code minorly using pattern match [NFC]

llvm-svn: 340638
This commit is contained in:
Philip Reames 2018-08-24 19:13:39 +00:00
parent 4bc71970fe
commit e3a5749e52

View File

@ -681,14 +681,10 @@ bool llvm::canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
if (CI->mayThrow())
return false;
if (Function *F = CI->getCalledFunction())
switch (F->getIntrinsicID()) {
default: break;
// TODO: support invariant.start, and experimental.guard here
case Intrinsic::assume:
// Assumes don't actually alias anything or throw
return true;
};
using namespace PatternMatch;
if (match(CI, m_Intrinsic<Intrinsic::assume>()))
// Assumes don't actually alias anything or throw
return true;
// Handle simple cases by querying alias analysis.
FunctionModRefBehavior Behavior = AA->getModRefBehavior(CI);