[llvm] r266344 - AMDGPU: change a redundant if () to an assert(). NFC
Nicolai Haehnle via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 14 10:42:19 PDT 2016
Author: nha
Date: Thu Apr 14 12:42:18 2016
New Revision: 266344
URL: http://llvm.org/viewvc/llvm-project?rev=266344&view=rev
Log:
AMDGPU: change a redundant if () to an assert(). NFC
Summary:
I've been carrying this change around with me for a while, because the if ()
managed to confuse me while following the code. All callers ensure that the
assertion holds.
Reviewers: arsenm, tstellarAMD
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D19042
Modified:
llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp?rev=266344&r1=266343&r2=266344&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp Thu Apr 14 12:42:18 2016
@@ -341,8 +341,7 @@ void SIAnnotateControlFlow::handleLoop(B
void SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) {
llvm::Loop *L = LI->getLoopFor(BB);
- if (Stack.back().first != BB)
- return;
+ assert(Stack.back().first == BB);
if (L && L->getHeader() == BB) {
// We can't insert an EndCF call into a loop header, because it will
More information about the llvm-commits
mailing list