mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Add CreateAlignmentAssumption to IRBuilder
Clang CodeGen had a utility function for creating pointer alignment assumptions using the @llvm.assume intrinsic. This functionality will also be needed by the inliner (to preserve function-argument alignment attributes when inlining), so this moves the utility function into IRBuilder where it can be used both by Clang CodeGen and also other LLVM-level code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219875 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -172,3 +172,14 @@ CallInst *IRBuilderBase::CreateLifetimeEnd(Value *Ptr, ConstantInt *Size) {
|
||||
Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::lifetime_end);
|
||||
return createCallHelper(TheFn, Ops, this);
|
||||
}
|
||||
|
||||
CallInst *IRBuilderBase::CreateAssumption(Value *Cond) {
|
||||
assert(Cond->getType() == getInt1Ty() &&
|
||||
"an assumption condition must be of type i1");
|
||||
|
||||
Value *Ops[] = { Cond };
|
||||
Module *M = BB->getParent()->getParent();
|
||||
Value *FnAssume = Intrinsic::getDeclaration(M, Intrinsic::assume);
|
||||
return createCallHelper(FnAssume, Ops, this);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user