File: pr41164.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; 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
}