Displaying 20 results from an estimated 36 matches for "treetollvm".
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...st { i32, i32 }* %4 to i64* ; <i64*>
[#uses=1]
%6 = load i64* %key_token2_addr, align 8 ;
<i64> [#uses=1]
store i64 %6, i64* %5, align 8
...
The store alignment 8 is wrong. The address iospec has 4-byte
alignment. The problem is llvm-gcc TreeToLLVM::EmitMODIFY_EXPR:
LValue LV = EmitLV(lhs);
bool isVolatile = TREE_THIS_VOLATILE(lhs);
unsigned Alignment = expr_align(exp) / 8
It's using the alignment of the expression, rather than the memory
object of LValue.
The patch saves the alignment of the memory object in LValue returned...
2006 Sep 11
0
[LLVMdev] trying to build llvm-gcc in linux/amd64
...on a amd64. I had to add the attached
> patch to get the build system to select the correct library. Now the
Applied.
> build fails while compiling a code that has __builtin_va_copy. The
> attached test.i fails with:
>
> cc1: ../../trunk/gcc/llvm-convert.cpp:443: llvm::Value*
> TreeToLLVM::Emit(tree_node*, llvm::Value*): Assertion
> `(isAggregateType(((exp)->common.type)) == (DestLoc != 0) || ((enum
> tree_code) (exp)->common.code) == MODIFY_EXPR) && "Didn't pass DestLoc
> to an aggregate expr, or passed it to scalar!"' failed.
>
> I kn...
2006 Sep 11
5
[LLVMdev] trying to build llvm-gcc in linux/amd64
I am trying to build llvm-gcc4 on a amd64. I had to add the attached
patch to get the build system to select the correct library. Now the
build fails while compiling a code that has __builtin_va_copy. The
attached test.i fails with:
cc1: ../../trunk/gcc/llvm-convert.cpp:443: llvm::Value*
TreeToLLVM::Emit(tree_node*, llvm::Value*): Assertion
`(isAggregateType(((exp)->common.type)) == (DestLoc != 0) || ((enum
tree_code) (exp)->common.code) == MODIFY_EXPR) && "Didn't pass DestLoc
to an aggregate expr, or passed it to scalar!"' failed.
I know that linux/amd64 is n...
2009 May 07
0
[LLVMdev] llvm-gcc's sjlj-eh support
Hi,
many people suggest that if we want llvm to support sjlj-eh, we
should modify the llvm-gcc to generate sjlj-style IR.
yeah, I'm digging into the llvm-gcc now. there are some functions,
at the llvm-gcc
e.g
TreeToLLVM::CreateExceptionValues() ,
BasicBlock *TreeToLLVM::getPostPad(unsigned RegionNo),
void TreeToLLVM::EmitLandingPads(),
void TreeToLLVM::EmitPostPads() ,
void TreeToLLVM::EmitUnwindBlock()
the above functions are relative for llvm-gcc generate the
exception-IR, but for dwarf-style! so we should ch...
2010 May 24
2
[LLVMdev] linker errors when trying to link llvm-gcc
...o): In function `getPointerAlignment':
/home/anatolyy/qctp406/pakman/depot/users/anatolyy/proto/crosscompiler/llvm-gcc-4.2-2.7.source-objtree/gcc/../../llvm-gcc-4.2-2.7.source/gcc/llvm-convert.cpp:142:
undefined reference to `get_pointer_alignment'
libbackend.a(llvm-convert.o): In function
`TreeToLLVM::EmitBuiltinDwarfSPColumn(tree_node*, llvm::Value*&)':
/home/anatolyy/qctp406/pakman/depot/users/anatolyy/proto/crosscompiler/llvm-gcc-4.2-2.7.source-objtree/gcc/../../llvm-gcc-4.2-2.7.source/gcc/llvm-convert.cpp:6318:
undefined reference to `validate_arglist'
libbackend.a(llvm-convert....
2009 Jan 09
0
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
..., TYPE_ALIGN(TREE_TYPE(exp)) / 8);
> + }
> + case STRING_CST: {
> + Value *Ptr = TreeConstantToLLVM::EmitLV_STRING_CST(exp);
> + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8);
> + }
These are all equivalent to using expr_align, right?
> @@ -2290,7 +2301,7 @@ Value *TreeToLLVM::EmitLoadOfLValue(tree
> LValue LV = EmitLV(exp);
> bool isVolatile = TREE_THIS_VOLATILE(exp);
> const Type *Ty = ConvertType(TREE_TYPE(exp));
> - unsigned Alignment = expr_align(exp) / 8;
> + unsigned Alignment = LV.getAlignment();
Here expr_align(exp) is correct I th...
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
...LLVM 1.6.
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
-------------- next part --------------
Index: llvm-convert.cpp
===================================================================
--- llvm-convert.cpp (revision 111673)
+++ llvm-convert.cpp (working copy)
@@ -795,14 +795,18 @@ void TreeToLLVM::EmitMemCpy(Value *DestP
unsigned Align) {
const Type *SBP = PointerType::get(Type::SByteTy);
static Function *MemCpy = 0;
- if (!MemCpy)
- MemCpy = TheModule->getOrInsertFunction("llvm.memcpy", Type::VoidTy, SBP,
-...
2007 Nov 07
3
[LLVMdev] RFC: llvm-convert.cpp Patch
How about this patch then?
-bw
Index: gcc/llvm-convert.cpp
===================================================================
--- gcc/llvm-convert.cpp (revision 43658)
+++ gcc/llvm-convert.cpp (working copy)
@@ -758,7 +758,7 @@
}
-Value *TreeToLLVM::Emit(tree exp, Value *DestLoc) {
+Value *TreeToLLVM::Emit(tree exp, Value *DestLoc, unsigned Alignment) {
assert((isAggregateTreeType(TREE_TYPE(exp)) == (DestLoc != 0) ||
TREE_CODE(exp) == MODIFY_EXPR) &&
"Didn't pass DestLoc to an aggregate expr, or pas...
2007 Apr 20
2
[LLVMdev] llvm-gcc Bug, Looking for Advice on Fix
Ok, I've tracked down the problem I've had bootstrapping
llvm-gcc. The culprit is in TreeToLLVM::EmitMemCpy:
void TreeToLLVM::EmitMemCpy(Value *DestPtr, Value *SrcPtr, Value *Size,
unsigned Align) {
const Type *SBP = PointerType::get(Type::Int8Ty);
const Type *IntPtr = TD.getIntPtrType();
Value *Ops[4] = {
CastToType(Instruction::BitCast, DestPtr, S...
2007 Nov 07
0
[LLVMdev] RFC: llvm-convert.cpp Patch
On Nov 6, 2007, at 5:45 PM, Bill Wendling wrote:
> Hi all,
>
> This patch is to fix a problem on PPC64 where an unaligned memcpy is
> generated. The testcase is this:
>
> $ cat testcase.c
> void Qux() {
> char Bar[11] = {0};
> }
>
> What happens is that we produce LLVM code like this:
>
> call void @llvm.memcpy.i64( i8* %event_list2, i8* getelementptr ([11
2008 Feb 16
3
[LLVMdev] linux/x86-64 codegen support
See the bug for a reduction and the gimple trees. validate_arglist
definately is rejecting the arglist 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 = B...
2008 May 22
2
[LLVMdev] Latest SVN head (gcc front end) build failed
...x=/usr/local/
--enable-llvm=/home/rajika/project/llvm/llvm-objects
it gave me the following errors
../../dst-directory/gcc/llvm-convert.cpp:1163: error: 'Create' is not a
member of 'llvm::CastInst'
../../dst-directory/gcc/llvm-convert.cpp: In member function
'llvm::AllocaInst* TreeToLLVM::CreateTemporary(const llvm::Type*)':
../../dst-directory/gcc/llvm-convert.cpp:1250: error: 'Create' is not a
member of 'llvm::CastInst'
make[3]: *** [llvm-convert.o] Error 1
make[3]: Leaving directory
`/home/rajika/project/llvm/llvm-gcc4.2-objects/gcc'
make[2]: *** [all-sta...
2007 Nov 07
7
[LLVMdev] RFC: llvm-convert.cpp Patch
Hi all,
This patch is to fix a problem on PPC64 where an unaligned memcpy is
generated. The testcase is this:
$ cat testcase.c
void Qux() {
char Bar[11] = {0};
}
What happens is that we produce LLVM code like this:
call void @llvm.memcpy.i64( i8* %event_list2, i8* getelementptr ([11
x i8]* @C.103.30698, i32 0, i32 0), i64 11, i32 8 )
Notice that it has an 8-byte alignment. However, the Bar
2010 Jan 07
1
[LLVMdev] "Value has wrong type!" on Bool:4 bitfield
...hecking=yes.
On the attached test case (which is g++.dg/expr/bitfield4.C from the
GCC 4.2 testsuite) I get:
$ cc1plus bitfield4.ii -emit-llvm-bc -o bitfield4.o -quiet
cc1plus: /home/foad/svn/antix/toolchain/branches/w/foad/2757llvm26/toolchain/llvm/llvm-gcc/gcc/llvm-convert.cpp:999:
llvm::Value* TreeToLLVM::Emit(tree_node*, const MemRef*): Assertion
`(Result == 0 || (((enum tree_code)
(((exp)->common.type))->common.code) == VOID_TYPE) ||
isa<VectorType>(ConvertType(((exp)->common.type))) ||
Result->getType() == ConvertType(((exp)->common.type))) && "Value has
wrong t...
2008 Feb 02
0
[LLVMdev] another llvm-gcc-4.2 compilation problem
...nd.o):(.rodata._ZTVN9__gnu_cxx13stdio_filebufIcSt11char_traitsIcEEE[vtable
for __gnu_cxx::stdio_filebuf<char, std::char_traits<char> >]+0x30):
undefined reference to `std::basic_streambuf<char, std::char_traits<char>
>::uflow()'
libbackend.a(llvm-convert.o): In function
`TreeToLLVM::CreateTemporary(llvm::Type const*)':
llvm-convert.cpp:(.text+0x427): undefined reference to
`std::basic_string<char, std::char_traits<char>, std::allocator<char>
>::~basic_string()'
llvm-convert.cpp:(.text+0x491): undefined reference to
`std::basic_string<char, std::ch...
2008 Jul 22
2
[LLVMdev] BITS_BIG_ENDIAN in llvm-gcc
There are various functions in llvm-convert.cpp that depend on BITS_BIG_ENDIAN:
TreeToLLVM::EmitLoadOfLValue()
TreeToLLVM::EmitMODIFY_EXPR()
InsertBitFieldValue()
ProcessBitFieldInitialization()
The comments say things like:
// If this target has bitfields laid out in big-endian order, invert the bit
// in the word if needed.
// If this is a big-endian bit-field, take...
2006 Mar 02
4
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Vladimir Prus wrote:
>>> The instructions seem to have one path wrong. It says to get:
>>
>> I'll put together a tarball today. That will be easier than dealing with
>> a patch, and it will include a bunch of bugfixes since the previous email.
> Further into process, I get this error:
> In file included from
2008 May 22
0
[LLVMdev] Latest SVN head (gcc front end) build failed
...ika/project/llvm/llvm-objects
>
> it gave me the following errors
>
> ../../dst-directory/gcc/llvm-convert.cpp:1163: error: 'Create' is
> not a member of 'llvm::CastInst'
> ../../dst-directory/gcc/llvm-convert.cpp: In member function
> 'llvm::AllocaInst* TreeToLLVM::CreateTemporary(const llvm::Type*)':
> ../../dst-directory/gcc/llvm-convert.cpp:1250: error: 'Create' is
> not a member of 'llvm::CastInst'
> make[3]: *** [llvm-convert.o] Error 1
> make[3]: Leaving directory `/home/rajika/project/llvm/llvm-gcc4.2-
> objects/g...
2007 Sep 19
2
[LLVMdev] Building current llvm-gcc-4.0 TOT fails on darwin x86
...1: failed assertion `0 &&
"Unknown FP type!"'
../../llvm-gcc-4.0/gcc/libgcc2.c: In function '__divxc3':
../../llvm-gcc-4.0/gcc/libgcc2.c:1722: internal compiler error: Abort
trap#
It seems to be related to the following function getting the wrong
typeid:
Value *TreeToLLVM::EmitBuiltinUnaryFPOp(Value *Amt, const char *F32Name,
const char *F64Name) {
const char *Name = 0;
switch (Amt->getType()->getTypeID()) {
default: assert(0 && "Unknown FP type!");
case Type::FloatTyID: Name = F32Name; b...
2006 Sep 05
2
[LLVMdev] gfortran: array constructor problems
...tArrayCONSTRUCTOR
(exp=0x45e48d20) at ../../src/gcc/llvm-convert.cpp:4083
#5 0x0028b624 in emit_global_to_llvm (decl=0x45e4c700) at
../../src/gcc/llvm-backend.cpp:377
#6 0x00284844 in rest_of_decl_compilation (decl=0x45e4c700,
top_level=0, at_end=0) at ../../src/gcc/passes.c:252
#7 0x002a7da8 in TreeToLLVM::EmitBIND_EXPR (this=0xbfffe63c,
exp=0x45e4d5a0, DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:1119
#8 0x00297ac0 in TreeToLLVM::Emit (this=0xbfffe63c, exp=0x45e4d5a0,
DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:474
#9 0x002882f0 in llvm_emit_code_for_current_function
(fndecl=0x45e4ae00) at ....