Index: llvm/lib/IR/Instructions.cpp =================================================================== --- llvm/lib/IR/Instructions.cpp +++ llvm/lib/IR/Instructions.cpp @@ -2053,7 +2053,6 @@ if (UsesLHS && UsesRHS) return false; } - assert((UsesLHS ^ UsesRHS) && "Should have selected from exactly 1 source"); return true; } Index: llvm/test/CodeGen/X86/cgp_shuffle_crash.ll =================================================================== --- /dev/null +++ llvm/test/CodeGen/X86/cgp_shuffle_crash.ll @@ -0,0 +1,23 @@ +; RUN: llc %s -o - | FileCheck %s + +target triple = "x86_64-unknown-linux-gnu" + +; CHECK-LABEL: shuffle_one_source + +define void @shuffle_one_source() { +BB: + %Shuff7 = shufflevector <2 x i8> zeroinitializer, <2 x i8> zeroinitializer, <2 x i32> undef + br label %CF + +CF: ; preds = %CF, %BB + %Cmp82 = icmp slt i32 480483, undef + br i1 undef, label %CF, label %CF242 + +CF242: ; preds = %CF + %B109 = mul <2 x i8> undef, %Shuff7 + br label %CF245 + +CF245: ; preds = %CF245, %CF242 + %Sl187 = select i1 %Cmp82, <2 x i8> %B109, <2 x i8> undef + br label %CF245 +}