summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/crash.ll
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-12 23:37:40 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-12 23:37:40 +0000
commitdee83c90bb7bda57f6d0db2d8f9138f411ecdbbc (patch)
tree25851371dd3e09559dbaa1b95952292401bdab38 /test/CodeGen/X86/crash.ll
parentf5916976e9057177100badee7b7388bd7ba76ac3 (diff)
downloadllvm-dee83c90bb7bda57f6d0db2d8f9138f411ecdbbc.tar.gz
llvm-dee83c90bb7bda57f6d0db2d8f9138f411ecdbbc.tar.bz2
llvm-dee83c90bb7bda57f6d0db2d8f9138f411ecdbbc.tar.xz
Also inflate register classes around inline asm.
Now that MI->getRegClassConstraint() can also handle inline assembly, don't bail when recomputing the register class of a virtual register used by inline asm. This fixes PR11078. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/crash.ll')
-rw-r--r--test/CodeGen/X86/crash.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/X86/crash.ll b/test/CodeGen/X86/crash.ll
index 6f4bf6d31f..153145728f 100644
--- a/test/CodeGen/X86/crash.ll
+++ b/test/CodeGen/X86/crash.ll
@@ -364,3 +364,30 @@ entry:
"5":
ret void
}
+
+; PR11078
+;
+; A virtual register used by the "foo" inline asm memory operand gets
+; constrained to GR32_ABCD during coalescing. This makes the inline asm
+; impossible to allocate without splitting the live range and reinflating the
+; register class around the inline asm.
+;
+; The constraint originally comes from the TEST8ri optimization of (icmp (and %t0, 1), 0).
+
+@__force_order = external hidden global i32, align 4
+define void @pr11078(i32* %pgd) nounwind {
+entry:
+ %t0 = load i32* %pgd, align 4
+ %and2 = and i32 %t0, 1
+ %tobool = icmp eq i32 %and2, 0
+ br i1 %tobool, label %if.then, label %if.end
+
+if.then:
+ %t1 = tail call i32 asm sideeffect "bar", "=r,=*m,~{dirflag},~{fpsr},~{flags}"(i32* @__force_order) nounwind
+ br label %if.end
+
+if.end:
+ %t6 = inttoptr i32 %t0 to i64*
+ %t11 = tail call i64 asm sideeffect "foo", "=*m,=A,{bx},{cx},1,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %t6, i32 0, i32 0, i64 0) nounwind
+ ret void
+}