summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAna Pazos <apazos@codeaurora.org>2014-01-24 22:36:53 +0000
committerAna Pazos <apazos@codeaurora.org>2014-01-24 22:36:53 +0000
commitcd3b9f763edba8362b37f6e4c5bd9bb0e6ee5306 (patch)
tree2e70f8c8184c72093729ca16b60108ced4bccedf
parent4b5a949834775b60f4e94c6ab9136c19104b48c8 (diff)
downloadbcm5719-llvm-cd3b9f763edba8362b37f6e4c5bd9bb0e6ee5306.tar.gz
bcm5719-llvm-cd3b9f763edba8362b37f6e4c5bd9bb0e6ee5306.zip
[AArch64] Removed unused i8 type from FPR8 register class.
The i8 type is not registered with any register class. This causes a segmentation fault in MachineLICM::getRegisterClassIDAndCost. The code selects the first type associated with register class FPR8, which happens to be i8. It uses this type (i8) to get the representative class pointer, which is 0. It then uses this pointer to access a field, resulting in segmentation fault. Since i8 type is not being used for printing any neon instruction we can safely remove it. llvm-svn: 200046
-rw-r--r--llvm/lib/Target/AArch64/AArch64RegisterInfo.td2
-rw-r--r--llvm/test/CodeGen/AArch64/concatvector-v8i8-bug.ll47
2 files changed, 48 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64RegisterInfo.td b/llvm/lib/Target/AArch64/AArch64RegisterInfo.td
index cfc0c953bd2..9de7abdf5ff 100644
--- a/llvm/lib/Target/AArch64/AArch64RegisterInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64RegisterInfo.td
@@ -146,7 +146,7 @@ foreach Index = 0-31 in {
}
-def FPR8 : RegisterClass<"AArch64", [i8, v1i8], 8,
+def FPR8 : RegisterClass<"AArch64", [v1i8], 8,
(sequence "B%u", 0, 31)> {
}
diff --git a/llvm/test/CodeGen/AArch64/concatvector-v8i8-bug.ll b/llvm/test/CodeGen/AArch64/concatvector-v8i8-bug.ll
new file mode 100644
index 00000000000..f8854c3b662
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/concatvector-v8i8-bug.ll
@@ -0,0 +1,47 @@
+; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon
+; Bug: i8 type in FRP8 register but not registering with register class causes segmentation fault.
+; Fix: Removed i8 type from FPR8 register class.
+
+define void @test_concatvector_v8i8() {
+entry.split:
+ br i1 undef, label %if.then, label %if.end
+
+if.then: ; preds = %entry.split
+ unreachable
+
+if.end: ; preds = %entry.split
+ br i1 undef, label %if.then9, label %if.end18
+
+if.then9: ; preds = %if.end
+ unreachable
+
+if.end18: ; preds = %if.end
+ br label %for.body
+
+for.body: ; preds = %for.inc, %if.end18
+ br i1 false, label %if.then30, label %for.inc
+
+if.then30: ; preds = %for.body
+ unreachable
+
+for.inc: ; preds = %for.body
+ br i1 undef, label %for.end, label %for.body
+
+for.end: ; preds = %for.inc
+ br label %for.body77
+
+for.body77: ; preds = %for.body77, %for.end
+ br i1 undef, label %for.end106, label %for.body77
+
+for.end106: ; preds = %for.body77
+ br i1 undef, label %for.body130.us.us, label %stmt.for.body130.us.us
+
+stmt.for.body130.us.us: ; preds = %stmt.for.body130.us.us, %for.end106
+ %_p_splat.us = shufflevector <1 x i8> zeroinitializer, <1 x i8> undef, <8 x i32> zeroinitializer
+ store <8 x i8> %_p_splat.us, <8 x i8>* undef, align 1
+ br label %stmt.for.body130.us.us
+
+for.body130.us.us: ; preds = %for.body130.us.us, %for.end106
+ br label %for.body130.us.us
+}
+
OpenPOWER on IntegriCloud