forked from llvm/llvm-project
- Notifications
You must be signed in to change notification settings - Fork 339
/
Copy pathsalvage-overflow.ll
44 lines (41 loc) · 1.98 KB
/
salvage-overflow.ll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
; RUN: opt %s -sroa -early-cse -S | FileCheck %s
; CHECK: DIExpression(DW_OP_constu, 9223372036854775808, DW_OP_minus, DW_OP_stack_value)
; Created from the following C input (and then delta-reduced the IR):
;
; extern unsigned long long use(unsigned long long);
; void f(unsigned long long x) {
; for (; x > 0; x --) {
; unsigned long long y = x + 0x8000000000000000;
; use(x);
; }
; }
definevoid@f(i64 noundef %x) #0!dbg!9 {
entry:
%x.addr = allocai64, align8
%y = allocai64, align8
brlabel%for.cond
for.cond: ; preds = %for.inc, %entry
%0 = loadi64, ptr%x.addr, align8
callvoid@llvm.dbg.declare(metadataptr%y, metadata!15, metadata!DIExpression())
, !dbg!29
%1 = loadi64, ptr%x.addr, align8
%add = addi64%1, -9223372036854775808
storei64%add, ptr%y, align8
brlabel%for.cond
}
declarevoid@llvm.dbg.declare(metadata, metadata, metadata) #1
!llvm.module.flags = !{!3,!7}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None, sysroot: "/")
!1 = !DIFile(filename: "t.c", directory: "/")
!3 = !{i322, !"Debug Info Version", i323}
!7 = !{i327, !"frame-pointer", i322}
!9 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !10, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13)
!10 = !DISubroutineType(types: !11)
!11 = !{null, !12}
!12 = !DIBasicType(name: "unsigned long long", size: 64, encoding: DW_ATE_unsigned)
!13 = !{}
!15 = !DILocalVariable(name: "y", scope: !16, file: !1, line: 4, type: !12)
!16 = distinct !DILexicalBlock(scope: !17, file: !1, line: 3, column: 23)
!17 = distinct !DILexicalBlock(scope: !18, file: !1, line: 3, column: 3)
!18 = distinct !DILexicalBlock(scope: !9, file: !1, line: 3, column: 3)
!29 = !DILocation(line: 4, column: 24, scope: !16)