Index: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -646,6 +646,9 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock::const_iterator Begin, BasicBlock::const_iterator End, bool &HadTailCall) { + // Allow creating illegal types during DAG building for the basic block. + CurDAG->NewNodesMustHaveLegalTypes = false; + // Lower the instructions. If a call is emitted as a tail call, cease emitting // nodes for this block. for (BasicBlock::const_iterator I = Begin; I != End && !SDB->HasTailCall; ++I) { Index: llvm/trunk/test/CodeGen/AArch64/fold-constants.ll =================================================================== --- llvm/trunk/test/CodeGen/AArch64/fold-constants.ll +++ llvm/trunk/test/CodeGen/AArch64/fold-constants.ll @@ -19,9 +19,19 @@ ; PR25763 - folding constant vector comparisons with sign-extended result define <8 x i16> @dotests_458() { +; CHECK-LABEL: .LCPI1_0: +; CHECK: .hword 0 // 0x0 +; CHECK-NEXT: .hword 0 // 0x0 +; CHECK-NEXT: .hword 65535 // 0xffff +; CHECK-NEXT: .hword 0 // 0x0 +; CHECK-NEXT: .hword 0 // 0x0 +; CHECK-NEXT: .hword 0 // 0x0 +; CHECK-NEXT: .hword 0 // 0x0 +; CHECK-NEXT: .hword 0 // 0x0 + ; CHECK-LABEL: dotests_458 -; CHECK: movi d0, #0x00000000ff0000 -; CHECK-NEXT: sshll v0.8h, v0.8b, #0 +; CHECK: adrp x8, .LCPI1_0 +; CHECK-NEXT: ldr q0, [x8, :lo12:.LCPI1_0] ; CHECK-NEXT: ret entry: %vclz_v.i = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> , i1 false) #6