diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2015-08-19 06:22:33 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2015-08-19 06:22:33 +0000 |
commit | 2c852543a32849f2c47544e17105ea9f253a1ded (patch) | |
tree | 82082a898b196e460f2c204fed79ecf379cba272 /llvm | |
parent | 9a379c19a9d147ec4dadab17722c8fb2c08402de (diff) | |
download | bcm5719-llvm-2c852543a32849f2c47544e17105ea9f253a1ded.tar.gz bcm5719-llvm-2c852543a32849f2c47544e17105ea9f253a1ded.zip |
Clean up this file a little. Remove dead casts, casting Values to Values. Adjust some comments for typos and whitespace. NFC.
llvm-svn: 245419
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 72651d67571..dee64091e55 100644 --- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -918,8 +918,8 @@ 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 + // Step 2: Replace the precondition from "if (x == 0) goto loop-exit" to + // "if (NewCount == 0) loop-exit". Withtout this change, the intrinsic // function would be partial dead code, and downstream passes will drag // it back from the precondition block to the preheader. { @@ -941,9 +941,9 @@ void LoopIdiomRecognize::transformLoopToPopcount(BasicBlock *PreCondBB, // loop in question, which enble 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 become dead after - // the transformation. It is lots easier to prove a countable loop dead - // than to prove a noncountable one. (In some C dialects, a infite loop + // - If the loop only counts population, the entire loop becomes dead after + // the transformation. It is a lot easier to prove a countable loop dead + // than to prove a noncountable one. (In some C dialects, an infinite loop // isn't dead even if it computes nothing useful. In general, DCE needs // to prove a noncountable loop finite before safely delete it.) // @@ -966,8 +966,8 @@ void LoopIdiomRecognize::transformLoopToPopcount(BasicBlock *PreCondBB, PHINode *TcPhi = PHINode::Create(Ty, 2, "tcphi", Body->begin()); Builder.SetInsertPoint(LbCond); - Value *Opnd1 = cast<Value>(TcPhi); - Value *Opnd2 = cast<Value>(ConstantInt::get(Ty, 1)); + Value *Opnd1 = TcPhi; + Value *Opnd2 = ConstantInt::get(Ty, 1); Instruction *TcDec = cast<Instruction>( Builder.CreateSub(Opnd1, Opnd2, "tcdec", false, true)); @@ -978,7 +978,7 @@ void LoopIdiomRecognize::transformLoopToPopcount(BasicBlock *PreCondBB, (LbBr->getSuccessor(0) == Body) ? CmpInst::ICMP_UGT : CmpInst::ICMP_SLE; LbCond->setPredicate(Pred); LbCond->setOperand(0, TcDec); - LbCond->setOperand(1, cast<Value>(ConstantInt::get(Ty, 0))); + LbCond->setOperand(1, ConstantInt::get(Ty, 0)); } // Step 4: All the references to the original population counter outside |