brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 6ac8287 Raw
53 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -passes=instcombine -S %s -o - | FileCheck %s3;; Tests that when InstCombine replaces a bswap idiom with an intrinsic, the4;; !dbg attachment from the replaced instruction is applied to all generated5;; instructions, not just the last.6 7target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"8target triple = "x86_64-unknown-linux-gnu"9 10define i32 @inflate(ptr %strm) {11; CHECK-LABEL: define i32 @inflate(12; CHECK-SAME: ptr [[STRM:%.*]]) {13; CHECK-NEXT:  [[ENTRY:.*:]]14; CHECK-NEXT:    [[TMP0:%.*]] = load i64, ptr [[STRM]], align 815; CHECK-NEXT:    [[TRUNC:%.*]] = trunc i64 [[TMP0]] to i32, !dbg [[DBG3:![0-9]+]]16; CHECK-NEXT:    [[TMP1:%.*]] = and i32 [[TRUNC]], 65535, !dbg [[DBG3]]17; CHECK-NEXT:    [[MASK:%.*]] = call i32 @llvm.bswap.i32(i32 [[TMP1]]), !dbg [[DBG3]]18; CHECK-NEXT:    [[ADD665:%.*]] = zext i32 [[MASK]] to i64, !dbg [[DBG3]]19; CHECK-NEXT:    store i64 [[ADD665]], ptr [[STRM]], align 820; CHECK-NEXT:    ret i32 021;22entry:23  %0 = load i64, ptr %strm, align 824  %and660 = and i64 %0, 6528025  %shl661 = shl i64 %and660, 826  %and663 = and i64 %0, 25527  %shl664 = shl i64 %and663, 2428  %add665 = or i64 %shl661, %shl664, !dbg !429  store i64 %add665, ptr %strm, align 830  ret i32 031}32 33!llvm.dbg.cu = !{!0}34!llvm.module.flags = !{!3}35 36!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 20.0.0git")37!1 = !DIFile(filename: "/tmp/zlib_inflate.c", directory: "/tmp")38!2 = !{}39!3 = !{i32 2, !"Debug Info Version", i32 3}40!4 = !DILocation(line: 8, column: 42, scope: !6)41!5 = !DIFile(filename: "zlib_inflate.c", directory: "/tmp")42!6 = distinct !DISubprogram(name: "inflate", scope: !5, file: !5, line: 622, type: !7, scopeLine: 625, unit: !0, retainedNodes: !2)43!7 = distinct !DISubroutineType(types: !2)44;.45; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C11, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)46; CHECK: [[META1]] = !DIFile(filename: "/tmp/zlib_inflate.c", directory: {{.*}})47; CHECK: [[DBG3]] = !DILocation(line: 8, column: 42, scope: [[META4:![0-9]+]])48; CHECK: [[META4]] = distinct !DISubprogram(name: "inflate", scope: [[META5:![0-9]+]], file: [[META5]], line: 622, type: [[META6:![0-9]+]], scopeLine: 625, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META7:![0-9]+]])49; CHECK: [[META5]] = !DIFile(filename: "zlib_inflate.c", directory: {{.*}})50; CHECK: [[META6]] = distinct !DISubroutineType(types: [[META7]])51; CHECK: [[META7]] = !{}52;.53