- Jan 02, 2011
-
-
Chris Lattner authored
llvm-svn: 122713
-
Chris Lattner authored
sure that the loop we're promoting into a memcpy doesn't mutate the input of the memcpy. Before we were just checking that the dest of the memcpy wasn't mod/ref'd by the loop. llvm-svn: 122712
-
Chris Lattner authored
mess with it. We'd rather peel/unroll it than convert all of its stores into memsets. llvm-svn: 122711
-
Nick Lewycky authored
another function. llvm-svn: 122705
-
Chris Lattner authored
blocks in a loop, instead of just the header block. This makes it more aggressive, able to handle Duncan's Ada examples. llvm-svn: 122704
-
Chris Lattner authored
llvm-svn: 122703
-
Chris Lattner authored
isExitBlockDominatedByBlockInLoop is a relic of the days when domtree was *just* a tree and didn't have DFS numbers. Checking DFS numbers is faster and easier than "limiting the search of the tree". llvm-svn: 122702
-
Chris Lattner authored
llvm-svn: 122701
-
Duncan Sands authored
in the PR, the pass could break LCSSA form when inserting preheaders. It probably would be easy enough to fix this, but since currently we always go into LCSSA form after running this pass, doing so is not urgent. llvm-svn: 122695
-
Chris Lattner authored
header for now for memset/memcpy opportunities. It turns out that loop-rotate is successfully rotating loops, but *DOESN'T MERGE THE BLOCKS*, turning "for loops" into 2 basic block loops that loop-idiom was ignoring. With this fix, we form many *many* more memcpy and memsets than before, including on the "history" loops in the viterbi benchmark, which look like this: for (j=0; j<MAX_history; ++j) { history_new[i][j+1] = history[2*i][j]; } Transforming these loops into memcpy's speeds up the viterbi benchmark from 11.98s to 3.55s on my machine. Woo. llvm-svn: 122685
-
Chris Lattner authored
llvm-svn: 122683
-
Chris Lattner authored
llvm-svn: 122682
-
Chris Lattner authored
size of a loop header instead of its own code size estimator. This allows it to handle bitcasts etc more precisely. llvm-svn: 122681
-
Chris Lattner authored
llvm-svn: 122678
-
Nick Lewycky authored
maintains the guarantee that the DenseSet expects two elements it contains to not go from inequal to equal under its nose. As a side-effect, this also lets us switch from iterating to a fixed-point to actually maintaining a work queue of functions to look at again, and we don't add thunks to our work queue so we don't need to detect and ignore them. llvm-svn: 122677
-
- Jan 01, 2011
-
-
Chris Lattner authored
loop idiom pass exposed. llvm-svn: 122674
-
Chris Lattner authored
new testcase. llvm-svn: 122662
-
Chris Lattner authored
aggressively. In practice, this doesn't help anything though, see the todo. llvm-svn: 122660
-
Chris Lattner authored
should be correct now. llvm-svn: 122659
-
- Dec 31, 2010
-
-
Duncan Sands authored
operands are visited before the instructions themselves. llvm-svn: 122647
-
Duncan Sands authored
llvm-svn: 122645
-
- Dec 30, 2010
-
-
Benjamin Kramer authored
llvm-svn: 122642
-
- Dec 28, 2010
-
-
Chris Lattner authored
check for "multiple of a byte" in size to make it clear that the >> 3 below is safe. llvm-svn: 122604
-
Duncan Sands authored
llvm-svn: 122593
-
- Dec 27, 2010
-
-
Chris Lattner authored
llvm-svn: 122585
-
Benjamin Kramer authored
BuildLibCalls: Nuke EmitMemCpy, EmitMemMove and EmitMemSet. They are dead and superseded by IRBuilder. llvm-svn: 122576
-
Benjamin Kramer authored
llvm-svn: 122575
-
Chris Lattner authored
llvm-svn: 122574
-
Chris Lattner authored
memsets. This is still missing one important validity check, but this is enough to compile stuff like this: void test0(std::vector<char> &X) { for (std::vector<char>::iterator I = X.begin(), E = X.end(); I != E; ++I) *I = 0; } void test1(std::vector<int> &X) { for (long i = 0, e = X.size(); i != e; ++i) X[i] = 0x01010101; } With: $ clang t.cpp -S -o - -O2 -emit-llvm | opt -loop-idiom | opt -O3 | llc to: __Z5test0RSt6vectorIcSaIcEE: ## @_Z5test0RSt6vectorIcSaIcEE ## BB#0: ## %entry subq $8, %rsp movq (%rdi), %rax movq 8(%rdi), %rsi cmpq %rsi, %rax je LBB0_2 ## BB#1: ## %bb.nph subq %rax, %rsi movq %rax, %rdi callq ___bzero LBB0_2: ## %for.end addq $8, %rsp ret ... __Z5test1RSt6vectorIiSaIiEE: ## @_Z5test1RSt6vectorIiSaIiEE ## BB#0: ## %entry subq $8, %rsp movq (%rdi), %rax movq 8(%rdi), %rdx subq %rax, %rdx cmpq $4, %rdx jb LBB1_2 ## BB#1: ## %for.body.preheader andq $-4, %rdx movl $1, %esi movq %rax, %rdi callq _memset LBB1_2: ## %for.end addq $8, %rsp ret llvm-svn: 122573
-
- Dec 26, 2010
-
-
Chris Lattner authored
llvm-svn: 122572
-
Chris Lattner authored
llvm-svn: 122567
-
Chris Lattner authored
llvm-svn: 122565
-
Chris Lattner authored
llvm-svn: 122563
-
Chris Lattner authored
No functionality yet. llvm-svn: 122562
-
Benjamin Kramer authored
llvm-svn: 122561
-
- Dec 25, 2010
-
-
Chris Lattner authored
llvm-svn: 122556
-
Chris Lattner authored
getOrEnforceKnownAlignment function, which simplifies the code and makes it stronger. llvm-svn: 122555
-
Chris Lattner authored
llvm-svn: 122554
-
- Dec 24, 2010
-
-
Benjamin Kramer authored
Fix a thinko pointed out by Frits van Bommel: looking through global variables in isBytewiseValue is not safe. llvm-svn: 122550
-
Benjamin Kramer authored
This allows us to compile "int cst[] = {-1, -1, -1};" into movl $-1, 16(%rsp) movq $-1, 8(%rsp) instead of movl _cst+8(%rip), %eax movl %eax, 16(%rsp) movq _cst(%rip), %rax movq %rax, 8(%rsp) llvm-svn: 122548
-