From 002adabb3a251a81ef304353eefb1bf96ec388f6 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 16 Dec 2019 15:04:16 -0800 Subject: [PATCH] [AArch64][SVE] Change pattern generation code to fix -Wimplicit-fallthrough after D71483 --- llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp index e138c2d..f40652f 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp @@ -2867,16 +2867,23 @@ bool AArch64DAGToDAGISel::SelectSVELogicalImm(SDValue N, MVT VT, SDValue &Imm) { switch (VT.SimpleTy) { case MVT::i8: ImmVal &= 0xFF; - ImmVal |= (ImmVal << 8); + ImmVal |= ImmVal << 8; + ImmVal |= ImmVal << 16; + ImmVal |= ImmVal << 32; + break; case MVT::i16: ImmVal &= 0xFFFF; - ImmVal |= (ImmVal << 16); + ImmVal |= ImmVal << 16; + ImmVal |= ImmVal << 32; + break; case MVT::i32: ImmVal &= 0xFFFFFFFF; - ImmVal |= (ImmVal << 32); + ImmVal |= ImmVal << 32; break; - default: + case MVT::i64: break; + default: + llvm_unreachable("Unexpected type"); } uint64_t encoding; -- 2.7.4