[llvm] r272644 - [SelectionDAG] Remove exit-on-error flag from test (PR27765)
Diana Picus via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 14 00:30:21 PDT 2016
Author: rovka
Date: Tue Jun 14 02:30:20 2016
New Revision: 272644
URL: http://llvm.org/viewvc/llvm-project?rev=272644&view=rev
Log:
[SelectionDAG] Remove exit-on-error flag from test (PR27765)
The exit-on-error flag in the ARM test is necessary in order to avoid an
unreachable in the DAGTypeLegalizer, when trying to expand a physical register.
We can also avoid this situation by introducing a bitcast early on, where the
invalid scalar-to-vector conversion is detected.
We also add a test for PowerPC, which goes through a similar code path in the
SelectionDAGBuilder.
Fixes PR27765.
Differential Revision: http://reviews.llvm.org/D21061
Added:
llvm/trunk/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/trunk/test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=272644&r1=272643&r2=272644&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Jun 14 02:30:20 2016
@@ -445,9 +445,11 @@ static void getCopyToParts(SelectionDAG
"Failed to tile the value with PartVT!");
if (NumParts == 1) {
- if (PartEVT != ValueVT)
+ if (PartEVT != ValueVT) {
diagnosePossiblyInvalidConstraint(*DAG.getContext(), V,
"scalar-to-vector conversion failed");
+ Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
+ }
Parts[0] = Val;
return;
Modified: llvm/trunk/test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll?rev=272644&r1=272643&r2=272644&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll Tue Jun 14 02:30:20 2016
@@ -1,10 +1,11 @@
-; RUN: not llc -mtriple=arm-eabi -mcpu=cortex-a8 -exit-on-error %s -o - 2>&1 | FileCheck %s
+; RUN: not llc -mtriple=arm-eabi -mcpu=cortex-a8 %s -o - 2>&1 | FileCheck %s
; Check for error message:
; CHECK: scalar-to-vector conversion failed, possible invalid constraint for vector type
+; CHECK: scalar-to-vector conversion failed, possible invalid constraint for vector type
define hidden void @f(i32* %corr, i32 %order) nounwind ssp {
- tail call void asm sideeffect "vst1.s32 { ${1:q}, ${2:q} }, [$0]", "r,{q0},{q1}"(i32* %corr, <2 x i64>* undef, <2 x i64>* undef) nounwind, !srcloc !0
+ tail call void asm sideeffect "vst1.s32 { ${1:q}, ${2:q} }, [$0]", "r,{q0},{q1}"(i32* %corr, <2 x i64>* undef, i32 %order) nounwind, !srcloc !0
ret void
}
Added: llvm/trunk/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll?rev=272644&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll (added)
+++ llvm/trunk/test/CodeGen/PowerPC/inline-asm-scalar-to-vector-error.ll Tue Jun 14 02:30:20 2016
@@ -0,0 +1,14 @@
+; RUN: not llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8a -mattr=+altivec %s -o - 2>&1 | FileCheck %s
+
+define hidden void @f(i32 %x) {
+ ; CHECK: scalar-to-vector conversion failed, possible invalid constraint for vector type
+ tail call void asm sideeffect "nop", "{v1}"(i32 %x) nounwind
+
+ ; CHECK: scalar-to-vector conversion failed, possible invalid constraint for vector type
+ tail call void asm sideeffect "nop", "{vsl1}"(i32 %x) nounwind
+
+ ; CHECK: scalar-to-vector conversion failed, possible invalid constraint for vector type
+ tail call void asm sideeffect "nop", "{vsh1}"(i32 %x) nounwind
+
+ ret void
+}
More information about the llvm-commits
mailing list