BasicBlock *Cont = OldBB->splitBasicBlock(Inst);
OldBB->getTerminator()->eraseFromParent();
- // FIXME: add unlikely branch taken metadata?
if (Cmp)
BranchInst::Create(getTrapBB(), Cont, Cmp, OldBB);
else
SizeValue = Builder->CreateMul(SizeValue, ArraySize);
return NotConst;
+ // function arguments
+ } else if (Argument *A = dyn_cast<Argument>(Alloc)) {
+ if (!A->hasByValAttr())
+ return Dunno;
+
+ PointerType *PT = cast<PointerType>(A->getType());
+ Size = TD->getTypeAllocSize(PT->getElementType());
+ return Const;
+
// ptr = select(ptr1, ptr2)
} else if (SelectInst *SI = dyn_cast<SelectInst>(Alloc)) {
uint64_t SizeFalse;
%4 = load i128* %3, align 4
ret void
}
+
+; CHECK: @f11
+define void @f11(i128* byval %x) nounwind {
+ %1 = bitcast i128* %x to i8*
+ %2 = getelementptr inbounds i8* %1, i64 16
+; CHECK: br label
+ %3 = load i8* %2, align 4
+ ret void
+}