Lines Matching refs:Builder
52 IRBuilder<> Builder(BB);
53 AllocaInst *Var1 = Builder.CreateAlloca(Builder.getInt8Ty());
54 AllocaInst *Var2 = Builder.CreateAlloca(Builder.getInt32Ty());
55 AllocaInst *Var3 = Builder.CreateAlloca(Builder.getInt8Ty(),
56 Builder.getInt32(123));
58 CallInst *Start1 = Builder.CreateLifetimeStart(Var1);
59 CallInst *Start2 = Builder.CreateLifetimeStart(Var2);
60 CallInst *Start3 = Builder.CreateLifetimeStart(Var3, Builder.getInt64(100));
62 EXPECT_EQ(Start1->getArgOperand(0), Builder.getInt64(-1));
63 EXPECT_EQ(Start2->getArgOperand(0), Builder.getInt64(-1));
64 EXPECT_EQ(Start3->getArgOperand(0), Builder.getInt64(100));
70 Value *End1 = Builder.CreateLifetimeEnd(Var1);
71 Builder.CreateLifetimeEnd(Var2);
72 Builder.CreateLifetimeEnd(Var3);
83 IRBuilder<> Builder(BB);
87 BranchInst *BI = Builder.CreateCondBr(Builder.getTrue(), TBB, FBB);
96 BI = Builder.CreateCondBr(Builder.getTrue(), TBB, FBB, Weights);
106 IRBuilder<> Builder(BB);
107 LandingPadInst *LP = Builder.CreateLandingPad(Builder.getInt32Ty(), 0, "LP");
120 IRBuilder<> Builder(BB);
121 IntegerType *Ty1 = Builder.getInt1Ty();
125 IntegerType *IntPtrTy = Builder.getIntPtrTy(*DL);
132 IRBuilder<> Builder(BB);
136 F = Builder.CreateLoad(GV);
137 F = Builder.CreateFAdd(F, F);
139 EXPECT_FALSE(Builder.getFastMathFlags().any());
145 Builder.SetFastMathFlags(FMF);
147 F = Builder.CreateFAdd(F, F);
148 EXPECT_FALSE(Builder.getFastMathFlags().any());
151 Builder.SetFastMathFlags(FMF);
153 F = Builder.CreateFAdd(F, F);
154 EXPECT_TRUE(Builder.getFastMathFlags().any());
160 F = Builder.CreateBinOp(Instruction::FAdd, F, F);
161 EXPECT_TRUE(Builder.getFastMathFlags().any());
166 F = Builder.CreateFDiv(F, F);
167 EXPECT_TRUE(Builder.getFastMathFlags().any());
168 EXPECT_TRUE(Builder.getFastMathFlags().UnsafeAlgebra);
173 Builder.clearFastMathFlags();
175 F = Builder.CreateFDiv(F, F);
182 Builder.SetFastMathFlags(FMF);
184 F = Builder.CreateFDiv(F, F);
185 EXPECT_TRUE(Builder.getFastMathFlags().any());
186 EXPECT_TRUE(Builder.getFastMathFlags().AllowReciprocal);
191 Builder.clearFastMathFlags();
193 FC = Builder.CreateFCmpOEQ(F, F);
200 Builder.SetFastMathFlags(FMF);
202 FC = Builder.CreateFCmpOEQ(F, F);
203 EXPECT_TRUE(Builder.getFastMathFlags().any());
204 EXPECT_TRUE(Builder.getFastMathFlags().AllowReciprocal);
209 Builder.clearFastMathFlags();
217 FCall = Builder.CreateCall(Callee, None);
222 Builder.SetFastMathFlags(FMF);
224 FCall = Builder.CreateCall(Callee, None);
225 EXPECT_TRUE(Builder.getFastMathFlags().any());
226 EXPECT_TRUE(Builder.getFastMathFlags().NoNaNs);
229 Builder.clearFastMathFlags();
232 F = Builder.CreateFDiv(F, F);
245 IRBuilder<true, NoFolder> Builder(BB);
248 GlobalVariable *G = new GlobalVariable(*M, Builder.getInt32Ty(), true,
250 Value *V = Builder.CreateLoad(G);
252 cast<BinaryOperator>(Builder.CreateNSWAdd(V, V))->hasNoSignedWrap());
254 cast<BinaryOperator>(Builder.CreateNSWMul(V, V))->hasNoSignedWrap());
256 cast<BinaryOperator>(Builder.CreateNSWSub(V, V))->hasNoSignedWrap());
258 Builder.CreateShl(V, V, "", /* NUW */ false, /* NSW */ true))
262 cast<BinaryOperator>(Builder.CreateNUWAdd(V, V))->hasNoUnsignedWrap());
264 cast<BinaryOperator>(Builder.CreateNUWMul(V, V))->hasNoUnsignedWrap());
266 cast<BinaryOperator>(Builder.CreateNUWSub(V, V))->hasNoUnsignedWrap());
268 Builder.CreateShl(V, V, "", /* NUW */ true, /* NSW */ false))
272 Constant *C = Builder.getInt32(42);
273 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNSWAdd(C, C))
275 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNSWSub(C, C))
277 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNSWMul(C, C))
280 Builder.CreateShl(C, C, "", /* NUW */ false, /* NSW */ true))
283 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNUWAdd(C, C))
285 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNUWSub(C, C))
287 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNUWMul(C, C))
290 Builder.CreateShl(C, C, "", /* NUW */ true, /* NSW */ false))
295 IRBuilder<> Builder(BB);
296 EXPECT_FALSE(Builder.getFastMathFlags().allowReciprocal());
302 Builder.SetDefaultFPMathTag(FPMathA);
305 IRBuilder<>::FastMathFlagGuard Guard(Builder);
308 Builder.SetFastMathFlags(FMF);
309 Builder.SetDefaultFPMathTag(FPMathB);
310 EXPECT_TRUE(Builder.getFastMathFlags().allowReciprocal());
311 EXPECT_EQ(FPMathB, Builder.getDefaultFPMathTag());
314 EXPECT_FALSE(Builder.getFastMathFlags().allowReciprocal());
315 EXPECT_EQ(FPMathA, Builder.getDefaultFPMathTag());
317 Value *F = Builder.CreateLoad(GV);
320 IRBuilder<>::InsertPointGuard Guard(Builder);
321 Builder.SetInsertPoint(cast<Instruction>(F));
322 EXPECT_EQ(F, &*Builder.GetInsertPoint());
325 EXPECT_EQ(BB->end(), Builder.GetInsertPoint());
326 EXPECT_EQ(BB, Builder.GetInsertBlock());
330 IRBuilder<> Builder(BB);
339 AllocaInst *I = Builder.CreateAlloca(Builder.getInt8Ty());
349 IRBuilder<> Builder(BB);
351 auto VecTy = VectorType::get(Builder.getInt64Ty(), 4);
352 auto Elt1 = Builder.getInt64(-1);
353 auto Elt2 = Builder.getInt64(-2);
355 Vec = Builder.CreateInsertElement(Vec, Elt1, Builder.getInt8(1));
356 Vec = Builder.CreateInsertElement(Vec, Elt2, 2);
357 auto X1 = Builder.CreateExtractElement(Vec, 1);
358 auto X2 = Builder.CreateExtractElement(Vec, Builder.getInt32(2));
364 IRBuilder<> Builder(BB);
366 auto String1a = Builder.CreateGlobalStringPtr("TestString", "String1a");
367 auto String1b = Builder.CreateGlobalStringPtr("TestString", "String1b", 0);
368 auto String2 = Builder.CreateGlobalStringPtr("TestString", "String2", 1);
369 auto String3 = Builder.CreateGlobalString("TestString", "String3", 2);
397 IRBuilder<> Builder(Ctx);
398 Builder.SetInsertPoint(Br);
399 EXPECT_EQ(DL1, Builder.getCurrentDebugLocation());
400 auto Call1 = Builder.CreateCall(Callee, None);
404 Builder.SetInsertPoint(Call1->getParent(), Call1->getIterator());
405 EXPECT_EQ(DL2, Builder.getCurrentDebugLocation());
406 auto Call2 = Builder.CreateCall(Callee, None);