# Changeset View

Changeset View

# Standalone View

Standalone View

# test/CodeGen/X86/fold-tied-op.ll

1 | ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||||
---|---|---|---|---|---|

1 | ; RUN: llc -verify-machineinstrs -mtriple=i386--netbsd < %s | FileCheck %s | 2 | ; RUN: llc -verify-machineinstrs -mtriple=i386--netbsd < %s | FileCheck %s | ||

2 | ; Regression test for http://reviews.llvm.org/D5701 | 3 | ; Regression test for http://reviews.llvm.org/D5701 | ||

3 | 4 | | |||

4 | ; ModuleID = 'xxhash.i' | 5 | ; ModuleID = 'xxhash.i' | ||

5 | target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" | 6 | target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" | ||

6 | target triple = "i386--netbsd" | 7 | target triple = "i386--netbsd" | ||

7 | 8 | | |||

8 | ; CHECK-LABEL: fn1 | 9 | ; CHECK-LABEL: fn1 | ||

9 | ; CHECK: orl {{.*#+}} 4-byte Folded Reload | 10 | ; CHECK: orl {{.*#+}} 4-byte Folded Reload | ||

10 | ; CHECK: addl {{.*#+}} 4-byte Folded Reload | 11 | ; CHECK: addl {{.*#+}} 4-byte Folded Reload | ||

11 | ; CHECK: xorl {{.*#+}} 4-byte Folded Reload | 12 | ; CHECK: xorl {{.*#+}} 4-byte Folded Reload | ||

12 | ; CHECK: xorl {{.*#+}} 4-byte Folded Reload | 13 | ; CHECK: xorl {{.*#+}} 4-byte Folded Reload | ||

13 | ; CHECK: retl | 14 | ; CHECK: retl | ||

14 | 15 | | |||

15 | %struct.XXH_state64_t = type { i32, i32, i64, i64, i64 } | 16 | %struct.XXH_state64_t = type { i32, i32, i64, i64, i64 } | ||

16 | 17 | | |||

17 | @a = common global i32 0, align 4 | 18 | @a = common global i32 0, align 4 | ||

18 | @b = common global i64 0, align 8 | 19 | @b = common global i64 0, align 8 | ||

19 | 20 | | |||

20 | ; Function Attrs: nounwind uwtable | 21 | ; Function Attrs: nounwind uwtable | ||

21 | define i64 @fn1() #0 { | 22 | define i64 @fn1() #0 { | ||

23 | ; CHECK-LABEL: fn1: | ||||

24 | ; CHECK: # %bb.0: # %entry | ||||

25 | ; CHECK-NEXT: pushl %ebp | ||||

26 | ; CHECK-NEXT: .cfi_def_cfa_offset 8 | ||||

27 | ; CHECK-NEXT: .cfi_offset %ebp, -8 | ||||

28 | ; CHECK-NEXT: movl %esp, %ebp | ||||

29 | ; CHECK-NEXT: .cfi_def_cfa_register %ebp | ||||

30 | ; CHECK-NEXT: pushl %ebx | ||||

31 | ; CHECK-NEXT: pushl %edi | ||||

32 | ; CHECK-NEXT: pushl %esi | ||||

33 | ; CHECK-NEXT: subl $12, %esp | ||||

34 | ; CHECK-NEXT: .cfi_offset %esi, -20 | ||||

35 | ; CHECK-NEXT: .cfi_offset %edi, -16 | ||||

36 | ; CHECK-NEXT: .cfi_offset %ebx, -12 | ||||

37 | ; CHECK-NEXT: movl $-1028477379, %edi # imm = 0xC2B2AE3D | ||||

38 | ; CHECK-NEXT: movl $668265295, %ecx # imm = 0x27D4EB4F | ||||

39 | ; CHECK-NEXT: movl a, %ebx | ||||

40 | ; CHECK-NEXT: cmpl $0, (%ebx) | ||||

41 | ; CHECK-NEXT: je .LBB0_2 | ||||

42 | ; CHECK-NEXT: # %bb.1: # %if.then | ||||

43 | ; CHECK-NEXT: movl 8(%ebx), %edx | ||||

44 | ; CHECK-NEXT: movl 12(%ebx), %edi | ||||

45 | ; CHECK-NEXT: movl %edi, %esi | ||||

46 | ; CHECK-NEXT: shldl $1, %edx, %esi | ||||

47 | ; CHECK-NEXT: orl %edi, %esi | ||||

48 | ; CHECK-NEXT: leal (%edx,%edx), %eax | ||||

49 | ; CHECK-NEXT: orl %edx, %eax | ||||

50 | ; CHECK-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill | ||||

51 | ; CHECK-NEXT: movl 16(%ebx), %edi | ||||

52 | ; CHECK-NEXT: movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill | ||||

53 | ; CHECK-NEXT: movl 20(%ebx), %eax | ||||

54 | ; CHECK-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill | ||||

55 | ; CHECK-NEXT: movl %eax, %edx | ||||

56 | ; CHECK-NEXT: shldl $2, %edi, %edx | ||||

57 | ; CHECK-NEXT: movl %eax, %edi | ||||

58 | ; CHECK-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload | ||||

59 | ; CHECK-NEXT: shldl $31, %eax, %edi | ||||

60 | ; CHECK-NEXT: shll $2, %eax | ||||

61 | ; CHECK-NEXT: orl %edi, %eax | ||||

62 | ; CHECK-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Reload | ||||

63 | ; CHECK-NEXT: shrl %edi | ||||

64 | ; CHECK-NEXT: orl %edx, %edi | ||||

65 | ; CHECK-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload | ||||

66 | ; CHECK-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill | ||||

67 | ; CHECK-NEXT: adcl %esi, %edi | ||||

68 | ; CHECK-NEXT: movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill | ||||

69 | ; CHECK-NEXT: movl 28(%ebx), %edi | ||||

70 | ; CHECK-NEXT: movl 24(%ebx), %eax | ||||

71 | ; CHECK-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill | ||||

72 | ; CHECK-NEXT: movl $-1028477379, %ebx # imm = 0xC2B2AE3D | ||||

73 | ; CHECK-NEXT: imull %eax, %ebx | ||||

74 | ; CHECK-NEXT: mull %ecx | ||||

75 | ; CHECK-NEXT: movl %eax, %esi | ||||

76 | ; CHECK-NEXT: imull %edi, %ecx | ||||

77 | ; CHECK-NEXT: addl %ebx, %ecx | ||||

78 | ; CHECK-NEXT: addl %edx, %ecx | ||||

79 | ; CHECK-NEXT: imull $1336530590, %edi, %edi # imm = 0x4FA9D69E | ||||

80 | ; CHECK-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload | ||||

81 | ; CHECK-NEXT: imull $-2056954758, %eax, %edx # imm = 0x85655C7A | ||||

82 | ; CHECK-NEXT: addl %edx, %edi | ||||

83 | ; CHECK-NEXT: movl $1336530590, %edx # imm = 0x4FA9D69E | ||||

84 | ; CHECK-NEXT: mull %edx | ||||

85 | ; CHECK-NEXT: addl %edx, %edi | ||||

86 | ; CHECK-NEXT: shrdl $3, %ecx, %esi | ||||

87 | ; CHECK-NEXT: sarl $3, %ecx | ||||

88 | ; CHECK-NEXT: orl %edi, %ecx | ||||

89 | ; CHECK-NEXT: orl %eax, %esi | ||||

90 | ; CHECK-NEXT: imull $326129324, %esi, %eax # imm = 0x137056AC | ||||

91 | ; CHECK-NEXT: imull $-66860409, %ecx, %ecx # imm = 0xFC03CA87 | ||||

92 | ; CHECK-NEXT: addl %eax, %ecx | ||||

93 | ; CHECK-NEXT: movl $-66860409, %edi # imm = 0xFC03CA87 | ||||

94 | ; CHECK-NEXT: movl %esi, %eax | ||||

95 | ; CHECK-NEXT: mull %edi | ||||

96 | ; CHECK-NEXT: addl %edx, %ecx | ||||

97 | ; CHECK-NEXT: xorl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Folded Reload | ||||

98 | ; CHECK-NEXT: xorl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload | ||||

99 | ; CHECK-NEXT: movl %ecx, b+4 | ||||

100 | ; CHECK-NEXT: imull $326129324, %eax, %edx # imm = 0x137056AC | ||||

101 | ; CHECK-NEXT: imull $-66860409, %ecx, %ecx # imm = 0xFC03CA87 | ||||

102 | ; CHECK-NEXT: addl %edx, %ecx | ||||

103 | ; CHECK-NEXT: movl %eax, b | ||||

104 | ; CHECK-NEXT: mull %edi | ||||

105 | ; CHECK-NEXT: jmp .LBB0_3 | ||||

106 | ; CHECK-NEXT: .LBB0_2: # %if.else | ||||

107 | ; CHECK-NEXT: xorl b+4, %edi | ||||

108 | ; CHECK-NEXT: xorl b, %ecx | ||||

109 | ; CHECK-NEXT: movl $1419758215, %edx # imm = 0x549FCA87 | ||||

110 | ; CHECK-NEXT: movl %ecx, %eax | ||||

111 | ; CHECK-NEXT: mull %edx | ||||

112 | ; CHECK-NEXT: imull $93298681, %ecx, %esi # imm = 0x58F9FF9 | ||||

113 | ; CHECK-NEXT: imull $1419758215, %edi, %ecx # imm = 0x549FCA87 | ||||

114 | ; CHECK-NEXT: addl %esi, %ecx | ||||

115 | ; CHECK-NEXT: .LBB0_3: # %if.end | ||||

116 | ; CHECK-NEXT: addl %edx, %ecx | ||||

117 | ; CHECK-NEXT: addl $-1028477341, %eax # imm = 0xC2B2AE63 | ||||

118 | ; CHECK-NEXT: adcl $-2048144777, %ecx # imm = 0x85EBCA77 | ||||

119 | ; CHECK-NEXT: movl %eax, b | ||||

120 | ; CHECK-NEXT: movl %ecx, b+4 | ||||

121 | ; CHECK-NEXT: addl $12, %esp | ||||

122 | ; CHECK-NEXT: popl %esi | ||||

123 | ; CHECK-NEXT: popl %edi | ||||

124 | ; CHECK-NEXT: popl %ebx | ||||

125 | ; CHECK-NEXT: popl %ebp | ||||

126 | ; CHECK-NEXT: .cfi_def_cfa %esp, 4 | ||||

127 | ; CHECK-NEXT: retl | ||||

22 | entry: | 128 | entry: | ||

23 | %0 = load i32, i32* @a, align 4, !tbaa !1 | 129 | %0 = load i32, i32* @a, align 4, !tbaa !1 | ||

24 | %1 = inttoptr i32 %0 to %struct.XXH_state64_t* | 130 | %1 = inttoptr i32 %0 to %struct.XXH_state64_t* | ||

25 | %total_len = getelementptr inbounds %struct.XXH_state64_t, %struct.XXH_state64_t* %1, i32 0, i32 0 | 131 | %total_len = getelementptr inbounds %struct.XXH_state64_t, %struct.XXH_state64_t* %1, i32 0, i32 0 | ||

26 | %2 = load i32, i32* %total_len, align 4, !tbaa !5 | 132 | %2 = load i32, i32* %total_len, align 4, !tbaa !5 | ||

27 | %tobool = icmp eq i32 %2, 0 | 133 | %tobool = icmp eq i32 %2, 0 | ||

28 | br i1 %tobool, label %if.else, label %if.then | 134 | br i1 %tobool, label %if.else, label %if.then | ||

29 | 135 | | |||

▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |