diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-09 17:41:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-09 17:41:24 +0000 |
commit | 1afcace3a3a138b1b18e5c6270caa8dae2261ae2 (patch) | |
tree | 2fed26ec8965151524b81246c7fa7c3e2382fd31 /test/Assembler | |
parent | c36ed70ec5c3c99f9559cfaa199373f60219a2be (diff) | |
download | external_llvm-1afcace3a3a138b1b18e5c6270caa8dae2261ae2.zip external_llvm-1afcace3a3a138b1b18e5c6270caa8dae2261ae2.tar.gz external_llvm-1afcace3a3a138b1b18e5c6270caa8dae2261ae2.tar.bz2 |
Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM. One way to look at it
is through diffstat:
109 files changed, 3005 insertions(+), 5906 deletions(-)
Removing almost 3K lines of code is a good thing. Other advantages
include:
1. Value::getType() is a simple load that can be CSE'd, not a mutating
union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
uniques them. This means that the compiler doesn't merge them structurally
which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead
"const Type *" everywhere.
Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.
"LLVM 3.0" is the right time to do this.
There are still some cleanups pending after this, this patch is large enough
as-is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Assembler')
-rw-r--r-- | test/Assembler/2002-07-25-ReturnPtrFunction.ll | 6 | ||||
-rw-r--r-- | test/Assembler/2002-12-15-GlobalResolve.ll | 2 | ||||
-rw-r--r-- | test/Assembler/2003-04-15-ConstantInitAssertion.ll | 2 | ||||
-rw-r--r-- | test/Assembler/2003-05-21-MalformedStructCrash.ll | 2 | ||||
-rw-r--r-- | test/Assembler/2004-11-28-InvalidTypeCrash.ll | 2 | ||||
-rw-r--r-- | test/Assembler/getelementptr.ll | 6 |
6 files changed, 9 insertions, 11 deletions
diff --git a/test/Assembler/2002-07-25-ReturnPtrFunction.ll b/test/Assembler/2002-07-25-ReturnPtrFunction.ll index 515d105..6988fad 100644 --- a/test/Assembler/2002-07-25-ReturnPtrFunction.ll +++ b/test/Assembler/2002-07-25-ReturnPtrFunction.ll @@ -3,12 +3,10 @@ ; ; RUN: llvm-as < %s | llvm-dis | llvm-as -%ty = type void (i32) - -declare %ty* @foo() +declare void (i32)* @foo() define void @test() { - call %ty* ()* @foo( ) ; <%ty*>:1 [#uses=0] + call void (i32)* ()* @foo( ) ; <%ty*>:1 [#uses=0] ret void } diff --git a/test/Assembler/2002-12-15-GlobalResolve.ll b/test/Assembler/2002-12-15-GlobalResolve.ll index f9ad12e..a873a61 100644 --- a/test/Assembler/2002-12-15-GlobalResolve.ll +++ b/test/Assembler/2002-12-15-GlobalResolve.ll @@ -4,4 +4,4 @@ @X1 = external global %T* @X2 = external global i32* -%T = type i32 +%T = type {i32} diff --git a/test/Assembler/2003-04-15-ConstantInitAssertion.ll b/test/Assembler/2003-04-15-ConstantInitAssertion.ll index e012168..fa6b807 100644 --- a/test/Assembler/2003-04-15-ConstantInitAssertion.ll +++ b/test/Assembler/2003-04-15-ConstantInitAssertion.ll @@ -1,4 +1,4 @@ -; RUN: not llvm-as < %s >/dev/null |& grep {constant expression type mismatch} +; RUN: not llvm-as < %s >/dev/null |& grep {struct initializer doesn't match struct element type} ; Test the case of a misformed constant initializer ; This should cause an assembler error, not an assertion failure! constant { i32 } { float 1.0 } diff --git a/test/Assembler/2003-05-21-MalformedStructCrash.ll b/test/Assembler/2003-05-21-MalformedStructCrash.ll index 1efb577..8d20e07 100644 --- a/test/Assembler/2003-05-21-MalformedStructCrash.ll +++ b/test/Assembler/2003-05-21-MalformedStructCrash.ll @@ -1,4 +1,4 @@ ; Found by inspection of the code -; RUN: not llvm-as < %s > /dev/null |& grep {constant expression type mismatch} +; RUN: not llvm-as < %s > /dev/null |& grep {initializer with struct type has wrong # elements} global {} { i32 7, float 1.0, i32 7, i32 8 } diff --git a/test/Assembler/2004-11-28-InvalidTypeCrash.ll b/test/Assembler/2004-11-28-InvalidTypeCrash.ll index f9b453b..40648fd 100644 --- a/test/Assembler/2004-11-28-InvalidTypeCrash.ll +++ b/test/Assembler/2004-11-28-InvalidTypeCrash.ll @@ -1,4 +1,4 @@ ; Test for PR463. This program is erroneous, but should not crash llvm-as. -; RUN: not llvm-as %s -o /dev/null |& grep {invalid type for null constant} +; RUN: not llvm-as %s -o /dev/null |& grep {use of undefined type named 'struct.none'} @.FOO = internal global %struct.none zeroinitializer diff --git a/test/Assembler/getelementptr.ll b/test/Assembler/getelementptr.ll index ebef58f..ce6866d 100644 --- a/test/Assembler/getelementptr.ll +++ b/test/Assembler/getelementptr.ll @@ -9,13 +9,13 @@ ;; Verify that i16 indices work. @x = external global {i32, i32} -@y = global i32* getelementptr ({i32, i32}* @x, i16 42, i32 0) -; CHECK: @y = global i32* getelementptr (%0* @x, i16 42, i32 0) +@y = global i32* getelementptr ({ i32, i32 }* @x, i16 42, i32 0) +; CHECK: @y = global i32* getelementptr ({ i32, i32 }* @x, i16 42, i32 0) ; see if i92 indices work too. define i32 *@test({i32, i32}* %t, i92 %n) { ; CHECK: @test -; CHECK: %B = getelementptr %0* %t, i92 %n, i32 0 +; CHECK: %B = getelementptr { i32, i32 }* %t, i92 %n, i32 0 %B = getelementptr {i32, i32}* %t, i92 %n, i32 0 ret i32* %B } |