[PATCH] D42599: [AArch64] Fix BITCAST lowering crash

Evandro Menezes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 12:04:17 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL325378: [AArch64] Fix BITCAST lowering crash (authored by evandro, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42599?vs=131651&id=134676#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42599

Files:
  llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/trunk/test/CodeGen/AArch64/strqu.ll


Index: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -8776,7 +8776,8 @@
   // If the source type has twice the number of elements as our destination
   // type, we know this is an extract of the high or low half of the vector.
   EVT SVT = Source->getValueType(0);
-  if (SVT.getVectorNumElements() != VT.getVectorNumElements() * 2)
+  if (!SVT.isVector() ||
+      SVT.getVectorNumElements() != VT.getVectorNumElements() * 2)
     return SDValue();
 
   DEBUG(dbgs() << "aarch64-lower: bitcast extract_subvector simplification\n");
Index: llvm/trunk/test/CodeGen/AArch64/strqu.ll
===================================================================
--- llvm/trunk/test/CodeGen/AArch64/strqu.ll
+++ llvm/trunk/test/CodeGen/AArch64/strqu.ll
@@ -0,0 +1,28 @@
+; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-linux-gnu    | FileCheck --check-prefixes=CHECK,NOSPLIT %s
+; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64_be-linux-gnu | FileCheck --check-prefixes=CHECK,NOSPLIT %s
+; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-linux-gnu    -mcpu=exynos-m1 | FileCheck --check-prefixes=CHECK,NOSPLIT %s
+; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64_be-linux-gnu -mcpu=exynos-m1 | FileCheck --check-prefixes=CHECK,SPLIT %s
+
+; CHECK-LABEL: test_split_f:
+; NOSPLIT: str q{{[0-9]+}}, [x{{[0-9]+}}]
+; SPLIT: st1 { v{{[0-9]+}}.2s }, [x{{[0-9]+}}]
+; SPLIT: st1 { v{{[0-9]+}}.2s }, [x{{[0-9]+}}]
+define void @test_split_f(<4 x float> %val, <4 x float>* %addr) {
+  store <4 x float> %val, <4 x float>* %addr, align 8
+  ret void
+}
+
+; CHECK-LABEL: test_split_d:
+; NOSPLIT: str q{{[0-9]+}}, [x{{[0-9]+}}]
+; SPLIT: st1 { v{{[0-9]+}}.2d }, [x{{[0-9]+}}]
+define void @test_split_d(<2 x double> %val, <2 x double>* %addr) {
+  store <2 x double> %val, <2 x double>* %addr, align 8
+  ret void
+}
+
+; CHECK-LABEL: test_split_128:
+; CHECK: str q{{[0-9]+}}, [x{{[0-9]+}}]
+define void @test_split_128(fp128 %val, fp128* %addr) {
+  store fp128 %val, fp128* %addr, align 8
+  ret void
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42599.134676.patch
Type: text/x-patch
Size: 2203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180216/214ee8b8/attachment.bin>


More information about the llvm-commits mailing list