similar to: [LLVMdev] Question about simple constant propagation pass

Displaying 20 results from an estimated 9000 matches similar to: "[LLVMdev] Question about simple constant propagation pass"

2013 Mar 28
0
[LLVMdev] Question about simple constant propagation pass
Hi Yunming, On 28/03/13 03:15, yunming zhang wrote: > Hi, > > I just started working with llvm, I am trying to test and improve the constant > propagation pass (-constprop), > > I have two main questions, > > 1. I wrote my own test file, which has something like > int a = 1 > int b = a + 2; > int c = b + 3; > print c > > However, non
2003 Jun 18
2
dyn.load() function problem help!
Hi! I would like to call a Fortran subroutine within R. For doing this, I first built a shared library for loading into R under Unix and it was successful. But when I tried to load a shared library using dyn.load() function for use in .Fortran(), I got an error message. The command I input below in R is: >dyn.load("aaa.so") The reslut is: error in
2010 Feb 26
0
[LLVMdev] a question of the simple constant propagation pass
Hi, I copied the code from LLVM2.6 below. line 81 removes 'I' from the worklist. But 'I' is already removed from the list at line 67 when it is popped from the list. Could the loop (line 73-75) insert this I into the worklist again? In the case where 'I' can be constant-folding, Line 80 says 'I' is a dead instruction. Can 'I' appears in its def-use chain?
2013 Jun 25
1
[LLVMdev] ldexp constant propagation
Hi, I have the C program below, which contains a mathematical expression. C code: ====== void ControlledRotationPiMinus(int target, int control, int j) { ControlledPhase(target,control,-PI/(2*pow(2,j))); } int main() { .. int b = 3; for (int j=1; j < b; j++) ControlledRotationPiMinus(target, control, j); .. } Here is what I am doing: The function ControlledRotationPiMinus is called
2013 Jan 18
2
[LLVMdev] Weird volatile propagation ?
Hi All, Using clang+llvm at head, I noticed a weird behaviour with the following reduced testcase : $ cat test.c #include <stdint.h> struct R { uint16_t a; uint16_t b; }; volatile struct R * const addr = (volatile struct R *) 416; void test(uint16_t a) { struct R r = { a, 1 }; *addr = r; } $ clang -O2 -o - -emit-llvm -S -c test.c ; ModuleID = 'test.c' target
2013 Jan 20
0
[LLVMdev] codegen of volatile aggregate copies (was "Weird volatile propagation" on llvm-dev)
As a results of my investigations, the thread is also added to cfe-dev. The context : while porting my company code from the LLVM/Clang releases 3.1 to 3.2, I stumbled on a code size and performance regression. The testcase is : $ cat test.c #include <stdint.h> struct R { uint16_t a; uint16_t b; }; volatile struct R * const addr = (volatile struct R *) 416; void test(uint16_t a) {
2013 Jan 20
2
[LLVMdev] [cfe-dev] codegen of volatile aggregate copies (was "Weird volatile propagation" on llvm-dev)
I doubt you needed to add cfe-dev here. Sorry I hadn't seen this, this seems like an easy and simple deficiency in the IR intrinsic for memcpy. See below. On Sun, Jan 20, 2013 at 1:42 PM, Arnaud de Grandmaison < arnaud.allarddegrandmaison at parrot.com> wrote: > define void @test(i16 zeroext %a) nounwind uwtable { > %r.sroa.0 = alloca i16, align 2 > %r.sroa.1 = alloca i16,
2014 Sep 10
3
[LLVMdev] failed folding with constant array with opt -O3
I came in to an email this morning that said basically the same thing for the reduced example we were looking at. However, the original IR it came from (before hand reduction) had the data layout set correctly, so there's probably still *something* going on. It's just not what I thought at first. :) Philip On 09/10/2014 02:26 AM, Roel Jordans wrote: > Looking at the -debug
2011 Apr 16
1
[LLVMdev] [Fwd: Re: [Fwd: Regarding Inter Procedural Constant Propagation]]
Hi, I used the following commands on the program attached below: llvm-gcc --emit-llvm main.c -c -o main.bc opt -ipconstprop main.bc -o main1.bc diff main.bc main1.bc no difference was o/p :( The Program Segment is as shown below: #include <stdio.h> void f1(int a) { a=a+1; printf("%d",a); } void f2() { int b; b=1; f1(b); } int main() { int
2010 Nov 11
0
[LLVMdev] string constant propagation
I'm wondering what is the best way to handle constant propagation for complex types in LLVM. For example, my language needs to be able to simplify expressions involving strings by precomputing (in my own constant propagation pass) various external function calls. Here's an example program: ---------------- ; ModuleID = 'LFunction' declare i8* @"set at SS"([5 x
2011 Apr 12
0
[LLVMdev] Regarding Inter Procedural Constant Propagation
Hi, I want to see the output of a InterProcedural Constant Propagation Pass IPCP in llvm. I have llvm 2.8 installed.And i used opt -print-after-all command to see the .bc output generated after each pass. However,this does not include dump produced by IPCP :( why? Kindly tell me how to view dump produced by IPCP. P.S: i have tried opt -ipcp src.bc -o src1.bc However the src.bc and src1.bc both
2013 Nov 22
0
[LLVMdev] constant propagation pass
Hi all, I run opt -O2 -debug-pass=Structure and I looked at the passes used.Is there a reason why O2 is not using the constant propagation pass? Thank you in advance, Niko -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131122/5020e4f6/attachment.html>
2011 Jul 15
0
[LLVMdev] Missing optimization in constant propagation?
On Fri, Jul 15, 2011 at 12:21 AM, Martin Apel <martin.apel at simpack.de> wrote: > Hi all, > > I stumbled across a peculiarity regarding constant propagation that I don't understand. I'm not sure, if I oversee anything or if it's a missing feature. > > I have created the following simple test function in C: > > int times_zero(int a) > { >  return (a *
2015 Jan 14
2
[LLVMdev] Bug in InsertElement constant propagation?
Ha here is what I was missing. Thanks Jon. It still seems to me that the transformation of LLVM IR is invalid is that right? I assume we shouldn't be converting APFloat to float in order to avoid such problems? -----Original Message----- From: Jonathan Roelofs [mailto:jonathan at codesourcery.com] Sent: Wednesday, January 14, 2015 9:39 AM To: Raoux, Thomas F; LLVM Developers Mailing List
2005 Jan 19
1
[LLVMdev] Constant Propagation Problem
Hello, I have some code which I was hoping the LLVM optimization passes would get rid of for me, but no such luck -- all the code does is store four float 0.f to memory, load four other floats from memory, load back the first four floats, multiply them together (here we should have always get 0) and finally store them back to memory. Any ideas why this isn't picked up by the constant
2015 Nov 02
8
[RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations
Hey all, I'd like to propose a new intrinsic for use in preventing optimizations from deleting IR due to constant propagation, dead code elimination, etc. # Background/Motivation In Rust we have a crate called `test` which provides a function, `black_box`, which is designed to be a no-op function that prevents constprop, die, etc from interfering with tests/benchmarks but otherwise
2011 Jul 15
2
[LLVMdev] Missing optimization in constant propagation?
Hi all, I stumbled across a peculiarity regarding constant propagation that I don't understand. I'm not sure, if I oversee anything or if it's a missing feature. I have created the following simple test function in C: int times_zero(int a) { return (a * 0); } Compiling this with GCC using dragonegg generates the following code: %int = type i32 define i32 @times_zero(i32 %a)
2015 Jan 15
2
[LLVMdev] Bug in InsertElement constant propagation?
I don't see a way to create a ConstantDataVector from Constant or form APFloat though. Did I oversee that? Is the solution to had a new get function in ConstantDataVector to allow that? Any hint on what would be the right fix otherwise? Thomas -----Original Message----- From: Jonathan Roelofs [mailto:jonathan at codesourcery.com] Sent: Wednesday, January 14, 2015 10:30 AM To: Raoux, Thomas
2015 Jan 14
2
[LLVMdev] Bug in InsertElement constant propagation?
Hi, When I run opt on the following LLVM IR: define i32 @foo() { bb0: %0 = bitcast i32 2139171423 to float %1 = insertelement <1 x float> undef, float %0, i32 0 %2 = extractelement <1 x float> %1, i32 0 %3 = bitcast float %2 to i32 ret i32 %3 } -> It generates: define i32 @foo() { bb0: ret i32 2143365727 } While tracking the value I see that the floating point value
2011 Oct 18
0
[LLVMdev] LLVM constant propagation optimization question
Hi Seb, > I'm writting following LLVM assembly: > > ; ModuleID = 'structaccess.ll' > not having a data layout string in your module disables many optimizations. Ciao, Duncan. > %struct._anon0 = type <{ i32, i32, i32 }> > > @s = common global %struct._anon0 zeroinitializer > > define arm_aapcscc void @foo() nounwind { > L.entry: > store i32