Home | History | Annotate | Download | only in IR

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 FCall = Builder.CreateCall(V, None);
227 Builder.setFastMathFlags(FMF);
229 FCall = Builder.CreateCall(Callee, None);
230 EXPECT_TRUE(Builder.getFastMathFlags().any());
231 EXPECT_TRUE(Builder.getFastMathFlags().NoNaNs);
234 FCall = Builder.CreateCall(V, None);
235 EXPECT_TRUE(Builder.getFastMathFlags().any());
236 EXPECT_TRUE(Builder.getFastMathFlags().NoNaNs);
239 Builder.clearFastMathFlags();
242 F = Builder.CreateFDiv(F, F);
255 IRBuilder<NoFolder> Builder(BB);
258 GlobalVariable *G = new GlobalVariable(*M, Builder.getInt32Ty(), true,
260 Value *V = Builder.CreateLoad(G);
262 cast<BinaryOperator>(Builder.CreateNSWAdd(V, V))->hasNoSignedWrap());
264 cast<BinaryOperator>(Builder.CreateNSWMul(V, V))->hasNoSignedWrap());
266 cast<BinaryOperator>(Builder.CreateNSWSub(V, V))->hasNoSignedWrap());
268 Builder.CreateShl(V, V, "", /* NUW */ false, /* NSW */ true))
272 cast<BinaryOperator>(Builder.CreateNUWAdd(V, V))->hasNoUnsignedWrap());
274 cast<BinaryOperator>(Builder.CreateNUWMul(V, V))->hasNoUnsignedWrap());
276 cast<BinaryOperator>(Builder.CreateNUWSub(V, V))->hasNoUnsignedWrap());
278 Builder.CreateShl(V, V, "", /* NUW */ true, /* NSW */ false))
282 Constant *C = Builder.getInt32(42);
283 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNSWAdd(C, C))
285 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNSWSub(C, C))
287 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNSWMul(C, C))
290 Builder.CreateShl(C, C, "", /* NUW */ false, /* NSW */ true))
293 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNUWAdd(C, C))
295 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNUWSub(C, C))
297 EXPECT_TRUE(cast<OverflowingBinaryOperator>(Builder.CreateNUWMul(C, C))
300 Builder.CreateShl(C, C, "", /* NUW */ true, /* NSW */ false))
305 IRBuilder<> Builder(BB);
306 EXPECT_FALSE(Builder.getFastMathFlags().allowReciprocal());
312 Builder.setDefaultFPMathTag(FPMathA);
315 IRBuilder<>::FastMathFlagGuard Guard(Builder);
318 Builder.setFastMathFlags(FMF);
319 Builder.setDefaultFPMathTag(FPMathB);
320 EXPECT_TRUE(Builder.getFastMathFlags().allowReciprocal());
321 EXPECT_EQ(FPMathB, Builder.getDefaultFPMathTag());
324 EXPECT_FALSE(Builder.getFastMathFlags().allowReciprocal());
325 EXPECT_EQ(FPMathA, Builder.getDefaultFPMathTag());
327 Value *F = Builder.CreateLoad(GV);
330 IRBuilder<>::InsertPointGuard Guard(Builder);
331 Builder.SetInsertPoint(cast<Instruction>(F));
332 EXPECT_EQ(F, &*Builder.GetInsertPoint());
335 EXPECT_EQ(BB->end(), Builder.GetInsertPoint());
336 EXPECT_EQ(BB, Builder.GetInsertBlock());
340 IRBuilder<> Builder(BB);
349 AllocaInst *I = Builder.CreateAlloca(Builder.getInt8Ty());
359 IRBuilder<> Builder(BB);
361 auto VecTy = VectorType::get(Builder.getInt64Ty(), 4);
362 auto Elt1 = Builder.getInt64(-1);
363 auto Elt2 = Builder.getInt64(-2);
365 Vec = Builder.CreateInsertElement(Vec, Elt1, Builder.getInt8(1));
366 Vec = Builder.CreateInsertElement(Vec, Elt2, 2);
367 auto X1 = Builder.CreateExtractElement(Vec, 1);
368 auto X2 = Builder.CreateExtractElement(Vec, Builder.getInt32(2));
374 IRBuilder<> Builder(BB);
376 auto String1a = Builder.CreateGlobalStringPtr("TestString", "String1a");
377 auto String1b = Builder.CreateGlobalStringPtr("TestString", "String1b", 0);
378 auto String2 = Builder.CreateGlobalStringPtr("TestString", "String2", 1);
379 auto String3 = Builder.CreateGlobalString("TestString", "String3", 2);
407 IRBuilder<> Builder(Ctx);
408 Builder.SetInsertPoint(Br);
409 EXPECT_EQ(DL1, Builder.getCurrentDebugLocation());
410 auto Call1 = Builder.CreateCall(Callee, None);
414 Builder.SetInsertPoint(Call1->getParent(), Call1->getIterator());
415 EXPECT_EQ(DL2, Builder.getCurrentDebugLocation());
416 auto Call2 = Builder.CreateCall(Callee, None);
423 IRBuilder<> Builder(BB);