search for: loopcond

Displaying 6 results from an estimated 6 matches for "loopcond".

2009 Mar 02
0
[LLVMdev] Tight overlapping loops and performance
...stcase are irrelevant to your actual issue. In general, you'll probably get better results from LLVM with properly nested loops; LLVM's loop optimizers don't know how to deal with deal with overlapping loops. I'd suggest writing it more like the following: int timeout = 2000; int loopcond; do { timeoutwork(); do { timeout--; loopcond = computationresult(); } while (loopcond && timeout); } while (loopcond); -Eli
2009 Mar 02
2
[LLVMdev] Tight overlapping loops and performance
I was playing around in x86 assembly the other day, looking at ways to optimize my cooperative multitasking system. Currently, it uses a 'timeout' counter that is decremented each time through a loop, letting me stop the loop and go to the next cooperative thread if the loop runs a little long. The asm has two overlapping loops: --- _main: mov ecx, 1000000000 timeoutloop:
2009 Mar 02
3
[LLVMdev] Tight overlapping loops and performance
...like values are being swapped into and out of memory and not holding them in registers. That's why I was asking about other optimization passes, at first glance -mem2reg looked like a good candidate, but I didn't notice any improvement using it blindly. > int timeout = 2000; > int loopcond; > do { > timeoutwork(); > do { > timeout--; > loopcond = computationresult(); > } while (loopcond && timeout); > } while (loopcond); My current implementation uses something very similar, but if you'll notice the difference between this example and my examples is...
2015 Jun 12
2
[LLVMdev] How to insert basic block in a loop
Dear All I'm making a transformation pass that inserts a new basic block at the start of a loop. However when I try to change predecessor/successor relations, it does not consider the new block in the loop at all. So I got that just inserting a loop in a function before another loop is not enough. So how exactly to do this job? Regards, Marwa Yusuf Teaching Assistant - Computer Engineering
2014 Aug 02
2
[LLVMdev] Create "appending" section that can be partially dead stripped
On 01/08/14 19:37, Reid Kleckner wrote: > What happens if you drop appending linkage? I think it will just work, > since you are already using a custom section, which will ensure that all > the data appears contiguously in memory. Thanks for the suggestion, but it still puts everything in a single .section statement. > Although, I do worry about what LLVM's alias analysis will
2014 Aug 05
2
[LLVMdev] Create "appending" section that can be partially dead stripped
...to i64 %loopstart = ptrtoint [0 x i32]* @arrstart to i64 %loopcount = sub i64 %loopstop, %loopstart %looparrinit = bitcast [0 x i32]* @arrstart to i32* br label %LoopStart ; sum all elements in the array LoopStart: %looparr = phi i32* [%looparrinit, %Entry], [%looparrnext, %LoopBody] %loopcond = icmp eq i64 %loopcount, 0 br i1 %loopcond, label %LoopEnd, label %LoopBody LoopBody: %val = load i32* %looparr %sum2 = load i32* %sumvar %sum3 = add i32 %val, %sum2 store i32 %sum3, i32* %sumvar %looparrnext = getelementptr i32* %looparr, i64 1 br label %LoopStart ; return the sum Lo...