Convert all tests using TCL-style quoting to use shell-style quoting.
This was done through the aid of a terrible Perl creation. I will not
paste any of the horrors here. Suffice to say, it require multiple
staged rounds of replacements, state carried between, and a few
nested-construct-parsing hacks that I'm not proud of. It happens, by
luck, to be able to deal with all the TCL-quoting patterns in evidence
in the LLVM test suite.
If anyone is maintaining large out-of-tree test trees, feel free to poke
me and I'll send you the steps I used to convert things, as well as
answer any painful questions etc. IRC works best for this type of thing
I find.
Once converted, switch the LLVM lit config to use ShTests the same as
Clang. In addition to being able to delete large amounts of Python code
from 'lit', this will also simplify the entire test suite and some of
lit's architecture.
Finally, the test suite runs 33% faster on Linux now. ;]
For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s
llvm-svn: 159525
2012-07-02 20:47:22 +08:00
|
|
|
; RUN: opt < %s -basicaa -gvn -S | grep "DEAD = phi i32 "
|
Implement initial support for PHI translation in memdep. This means that
memdep keeps track of how PHIs affect the pointer in dep queries, which
allows it to eliminate the load in cases like rle-phi-translate.ll, which
basically end up being:
BB1:
X = load P
br BB3
BB2:
Y = load Q
br BB3
BB3:
R = phi [P] [Q]
load R
turning "load R" into a phi of X/Y. In addition to additional exposed
opportunities, this makes memdep safe in many cases that it wasn't before
(which is required for load PRE) and also makes it substantially more
efficient. For example, consider:
bb1: // has many predecessors.
P = some_operator()
load P
In this example, previously memdep would scan all the predecessors of BB1
to see if they had something that would mustalias P. In some cases (e.g.
test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end
up eliminating something. In many other cases though, it would scan and not
find anything useful. MemDep now stops at a block if the pointer is defined
in that block and cannot be phi translated to predecessors. This causes it
to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not
scanning tons of stuff that is unlikely to be useful. For example, this
speeds up GVN as a whole from 3.928s to 2.448s (60%)!. IMO, scalar GVN
should be enhanced to simplify the rle-must-alias pointer base anyway, which
would allow the loads to be eliminated.
In the future, this should be enhanced to phi translate through geps and
bitcasts as well (as indicated by FIXMEs) making memdep even more powerful.
llvm-svn: 61022
2008-12-15 11:35:32 +08:00
|
|
|
|
2009-11-28 03:56:00 +08:00
|
|
|
; GVN should eliminate the fully redundant %9 GEP which
|
Implement initial support for PHI translation in memdep. This means that
memdep keeps track of how PHIs affect the pointer in dep queries, which
allows it to eliminate the load in cases like rle-phi-translate.ll, which
basically end up being:
BB1:
X = load P
br BB3
BB2:
Y = load Q
br BB3
BB3:
R = phi [P] [Q]
load R
turning "load R" into a phi of X/Y. In addition to additional exposed
opportunities, this makes memdep safe in many cases that it wasn't before
(which is required for load PRE) and also makes it substantially more
efficient. For example, consider:
bb1: // has many predecessors.
P = some_operator()
load P
In this example, previously memdep would scan all the predecessors of BB1
to see if they had something that would mustalias P. In some cases (e.g.
test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end
up eliminating something. In many other cases though, it would scan and not
find anything useful. MemDep now stops at a block if the pointer is defined
in that block and cannot be phi translated to predecessors. This causes it
to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not
scanning tons of stuff that is unlikely to be useful. For example, this
speeds up GVN as a whole from 3.928s to 2.448s (60%)!. IMO, scalar GVN
should be enhanced to simplify the rle-must-alias pointer base anyway, which
would allow the loads to be eliminated.
In the future, this should be enhanced to phi translate through geps and
bitcasts as well (as indicated by FIXMEs) making memdep even more powerful.
llvm-svn: 61022
2008-12-15 11:35:32 +08:00
|
|
|
; allows DEAD to be removed. This is PR3198.
|
|
|
|
|
2008-12-01 09:42:03 +08:00
|
|
|
; The %7 and %4 loads combine to make %DEAD unneeded.
|
|
|
|
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
|
|
|
|
target triple = "i386-apple-darwin7"
|
|
|
|
@H = common global [100 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=3]
|
|
|
|
@G = common global i32 0 ; <i32*> [#uses=2]
|
|
|
|
|
|
|
|
define i32 @test(i32 %i) nounwind {
|
|
|
|
entry:
|
|
|
|
%0 = tail call i32 (...)* @foo() nounwind ; <i32> [#uses=1]
|
|
|
|
%1 = icmp eq i32 %0, 0 ; <i1> [#uses=1]
|
|
|
|
br i1 %1, label %bb1, label %bb
|
|
|
|
|
|
|
|
bb: ; preds = %entry
|
|
|
|
%2 = tail call i32 (...)* @bar() nounwind ; <i32> [#uses=0]
|
|
|
|
%3 = getelementptr [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1]
|
|
|
|
%4 = load i32* %3, align 4 ; <i32> [#uses=1]
|
|
|
|
store i32 %4, i32* @G, align 4
|
|
|
|
br label %bb3
|
|
|
|
|
|
|
|
bb1: ; preds = %entry
|
|
|
|
%5 = tail call i32 (...)* @baz() nounwind ; <i32> [#uses=0]
|
|
|
|
%6 = getelementptr [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1]
|
|
|
|
%7 = load i32* %6, align 4 ; <i32> [#uses=2]
|
|
|
|
store i32 %7, i32* @G, align 4
|
|
|
|
%8 = icmp eq i32 %7, 0 ; <i1> [#uses=1]
|
|
|
|
br i1 %8, label %bb3, label %bb4
|
|
|
|
|
|
|
|
bb3: ; preds = %bb1, %bb
|
|
|
|
%9 = getelementptr [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1]
|
|
|
|
%DEAD = load i32* %9, align 4 ; <i32> [#uses=1]
|
|
|
|
ret i32 %DEAD
|
|
|
|
|
|
|
|
bb4: ; preds = %bb1
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @foo(...)
|
|
|
|
|
|
|
|
declare i32 @bar(...)
|
|
|
|
|
|
|
|
declare i32 @baz(...)
|