[llvm-commits] [llvm] r131609 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Devang Patel
dpatel at apple.com
Wed May 18 17:13:33 PDT 2011
Author: dpatel
Date: Wed May 18 19:13:33 2011
New Revision: 131609
URL: http://llvm.org/viewvc/llvm-project?rev=131609&view=rev
Log:
Use IRBuilder.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=131609&r1=131608&r2=131609&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Wed May 18 19:13:33 2011
@@ -2404,8 +2404,8 @@
Value *Sub = SI->getCondition();
if (!Offset->isNullValue())
- Sub = BinaryOperator::CreateAdd(Sub, Offset, Sub->getName()+".off", SI);
- Value *Cmp = new ICmpInst(SI, ICmpInst::ICMP_ULT, Sub, NumCases, "switch");
+ Sub = Builder.CreateAdd(Sub, Offset, Sub->getName()+".off");
+ Value *Cmp = Builder.CreateICmpULT(Sub, NumCases, "switch");
Builder.CreateCondBr(Cmp, SI->getSuccessor(1), SI->getDefaultDest());
// Prune obsolete incoming values off the successor's PHI nodes.
More information about the llvm-commits
mailing list