From b3796f64a48da48445f8b0fdd32c0e0b4640f29f Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 19 Aug 2015 06:22:33 +0000 Subject: [PATCH] Clean up this file a little. Remove dead casts, casting Values to Values. Adjust some comments for typos and whitespace. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245419 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 72651d67571..dee64091e55 100644 --- a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/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(TcPhi); - Value *Opnd2 = cast(ConstantInt::get(Ty, 1)); + Value *Opnd1 = TcPhi; + Value *Opnd2 = ConstantInt::get(Ty, 1); Instruction *TcDec = cast( 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(ConstantInt::get(Ty, 0))); + LbCond->setOperand(1, ConstantInt::get(Ty, 0)); } // Step 4: All the references to the original population counter outside -- 2.34.1