git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231761
91177308-0d34-0410-b5e6-
96231b3b80d8
// x86 generates redundant zero-extenstion instructions if the operand is
// truncated to i8 or i16.
bool TruncCond = false;
- if (BitWidth > NewWidth && NewWidth >= DL.getLargestLegalIntTypeSize()) {
+ if (NewWidth > 0 && BitWidth > NewWidth &&
+ NewWidth >= DL.getLargestLegalIntTypeSize()) {
TruncCond = true;
IntegerType *Ty = IntegerType::get(SI.getContext(), NewWidth);
Builder->SetInsertPoint(&SI);
--- /dev/null
+; RUN: opt -instcombine < %s
+
+define void @test() {
+ switch i32 0, label %out [i32 0, label %out]
+out:
+ ret void
+}