[llvm-commits] [llvm] r136853 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/crash.ll
Bill Wendling
isanbard at gmail.com
Wed Aug 3 17:32:58 PDT 2011
Author: void
Date: Wed Aug 3 19:32:58 2011
New Revision: 136853
URL: http://llvm.org/viewvc/llvm-project?rev=136853&view=rev
Log:
Only access both operands of an INSERT_SUBVECTOR if it is an INSERT_SUBVECTOR.
Fixes PR10527.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/crash.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=136853&r1=136852&r2=136853&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Aug 3 19:32:58 2011
@@ -12298,16 +12298,17 @@
// Sometimes the operand may come from a insert_subvector building a 256-bit
// allones vector
- SDValue V1 = N->getOperand(0);
- SDValue V2 = N->getOperand(1);
-
if (VT.getSizeInBits() == 256 &&
- N->getOpcode() == ISD::INSERT_SUBVECTOR &&
- V1.getOpcode() == ISD::INSERT_SUBVECTOR &&
- V1.getOperand(0).getOpcode() == ISD::UNDEF &&
- ISD::isBuildVectorAllOnes(V1.getOperand(1).getNode()) &&
- ISD::isBuildVectorAllOnes(V2.getNode()))
- return true;
+ N->getOpcode() == ISD::INSERT_SUBVECTOR) {
+ SDValue V1 = N->getOperand(0);
+ SDValue V2 = N->getOperand(1);
+
+ if (V1.getOpcode() == ISD::INSERT_SUBVECTOR &&
+ V1.getOperand(0).getOpcode() == ISD::UNDEF &&
+ ISD::isBuildVectorAllOnes(V1.getOperand(1).getNode()) &&
+ ISD::isBuildVectorAllOnes(V2.getNode()))
+ return true;
+ }
return false;
}
Modified: llvm/trunk/test/CodeGen/X86/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/crash.ll?rev=136853&r1=136852&r2=136853&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/crash.ll (original)
+++ llvm/trunk/test/CodeGen/X86/crash.ll Wed Aug 3 19:32:58 2011
@@ -341,3 +341,26 @@
br label %CF77
}
+; PR10527
+define void @pr10527() nounwind uwtable {
+entry:
+ br label %"4"
+
+"3":
+ %0 = load <2 x i32>* null, align 8
+ %1 = xor <2 x i32> zeroinitializer, %0
+ %2 = and <2 x i32> %1, %6
+ %3 = or <2 x i32> undef, %2
+ %4 = and <2 x i32> %3, undef
+ store <2 x i32> %4, <2 x i32>* undef
+ %5 = load <2 x i32>* undef, align 1
+ br label %"4"
+
+"4":
+ %6 = phi <2 x i32> [ %5, %"3" ], [ zeroinitializer, %entry ]
+ %7 = icmp ult i32 undef, undef
+ br i1 %7, label %"3", label %"5"
+
+"5":
+ ret void
+}
More information about the llvm-commits
mailing list