Harel Cain
2011-Sep-07 13:32 UTC
[LLVMdev] Disabling certain optimizations in llvm-gcc and llc
Hi all, I'm trying to prevent two things from happening: 1. Intrinsic memcpy calls of for example 16 bytes in the IR code being translated into movl commands in x86 assembly code, for example, this code: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %3, i8* getelementptr inbounds ([16 x i8]* @.str1, i32 0, i32 0), i32 16, i32 1, i1 false) translated into this x86 assembly movl $6384738, 12(%ecx) # imm = 0x616C62 movl $543452274, 8(%ecx) # imm = 0x20646C72 movl $1870078063, 4(%ecx) # imm = 0x6F77206F movl $1819043176, (%ecx) # imm = 0x6C6C6568 this happens even if I run llc -O0. Any way to prevent it, instead calling memcpy in the assembly listing? 2. sizeof's being resolved to literals already at the llvm-gcc front end stage when emitting IR, no matter if I use -O0 flag Is there any way to prevent it? Thanks a lot in advance! Harel Cain -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110907/bdbf4309/attachment.html>
Duncan Sands
2011-Sep-07 14:02 UTC
[LLVMdev] Disabling certain optimizations in llvm-gcc and llc
Hi Harel,> I'm trying to prevent two things from happening: > > 1. Intrinsic memcpy calls of for example 16 bytes in the IR code being > translated into movl commands in x86 assembly code, for example, this code: > call void @llvm.memcpy.p0i8.p0i8.i32(i8* %3, i8* getelementptr inbounds > ([16 x i8]* @.str1, i32 0, i32 0), i32 16, i32 1, i1 false) > translated into this x86 assembly > movl $6384738, 12(%ecx) # imm = 0x616C62 > movl $543452274, 8(%ecx) # imm = 0x20646C72 > movl $1870078063, 4(%ecx) # imm = 0x6F77206F > movl $1819043176, (%ecx) # imm = 0x6C6C6568 > this happens even if I run llc -O0. Any way to prevent it, instead calling > memcpy in the assembly listing?-fno-builtin> 2. sizeof's being resolved to literals already at the llvm-gcc front end stage > when emitting IR, no matter if I use -O0 flag Is there any way to prevent it?No. The GCC parts of llvm-gcc fold sizeof to a constant long before it hits the LLVM parts. Best wishes, Duncan.
Anton Korobeynikov
2011-Sep-07 14:10 UTC
[LLVMdev] Disabling certain optimizations in llvm-gcc and llc
Hello> 2. sizeof's being resolved to literals already at the llvm-gcc front end > stage when emitting IR, no matter if I use -O0 flag Is there any way to > prevent it?No. It's performed even before IR emission. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Reasonably Related Threads
- [LLVMdev] Resolving sizeof's; target triples; type optimizations
- [LLVMdev] Resolving sizeof's; target triples; type optimizations
- [LLVMdev] Resolving sizeof's; target triples; type optimizations
- [LLVMdev] Resolving sizeof's; target triples; type optimizations
- How can I make llvm intrinsic functions declarations survive from optimizations.