50 lines · plain
1; RUN: llc < %s | FileCheck %s2 3target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"4target triple = "x86_64-pc-linux-gnu"5 6; DAGCombiner should fold this code in finite time.7; rdar://86065848 9define void @test1() nounwind readnone {10bb.nph:11 br label %while.cond12 13while.cond: ; preds = %while.cond, %bb.nph14 %tmp6 = load i32, ptr undef, align 415 %and = or i64 undef, undef16 %conv11 = zext i32 undef to i6417 %conv14 = zext i32 %tmp6 to i6418 %shl15 = shl i64 %conv14, 119 %shl15.masked = and i64 %shl15, 429496729420 %and17 = or i64 %shl15.masked, %conv1121 %add = add i64 %and17, 122 %xor = xor i64 %add, %and23 %tmp20 = load i64, ptr undef, align 824 %add21 = add i64 %xor, %tmp2025 %conv22 = trunc i64 %add21 to i3226 store i32 %conv22, ptr undef, align 427 br i1 false, label %while.end, label %while.cond28 29while.end: ; preds = %while.cond30 ret void31}32 33; DAG Combiner can't fold this into a load of the 1'th byte.34; PR875735define i32 @test3(ptr%P) nounwind ssp {36 store volatile i32 128, ptr %P37 %tmp4.pre = load i32, ptr %P38 %phitmp = trunc i32 %tmp4.pre to i1639 %phitmp13 = shl i16 %phitmp, 840 %phitmp14 = ashr i16 %phitmp13, 841 %phitmp15 = lshr i16 %phitmp14, 842 %phitmp16 = zext i16 %phitmp15 to i3243 ret i32 %phitmp1644 45; CHECK: movl $128, (%rdi)46; CHECK-NEXT: movsbl (%rdi), %eax47; CHECK-NEXT: movzbl %ah, %eax48; CHECK-NEXT: ret49}50