summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2015-08-19 06:25:30 +0000
committerNick Lewycky <nicholas@mxc.ca>2015-08-19 06:25:30 +0000
commit1098e496e1bf32400ae59bfab135eeb70e930b41 (patch)
treeb7313b632a82dc6abab9024f7c5aac44b86fa50f /llvm/lib/Transforms/Scalar
parent2c852543a32849f2c47544e17105ea9f253a1ded (diff)
downloadbcm5719-llvm-1098e496e1bf32400ae59bfab135eeb70e930b41.tar.gz
bcm5719-llvm-1098e496e1bf32400ae59bfab135eeb70e930b41.zip
More clean up, still NFC. Remove dead variables now that the casts are gone.
llvm-svn: 245420
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index dee64091e55..4ad1357ce8c 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -919,7 +919,7 @@ void LoopIdiomRecognize::transformLoopToPopcount(BasicBlock *PreCondBB,
}
// Step 2: Replace the precondition from "if (x == 0) goto loop-exit" to
- // "if (NewCount == 0) loop-exit". Withtout this change, the intrinsic
+ // "if (NewCount == 0) loop-exit". Without this change, the intrinsic
// function would be partial dead code, and downstream passes will drag
// it back from the precondition block to the preheader.
{
@@ -938,7 +938,7 @@ void LoopIdiomRecognize::transformLoopToPopcount(BasicBlock *PreCondBB,
}
// Step 3: Note that the population count is exactly the trip count of the
- // loop in question, which enble us to to convert the loop from noncountable
+ // loop in question, which enable us to to convert the loop from noncountable
// loop into a countable one. The benefit is twofold:
//
// - If the loop only counts population, the entire loop becomes dead after
@@ -966,10 +966,9 @@ void LoopIdiomRecognize::transformLoopToPopcount(BasicBlock *PreCondBB,
PHINode *TcPhi = PHINode::Create(Ty, 2, "tcphi", Body->begin());
Builder.SetInsertPoint(LbCond);
- Value *Opnd1 = TcPhi;
- Value *Opnd2 = ConstantInt::get(Ty, 1);
Instruction *TcDec = cast<Instruction>(
- Builder.CreateSub(Opnd1, Opnd2, "tcdec", false, true));
+ Builder.CreateSub(TcPhi, ConstantInt::get(Ty, 1),
+ "tcdec", false, true));
TcPhi->addIncoming(TripCnt, PreHead);
TcPhi->addIncoming(TcDec, Body);
OpenPOWER on IntegriCloud