[llvm] r340638 - [AST] Simplify code minorly using pattern match [NFC]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 24 12:13:39 PDT 2018
Author: reames
Date: Fri Aug 24 12:13:39 2018
New Revision: 340638
URL: http://llvm.org/viewvc/llvm-project?rev=340638&view=rev
Log:
[AST] Simplify code minorly using pattern match [NFC]
Modified:
llvm/trunk/lib/Transforms/Scalar/LICM.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=340638&r1=340637&r2=340638&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Fri Aug 24 12:13:39 2018
@@ -681,14 +681,10 @@ bool llvm::canSinkOrHoistInst(Instructio
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);
More information about the llvm-commits
mailing list