File: pr41164.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (36 lines) | stat: -rw-r--r-- 1,474 bytes parent folder | download | duplicates (12)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s

@wyhash64_x = global i64 0, align 8

define i64 @_Z8wyhash64v() {
; CHECK-LABEL: @_Z8wyhash64v(
; CHECK-NEXT:    [[TMP1:%.*]] = load i64, ptr @wyhash64_x, align 8
; CHECK-NEXT:    [[TMP2:%.*]] = add i64 [[TMP1]], 6971258582664805397
; CHECK-NEXT:    store i64 [[TMP2]], ptr @wyhash64_x, align 8
; CHECK-NEXT:    [[TMP3:%.*]] = zext i64 [[TMP2]] to i128
; CHECK-NEXT:    [[TMP4:%.*]] = mul nuw i128 [[TMP3]], 11795372955171141389
; CHECK-NEXT:    [[TMP5:%.*]] = lshr i128 [[TMP4]], 64
; CHECK-NEXT:    [[DOTMASKED:%.*]] = and i128 [[TMP4]], 18446744073709551615
; CHECK-NEXT:    [[TMP6:%.*]] = xor i128 [[TMP5]], [[DOTMASKED]]
; CHECK-NEXT:    [[TMP7:%.*]] = mul nuw nsw i128 [[TMP6]], 1946526487930394057
; CHECK-NEXT:    [[TMP8:%.*]] = lshr i128 [[TMP7]], 64
; CHECK-NEXT:    [[TMP9:%.*]] = xor i128 [[TMP8]], [[TMP7]]
; CHECK-NEXT:    [[TMP10:%.*]] = trunc i128 [[TMP9]] to i64
; CHECK-NEXT:    ret i64 [[TMP10]]
;
  %1 = load i64, ptr @wyhash64_x, align 8
  %2 = add i64 %1, 6971258582664805397
  store i64 %2, ptr @wyhash64_x, align 8
  %3 = zext i64 %2 to i128
  %4 = mul i128 %3, 11795372955171141389
  %5 = lshr i128 %4, 64
  %6 = xor i128 %5, %4
  %7 = trunc i128 %6 to i64
  %8 = zext i64 %7 to i128
  %9 = mul i128 %8, 1946526487930394057
  %10 = lshr i128 %9, 64
  %11 = xor i128 %10, %9
  %12 = trunc i128 %11 to i64
  ret i64 %12
}