diff options
author | Philip Reames <listmail@philipreames.com> | 2019-09-04 17:28:48 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2019-09-04 17:28:48 +0000 |
commit | 27820f99091d6547ed83ff20a2ea689ec68b9bf3 (patch) | |
tree | 38409c890311e770751e58f12beac22ea68f25e3 /llvm/lib/Transforms/Scalar/LoopPredication.cpp | |
parent | 2461061168f4ac4ca8a1823768a00d1c63355b1b (diff) | |
download | llvm-27820f99091d6547ed83ff20a2ea689ec68b9bf3.zip llvm-27820f99091d6547ed83ff20a2ea689ec68b9bf3.tar.gz llvm-27820f99091d6547ed83ff20a2ea689ec68b9bf3.tar.bz2 |
[Instruction] Add hasMetadata(Kind) helper [NFC]
It's a common idiom, so let's add the obvious wrapper for metadata kinds which are basically booleans.
llvm-svn: 370933
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopPredication.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopPredication.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp index 507a1e2..885c0e8 100644 --- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp +++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp @@ -543,7 +543,7 @@ bool LoopPredication::isLoopInvariantValue(const SCEV* S) { if (const auto *LI = dyn_cast<LoadInst>(U->getValue())) if (LI->isUnordered() && L->hasLoopInvariantOperands(LI)) if (AA->pointsToConstantMemory(LI->getOperand(0)) || - LI->getMetadata(LLVMContext::MD_invariant_load) != nullptr) + LI->hasMetadata(LLVMContext::MD_invariant_load)) return true; return false; } |