Displaying 6 results from an estimated 6 matches for "casttosinttype".
2008 Feb 16
3
[LLVMdev] linux/x86-64 codegen support
...ist in EmitBuiltinAlloca.
(try:
bool TreeToLLVM::EmitBuiltinAlloca(tree exp, Value *&Result) {
tree arglist = TREE_OPERAND(exp, 1);
if (!validate_arglist(arglist, INTEGER_TYPE, VOID_TYPE)) {
debug_tree(arglist);
return false;
}
Value *Amt = Emit(TREE_VALUE(arglist), 0);
Amt = CastToSIntType(Amt, Type::Int32Ty);
Result = Builder.CreateAlloca(Type::Int8Ty, Amt, "tmp");
return true;
}
for a pretty (?) print of the tree at that point)
Andrew
On 2/16/08, Török Edwin <edwintorok at gmail.com> wrote:
> Andrew Lenharth wrote:
> > Interestingly, in the .i file th...
2008 Feb 16
0
[LLVMdev] linux/x86-64 codegen support
...> bool TreeToLLVM::EmitBuiltinAlloca(tree exp, Value *&Result) {
> tree arglist = TREE_OPERAND(exp, 1);
> if (!validate_arglist(arglist, INTEGER_TYPE, VOID_TYPE)) {
> debug_tree(arglist);
> return false;
> }
> Value *Amt = Emit(TREE_VALUE(arglist), 0);
> Amt = CastToSIntType(Amt, Type::Int32Ty);
> Result = Builder.CreateAlloca(Type::Int8Ty, Amt, "tmp");
> return true;
> }
> for a pretty (?) print of the tree at that point)
This is very strange. I built a cross compiler to x86_64-unknown-
linux-gnu and it seems to work for me:
./cc1 /Users/sa...
2007 Apr 20
2
[LLVMdev] llvm-gcc Bug, Looking for Advice on Fix
...ue *SrcPtr, Value *Size,
unsigned Align) {
const Type *SBP = PointerType::get(Type::Int8Ty);
const Type *IntPtr = TD.getIntPtrType();
Value *Ops[4] = {
CastToType(Instruction::BitCast, DestPtr, SBP),
CastToType(Instruction::BitCast, SrcPtr, SBP),
CastToSIntType(Size, IntPtr),
ConstantInt::get(Type::Int32Ty, Align)
};
new CallInst(Intrinsic::getDeclaration(TheModule,
(IntPtr == Type::Int32Ty) ?
Intrinsic::memcpy_i32 :
In...
2008 Feb 16
0
[LLVMdev] linux/x86-64 codegen support
Andrew Lenharth wrote:
> Interestingly, in the .i file there are 2 __builtin_alloca, and
> EmitBuiltinAlloca is only being called once.
>
>
Hmm, here EmitBuiltinAlloca gets called twice, but it looks like
validate_arglist is rejecting the args both times.
I have 2 calls to alloca generated:
$ grep alloca x.bc|grep call
%tmp21 = call i8* @alloca( i64 %tmp20 ) nounwind
2008 Feb 16
2
[LLVMdev] linux/x86-64 codegen support
Interestingly, in the .i file there are 2 __builtin_alloca, and
EmitBuiltinAlloca is only being called once.
Andrew
On 2/16/08, Andrew Lenharth <andrewl at lenharth.org> wrote:
> libcpp/charset.c:631 turns into:
>
> %tmp16 = tail call i64 @strlen( i8* %to ) nounwind readonly
> ; <i64> [#uses=1]
> %tmp18 = tail call i64 @strlen( i8* %from ) nounwind
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...ArrayAddr = ArrayAddrLV.Ptr;
+ ArrayAlign = ArrayAddrLV.Alignment;
} else {
ArrayAddr = Emit(Array, 0);
+ ArrayAlign = expr_align(ArrayTreeType) / 8;
}
Value *IndexVal = Emit(Index, 0);
@@ -5971,20 +5992,27 @@ LValue TreeToLLVM::EmitLV_ARRAY_REF(tree
IndexVal = CastToSIntType(IndexVal, IntPtrTy);
// If this is an index into an LLVM array, codegen as a GEP.
- if (isArrayCompatible(ArrayType)) {
+ if (isArrayCompatible(ArrayTreeType)) {
Value *Idxs[2] = { ConstantInt::get(Type::Int32Ty, 0), IndexVal };
Value *Ptr = Builder.CreateGEP(ArrayAddr, Idxs, Idx...