LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AutoUpgrade.cpp
Go to the documentation of this file.
1 //===-- AutoUpgrade.cpp - Implement auto-upgrade helper functions ---------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the auto-upgrade helper functions
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "llvm/AutoUpgrade.h"
15 #include "llvm/IR/Constants.h"
16 #include "llvm/IR/Function.h"
17 #include "llvm/IR/IRBuilder.h"
18 #include "llvm/IR/Instruction.h"
19 #include "llvm/IR/IntrinsicInst.h"
20 #include "llvm/IR/LLVMContext.h"
21 #include "llvm/IR/Module.h"
22 #include "llvm/Support/CFG.h"
23 #include "llvm/Support/CallSite.h"
25 #include <cstring>
26 using namespace llvm;
27 
28 // Upgrade the declarations of the SSE4.1 functions whose arguments have
29 // changed their type from v4f32 to v2i64.
31  Function *&NewFn) {
32  // Check whether this is an old version of the function, which received
33  // v4f32 arguments.
34  Type *Arg0Type = F->getFunctionType()->getParamType(0);
35  if (Arg0Type != VectorType::get(Type::getFloatTy(F->getContext()), 4))
36  return false;
37 
38  // Yes, it's old, replace it with new version.
39  F->setName(F->getName() + ".old");
40  NewFn = Intrinsic::getDeclaration(F->getParent(), IID);
41  return true;
42 }
43 
44 static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
45  assert(F && "Illegal to upgrade a non-existent Function.");
46 
47  // Quickly eliminate it, if it's not a candidate.
48  StringRef Name = F->getName();
49  if (Name.size() <= 8 || !Name.startswith("llvm."))
50  return false;
51  Name = Name.substr(5); // Strip off "llvm."
52 
53  switch (Name[0]) {
54  default: break;
55  case 'a': {
56  if (Name.startswith("arm.neon.vclz")) {
57  Type* args[2] = {
58  F->arg_begin()->getType(),
60  };
61  // Can't use Intrinsic::getDeclaration here as it adds a ".i1" to
62  // the end of the name. Change name from llvm.arm.neon.vclz.* to
63  // llvm.ctlz.*
64  FunctionType* fType = FunctionType::get(F->getReturnType(), args, false);
65  NewFn = Function::Create(fType, F->getLinkage(),
66  "llvm.ctlz." + Name.substr(14), F->getParent());
67  return true;
68  }
69  if (Name.startswith("arm.neon.vcnt")) {
71  F->arg_begin()->getType());
72  return true;
73  }
74  break;
75  }
76  case 'c': {
77  if (Name.startswith("ctlz.") && F->arg_size() == 1) {
78  F->setName(Name + ".old");
80  F->arg_begin()->getType());
81  return true;
82  }
83  if (Name.startswith("cttz.") && F->arg_size() == 1) {
84  F->setName(Name + ".old");
86  F->arg_begin()->getType());
87  return true;
88  }
89  break;
90  }
91  case 'o':
92  // We only need to change the name to match the mangling including the
93  // address space.
94  if (F->arg_size() == 2 && Name.startswith("objectsize.")) {
95  Type *Tys[2] = { F->getReturnType(), F->arg_begin()->getType() };
97  F->setName(Name + ".old");
100  return true;
101  }
102  }
103  break;
104 
105  case 'x': {
106  if (Name.startswith("x86.sse2.pcmpeq.") ||
107  Name.startswith("x86.sse2.pcmpgt.") ||
108  Name.startswith("x86.avx2.pcmpeq.") ||
109  Name.startswith("x86.avx2.pcmpgt.") ||
110  Name.startswith("x86.avx.vpermil.") ||
111  Name == "x86.avx.movnt.dq.256" ||
112  Name == "x86.avx.movnt.pd.256" ||
113  Name == "x86.avx.movnt.ps.256" ||
114  Name == "x86.sse42.crc32.64.8" ||
115  (Name.startswith("x86.xop.vpcom") && F->arg_size() == 2)) {
116  NewFn = 0;
117  return true;
118  }
119  // SSE4.1 ptest functions may have an old signature.
120  if (Name.startswith("x86.sse41.ptest")) {
121  if (Name == "x86.sse41.ptestc")
123  if (Name == "x86.sse41.ptestz")
125  if (Name == "x86.sse41.ptestnzc")
127  }
128  // frcz.ss/sd may need to have an argument dropped
129  if (Name.startswith("x86.xop.vfrcz.ss") && F->arg_size() == 2) {
130  F->setName(Name + ".old");
133  return true;
134  }
135  if (Name.startswith("x86.xop.vfrcz.sd") && F->arg_size() == 2) {
136  F->setName(Name + ".old");
139  return true;
140  }
141  // Fix the FMA4 intrinsics to remove the 4
142  if (Name.startswith("x86.fma4.")) {
143  F->setName("llvm.x86.fma" + Name.substr(8));
144  NewFn = F;
145  return true;
146  }
147  break;
148  }
149  }
150 
151  // This may not belong here. This function is effectively being overloaded
152  // to both detect an intrinsic which needs upgrading, and to provide the
153  // upgraded form of the intrinsic. We should perhaps have two separate
154  // functions for this.
155  return false;
156 }
157 
159  NewFn = 0;
160  bool Upgraded = UpgradeIntrinsicFunction1(F, NewFn);
161 
162  // Upgrade intrinsic attributes. This does not change the function.
163  if (NewFn)
164  F = NewFn;
165  if (unsigned id = F->getIntrinsicID())
167  (Intrinsic::ID)id));
168  return Upgraded;
169 }
170 
172  // Nothing to do yet.
173  return false;
174 }
175 
176 // UpgradeIntrinsicCall - Upgrade a call to an old intrinsic to be a call the
177 // upgraded intrinsic. All argument and return casting must be provided in
178 // order to seamlessly integrate with existing context.
180  Function *F = CI->getCalledFunction();
181  LLVMContext &C = CI->getContext();
182  IRBuilder<> Builder(C);
183  Builder.SetInsertPoint(CI->getParent(), CI);
184 
185  assert(F && "Intrinsic call is not direct?");
186 
187  if (!NewFn) {
188  // Get the Function's name.
189  StringRef Name = F->getName();
190 
191  Value *Rep;
192  // Upgrade packed integer vector compares intrinsics to compare instructions
193  if (Name.startswith("llvm.x86.sse2.pcmpeq.") ||
194  Name.startswith("llvm.x86.avx2.pcmpeq.")) {
195  Rep = Builder.CreateICmpEQ(CI->getArgOperand(0), CI->getArgOperand(1),
196  "pcmpeq");
197  // need to sign extend since icmp returns vector of i1
198  Rep = Builder.CreateSExt(Rep, CI->getType(), "");
199  } else if (Name.startswith("llvm.x86.sse2.pcmpgt.") ||
200  Name.startswith("llvm.x86.avx2.pcmpgt.")) {
201  Rep = Builder.CreateICmpSGT(CI->getArgOperand(0), CI->getArgOperand(1),
202  "pcmpgt");
203  // need to sign extend since icmp returns vector of i1
204  Rep = Builder.CreateSExt(Rep, CI->getType(), "");
205  } else if (Name == "llvm.x86.avx.movnt.dq.256" ||
206  Name == "llvm.x86.avx.movnt.ps.256" ||
207  Name == "llvm.x86.avx.movnt.pd.256") {
208  IRBuilder<> Builder(C);
209  Builder.SetInsertPoint(CI->getParent(), CI);
210 
211  Module *M = F->getParent();
214  MDNode *Node = MDNode::get(C, Elts);
215 
216  Value *Arg0 = CI->getArgOperand(0);
217  Value *Arg1 = CI->getArgOperand(1);
218 
219  // Convert the type of the pointer to a pointer to the stored type.
220  Value *BC = Builder.CreateBitCast(Arg0,
222  "cast");
223  StoreInst *SI = Builder.CreateStore(Arg1, BC);
224  SI->setMetadata(M->getMDKindID("nontemporal"), Node);
225  SI->setAlignment(16);
226 
227  // Remove intrinsic.
228  CI->eraseFromParent();
229  return;
230  } else if (Name.startswith("llvm.x86.xop.vpcom")) {
231  Intrinsic::ID intID;
232  if (Name.endswith("ub"))
234  else if (Name.endswith("uw"))
236  else if (Name.endswith("ud"))
238  else if (Name.endswith("uq"))
240  else if (Name.endswith("b"))
242  else if (Name.endswith("w"))
244  else if (Name.endswith("d"))
246  else if (Name.endswith("q"))
248  else
249  llvm_unreachable("Unknown suffix");
250 
251  Name = Name.substr(18); // strip off "llvm.x86.xop.vpcom"
252  unsigned Imm;
253  if (Name.startswith("lt"))
254  Imm = 0;
255  else if (Name.startswith("le"))
256  Imm = 1;
257  else if (Name.startswith("gt"))
258  Imm = 2;
259  else if (Name.startswith("ge"))
260  Imm = 3;
261  else if (Name.startswith("eq"))
262  Imm = 4;
263  else if (Name.startswith("ne"))
264  Imm = 5;
265  else if (Name.startswith("true"))
266  Imm = 6;
267  else if (Name.startswith("false"))
268  Imm = 7;
269  else
270  llvm_unreachable("Unknown condition");
271 
272  Function *VPCOM = Intrinsic::getDeclaration(F->getParent(), intID);
273  Rep = Builder.CreateCall3(VPCOM, CI->getArgOperand(0),
274  CI->getArgOperand(1), Builder.getInt8(Imm));
275  } else if (Name == "llvm.x86.sse42.crc32.64.8") {
278  Value *Trunc0 = Builder.CreateTrunc(CI->getArgOperand(0), Type::getInt32Ty(C));
279  Rep = Builder.CreateCall2(CRC32, Trunc0, CI->getArgOperand(1));
280  Rep = Builder.CreateZExt(Rep, CI->getType(), "");
281  } else {
282  bool PD128 = false, PD256 = false, PS128 = false, PS256 = false;
283  if (Name == "llvm.x86.avx.vpermil.pd.256")
284  PD256 = true;
285  else if (Name == "llvm.x86.avx.vpermil.pd")
286  PD128 = true;
287  else if (Name == "llvm.x86.avx.vpermil.ps.256")
288  PS256 = true;
289  else if (Name == "llvm.x86.avx.vpermil.ps")
290  PS128 = true;
291 
292  if (PD256 || PD128 || PS256 || PS128) {
293  Value *Op0 = CI->getArgOperand(0);
294  unsigned Imm = cast<ConstantInt>(CI->getArgOperand(1))->getZExtValue();
296 
297  if (PD128)
298  for (unsigned i = 0; i != 2; ++i)
299  Idxs.push_back(Builder.getInt32((Imm >> i) & 0x1));
300  else if (PD256)
301  for (unsigned l = 0; l != 4; l+=2)
302  for (unsigned i = 0; i != 2; ++i)
303  Idxs.push_back(Builder.getInt32(((Imm >> (l+i)) & 0x1) + l));
304  else if (PS128)
305  for (unsigned i = 0; i != 4; ++i)
306  Idxs.push_back(Builder.getInt32((Imm >> (2 * i)) & 0x3));
307  else if (PS256)
308  for (unsigned l = 0; l != 8; l+=4)
309  for (unsigned i = 0; i != 4; ++i)
310  Idxs.push_back(Builder.getInt32(((Imm >> (2 * i)) & 0x3) + l));
311  else
312  llvm_unreachable("Unexpected function");
313 
314  Rep = Builder.CreateShuffleVector(Op0, Op0, ConstantVector::get(Idxs));
315  } else {
316  llvm_unreachable("Unknown function for CallInst upgrade.");
317  }
318  }
319 
320  CI->replaceAllUsesWith(Rep);
321  CI->eraseFromParent();
322  return;
323  }
324 
325  std::string Name = CI->getName().str();
326  CI->setName(Name + ".old");
327 
328  switch (NewFn->getIntrinsicID()) {
329  default:
330  llvm_unreachable("Unknown function for CallInst upgrade.");
331 
332  case Intrinsic::ctlz:
333  case Intrinsic::cttz:
334  assert(CI->getNumArgOperands() == 1 &&
335  "Mismatch between function args and call args");
336  CI->replaceAllUsesWith(Builder.CreateCall2(NewFn, CI->getArgOperand(0),
337  Builder.getFalse(), Name));
338  CI->eraseFromParent();
339  return;
340 
342  CI->replaceAllUsesWith(Builder.CreateCall2(NewFn,
343  CI->getArgOperand(0),
344  CI->getArgOperand(1),
345  Name));
346  CI->eraseFromParent();
347  return;
348 
350  // Change name from llvm.arm.neon.vclz.* to llvm.ctlz.*
351  CI->replaceAllUsesWith(Builder.CreateCall2(NewFn, CI->getArgOperand(0),
352  Builder.getFalse(),
353  "llvm.ctlz." + Name.substr(14)));
354  CI->eraseFromParent();
355  return;
356  }
357  case Intrinsic::ctpop: {
358  CI->replaceAllUsesWith(Builder.CreateCall(NewFn, CI->getArgOperand(0)));
359  CI->eraseFromParent();
360  return;
361  }
362 
365  CI->replaceAllUsesWith(Builder.CreateCall(NewFn, CI->getArgOperand(1),
366  Name));
367  CI->eraseFromParent();
368  return;
369 
373  // The arguments for these intrinsics used to be v4f32, and changed
374  // to v2i64. This is purely a nop, since those are bitwise intrinsics.
375  // So, the only thing required is a bitcast for both arguments.
376  // First, check the arguments have the old type.
377  Value *Arg0 = CI->getArgOperand(0);
378  if (Arg0->getType() != VectorType::get(Type::getFloatTy(C), 4))
379  return;
380 
381  // Old intrinsic, add bitcasts
382  Value *Arg1 = CI->getArgOperand(1);
383 
384  Value *BC0 =
385  Builder.CreateBitCast(Arg0,
387  "cast");
388  Value *BC1 =
389  Builder.CreateBitCast(Arg1,
391  "cast");
392 
393  CallInst* NewCall = Builder.CreateCall2(NewFn, BC0, BC1, Name);
394  CI->replaceAllUsesWith(NewCall);
395  CI->eraseFromParent();
396  return;
397  }
398  }
399 }
400 
401 // This tests each Function to determine if it needs upgrading. When we find
402 // one we are interested in, we then upgrade all calls to reflect the new
403 // function.
405  assert(F && "Illegal attempt to upgrade a non-existent intrinsic.");
406 
407  // Upgrade the function and check if it is a totaly new function.
408  Function *NewFn;
409  if (UpgradeIntrinsicFunction(F, NewFn)) {
410  if (NewFn != F) {
411  // Replace all uses to the old function with the new one if necessary.
412  for (Value::use_iterator UI = F->use_begin(), UE = F->use_end();
413  UI != UE; ) {
414  if (CallInst *CI = dyn_cast<CallInst>(*UI++))
415  UpgradeIntrinsicCall(CI, NewFn);
416  }
417  // Remove old function, no longer used, from the module.
418  F->eraseFromParent();
419  }
420  }
421 }
422 
425  assert(MD && "UpgradeInstWithTBAATag should have a TBAA tag");
426  // Check if the tag uses struct-path aware TBAA format.
427  if (isa<MDNode>(MD->getOperand(0)) && MD->getNumOperands() >= 3)
428  return;
429 
430  if (MD->getNumOperands() == 3) {
431  Value *Elts[] = {
432  MD->getOperand(0),
433  MD->getOperand(1)
434  };
435  MDNode *ScalarType = MDNode::get(I->getContext(), Elts);
436  // Create a MDNode <ScalarType, ScalarType, offset 0, const>
437  Value *Elts2[] = {
438  ScalarType, ScalarType,
440  MD->getOperand(2)
441  };
443  } else {
444  // Create a MDNode <MD, MD, offset 0>
445  Value *Elts[] = {MD, MD,
448  }
449 }
450 
451 Instruction *llvm::UpgradeBitCastInst(unsigned Opc, Value *V, Type *DestTy,
452  Instruction *&Temp) {
453  if (Opc != Instruction::BitCast)
454  return 0;
455 
456  Temp = 0;
457  Type *SrcTy = V->getType();
458  if (SrcTy->isPtrOrPtrVectorTy() && DestTy->isPtrOrPtrVectorTy() &&
459  SrcTy->getPointerAddressSpace() != DestTy->getPointerAddressSpace()) {
460  LLVMContext &Context = V->getContext();
461 
462  // We have no information about target data layout, so we assume that
463  // the maximum pointer size is 64bit.
464  Type *MidTy = Type::getInt64Ty(Context);
465  Temp = CastInst::Create(Instruction::PtrToInt, V, MidTy);
466 
467  return CastInst::Create(Instruction::IntToPtr, Temp, DestTy);
468  }
469 
470  return 0;
471 }
472 
473 Value *llvm::UpgradeBitCastExpr(unsigned Opc, Constant *C, Type *DestTy) {
474  if (Opc != Instruction::BitCast)
475  return 0;
476 
477  Type *SrcTy = C->getType();
478  if (SrcTy->isPtrOrPtrVectorTy() && DestTy->isPtrOrPtrVectorTy() &&
479  SrcTy->getPointerAddressSpace() != DestTy->getPointerAddressSpace()) {
480  LLVMContext &Context = C->getContext();
481 
482  // We have no information about target data layout, so we assume that
483  // the maximum pointer size is 64bit.
484  Type *MidTy = Type::getInt64Ty(Context);
485 
487  DestTy);
488  }
489 
490  return 0;
491 }
static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn)
Definition: AutoUpgrade.cpp:44
use_iterator use_end()
Definition: Value.h:152
LinkageTypes getLinkage() const
Definition: GlobalValue.h:218
static IntegerType * getInt1Ty(LLVMContext &C)
Definition: Type.cpp:238
LLVMContext & getContext() const
Definition: Function.cpp:167
size_t size() const
size - Get the string size.
Definition: StringRef.h:113
The main container class for the LLVM Intermediate Representation.
Definition: Module.h:112
unsigned getNumOperands() const
getNumOperands - Return number of MDNode operands.
Definition: Metadata.h:142
bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
Definition: StringRef.h:217
StringRef substr(size_t Start, size_t N=npos) const
Definition: StringRef.h:392
std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:181
bool isPtrOrPtrVectorTy() const
Definition: Type.h:225
Type * getReturnType() const
Definition: Function.cpp:179
MDNode - a tuple of other values.
Definition: Metadata.h:69
F(f)
static IntegerType * getInt64Ty(LLVMContext &C)
Definition: Type.cpp:242
Value * CreateICmpEQ(Value *LHS, Value *RHS, const Twine &Name="")
Definition: IRBuilder.h:1206
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Definition: Type.cpp:218
void UpgradeIntrinsicCall(CallInst *CI, Function *NewFn)
Value * CreateShuffleVector(Value *V1, Value *V2, Value *Mask, const Twine &Name="")
Definition: IRBuilder.h:1366
static MDNode * get(LLVMContext &Context, ArrayRef< Value * > Vals)
Definition: Metadata.cpp:268
size_t arg_size() const
Definition: Function.cpp:248
static Constant * getNullValue(Type *Ty)
Definition: Constants.cpp:111
StringRef getName() const
Definition: Value.cpp:167
Value * getOperand(unsigned i) const LLVM_READONLY
getOperand - Return specified operand.
Definition: Metadata.cpp:307
void UpgradeCallsToIntrinsic(Function *F)
static Type * getFloatTy(LLVMContext &C)
Definition: Type.cpp:230
#define llvm_unreachable(msg)
unsigned getNumArgOperands() const
static Constant * get(ArrayRef< Constant * > V)
Definition: Constants.cpp:923
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Definition: IRBuilder.h:421
void setName(const Twine &Name)
Definition: Value.cpp:175
Value * CreateICmpSGT(Value *LHS, Value *RHS, const Twine &Name="")
Definition: IRBuilder.h:1224
static Constant * getPtrToInt(Constant *C, Type *Ty)
Definition: Constants.cpp:1637
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
Definition: Type.cpp:361
bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn)
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Definition: Function.cpp:683
void replaceAllUsesWith(Value *V)
Definition: Value.cpp:303
static Constant * getIntToPtr(Constant *C, Type *Ty)
Definition: Constants.cpp:1649
StoreInst * CreateStore(Value *Val, Value *Ptr, bool isVolatile=false)
Definition: IRBuilder.h:888
void SetInsertPoint(BasicBlock *TheBB)
This specifies that created instructions should be appended to the end of the specified block...
Definition: IRBuilder.h:83
static CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=0)
Construct any of the CastInst subclasses.
Type * getParamType(unsigned i) const
Parameter type accessors.
Definition: DerivedTypes.h:128
unsigned getIntrinsicID() const LLVM_READONLY
Definition: Function.cpp:371
LLVM Constant Representation.
Definition: Constant.h:41
arg_iterator arg_begin()
Definition: Function.h:410
LLVMContext & getContext() const
All values hold a context through their type.
Definition: Value.cpp:517
void setMetadata(unsigned KindID, MDNode *Node)
Definition: Metadata.cpp:589
static bool UpgradeSSE41Function(Function *F, Intrinsic::ID IID, Function *&NewFn)
Definition: AutoUpgrade.cpp:30
Instruction * UpgradeBitCastInst(unsigned Opc, Value *V, Type *DestTy, Instruction *&Temp)
bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:208
static PointerType * getUnqual(Type *ElementType)
Definition: DerivedTypes.h:436
Value * CreateZExt(Value *V, Type *DestTy, const Twine &Name="")
Definition: IRBuilder.h:1071
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
Definition: IRBuilder.h:1132
Type * getType() const
Definition: Value.h:111
bool UpgradeGlobalVariable(GlobalVariable *GV)
MDNode * getMetadata(unsigned KindID) const
Definition: Instruction.h:140
ConstantInt * getInt32(uint32_t C)
Get a constant 32-bit value.
Definition: IRBuilder.h:276
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
Definition: Constants.cpp:492
Function * getCalledFunction() const
Value * getArgOperand(unsigned i) const
ConstantInt * getFalse()
Get the constant value for i1 false.
Definition: IRBuilder.h:261
use_iterator use_begin()
Definition: Value.h:150
std::string getName(ID id, ArrayRef< Type * > Tys=None)
Definition: Function.cpp:400
static IntegerType * getInt32Ty(LLVMContext &C)
Definition: Type.cpp:241
Value * CreateSExt(Value *V, Type *DestTy, const Twine &Name="")
Definition: IRBuilder.h:1074
#define I(x, y, z)
Definition: MD5.cpp:54
FunctionType * getFunctionType() const
Definition: Function.cpp:171
virtual void eraseFromParent()
Definition: Function.cpp:187
AttributeSet getAttributes(LLVMContext &C, ID id)
void setAttributes(AttributeSet attrs)
Set the attribute list for this Function.
Definition: Function.h:173
CallInst * CreateCall2(Value *Callee, Value *Arg1, Value *Arg2, const Twine &Name="")
Definition: IRBuilder.h:1310
Module * getParent()
Definition: GlobalValue.h:286
Value * CreateTrunc(Value *V, Type *DestTy, const Twine &Name="")
Definition: IRBuilder.h:1068
LLVM Value Representation.
Definition: Value.h:66
void setAlignment(unsigned Align)
CallInst * CreateCall(Value *Callee, const Twine &Name="")
Definition: IRBuilder.h:1304
static VectorType * get(Type *ElementType, unsigned NumElements)
Definition: Type.cpp:706
void UpgradeInstWithTBAATag(Instruction *I)
ConstantInt * getInt8(uint8_t C)
Get a constant 8-bit value.
Definition: IRBuilder.h:266
Value * UpgradeBitCastExpr(unsigned Opc, Constant *C, Type *DestTy)
unsigned getMDKindID(StringRef Name) const
Definition: Module.cpp:117
const BasicBlock * getParent() const
Definition: Instruction.h:52
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, const Twine &N="", Module *M=0)
Definition: Function.h:128
CallInst * CreateCall3(Value *Callee, Value *Arg1, Value *Arg2, Value *Arg3, const Twine &Name="")
Definition: IRBuilder.h:1315