diff options
author | Duncan Sands <baldrick@free.fr> | 2007-12-16 15:51:49 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-12-16 15:51:49 +0000 |
commit | ece2c04d532d46405c085769d03173b392813eb3 (patch) | |
tree | f1736e3eb6bdff960456746e561a89c2b021122b /test | |
parent | 2c6fd8c7ceea0392635ce21038d2b7fc215d9116 (diff) | |
download | llvm-ece2c04d532d46405c085769d03173b392813eb3.tar.gz llvm-ece2c04d532d46405c085769d03173b392813eb3.tar.bz2 llvm-ece2c04d532d46405c085769d03173b392813eb3.tar.xz |
Make instcombine promote inline asm calls to 'nounwind'
calls. Remove special casing of inline asm from the
inliner. There is a potential problem: the verifier
rejects invokes of inline asm (not sure why). If an
asm call is not marked "nounwind" in some .ll, and
instcombine is not run, but the inliner is run, then
an illegal module will be created. This is bad but
I'm not sure what the best approach is. I'm tempted
to remove the check in the verifier...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CFrontend/2007-12-16-AsmNoUnwind.c | 3 | ||||
-rw-r--r-- | test/Transforms/Inline/2007-04-15-InlineEH.ll | 2 | ||||
-rw-r--r-- | test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll | 7 |
3 files changed, 11 insertions, 1 deletions
diff --git a/test/CFrontend/2007-12-16-AsmNoUnwind.c b/test/CFrontend/2007-12-16-AsmNoUnwind.c new file mode 100644 index 0000000000..b080e6a511 --- /dev/null +++ b/test/CFrontend/2007-12-16-AsmNoUnwind.c @@ -0,0 +1,3 @@ +// RUN: %llvmgcc %s -S -o - | grep nounwind + +void bar() { asm (""); } diff --git a/test/Transforms/Inline/2007-04-15-InlineEH.ll b/test/Transforms/Inline/2007-04-15-InlineEH.ll index 73b0e215e8..9d28755d28 100644 --- a/test/Transforms/Inline/2007-04-15-InlineEH.ll +++ b/test/Transforms/Inline/2007-04-15-InlineEH.ll @@ -8,7 +8,7 @@ target triple = "i686-pc-linux-gnu" define void @bc__support__high_resolution_time__clock() { entry: - call void asm "rdtsc\0A\09movl %eax, $0\0A\09movl %edx, $1", "=*imr,=*imr,~{dirflag},~{fpsr},~{flags},~{dx},~{ax}"( i32* null, i32* null ) + call void asm "rdtsc\0A\09movl %eax, $0\0A\09movl %edx, $1", "=*imr,=*imr,~{dirflag},~{fpsr},~{flags},~{dx},~{ax}"( i32* null, i32* null ) nounwind unreachable } diff --git a/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll b/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll new file mode 100644 index 0000000000..336c6d5a2e --- /dev/null +++ b/test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep nounwind + +define void @bar() { +entry: + call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"( ) + ret void +} |