From db4579d796c7a087f064c455dd39fc13a6f02d60 Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Thu, 7 Mar 2013 22:10:33 +0000 Subject: Don't create IRBuilder if we can return from the method earlier. llvm-svn: 176660 --- llvm/lib/Transforms/Scalar/SROA.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index e90fe907d59..dedbbde4f7b 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -1571,13 +1571,13 @@ private: void visitSelectInst(SelectInst &SI) { DEBUG(dbgs() << " original: " << SI << "\n"); - IRBuilder<> IRB(&SI); // If the select isn't safe to speculate, just use simple logic to emit it. SmallVector Loads; if (!isSafeSelectToSpeculate(SI, Loads)) return; + IRBuilder<> IRB(&SI); Use *Ops[2] = { &SI.getOperandUse(1), &SI.getOperandUse(2) }; AllocaPartitioning::iterator PIs[2]; AllocaPartitioning::PartitionUse PUs[2]; @@ -2450,7 +2450,6 @@ private: DEBUG(dbgs() << " original: " << LI << "\n"); Value *OldOp = LI.getOperand(0); assert(OldOp == OldPtr); - IRBuilder<> IRB(&LI); uint64_t Size = EndOffset - BeginOffset; bool IsSplitIntLoad = Size < TD.getTypeStoreSize(LI.getType()); @@ -2471,6 +2470,7 @@ private: return true; } + IRBuilder<> IRB(&LI); Type *TargetTy = IsSplitIntLoad ? Type::getIntNTy(LI.getContext(), Size * 8) : LI.getType(); bool IsPtrAdjusted = false; -- cgit v1.2.3