xref: /llvm-project/llvm/test/Transforms/InstCombine/PR30597.ll (revision 211cf8a384ebb29787367c8fd5858e2a5ed3c10f)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -passes=instcombine -S | FileCheck %s
3
4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5target triple = "x86_64-unknown-linux-gnu"
6
7; Function Attrs: readonly uwtable
8define i1 @dot_ref_s(ptr noalias nocapture readonly dereferenceable(8)) {
9; CHECK-LABEL: @dot_ref_s(
10; CHECK-NEXT:  entry-block:
11; CHECK-NEXT:    ret i1 false
12;
13entry-block:
14  %loadedptr = load ptr, ptr %0, align 8, !nonnull !0
15  %ptrtoint = ptrtoint ptr %loadedptr to i64
16  %inttoptr = inttoptr i64 %ptrtoint to ptr
17  %switchtmp = icmp eq ptr %inttoptr, null
18  ret i1 %switchtmp
19
20}
21
22; Function Attrs: readonly uwtable
23define ptr @function(ptr noalias nocapture readonly dereferenceable(8)) {
24; CHECK-LABEL: @function(
25; CHECK-NEXT:  entry-block:
26; CHECK-NEXT:    [[LOADED:%.*]] = load i64, ptr [[TMP0:%.*]], align 8, !range [[RNG0:![0-9]+]]
27; CHECK-NEXT:    [[INTTOPTR:%.*]] = inttoptr i64 [[LOADED]] to ptr
28; CHECK-NEXT:    ret ptr [[INTTOPTR]]
29;
30entry-block:
31  %loaded = load i64, ptr %0, align 8, !range !1
32  %inttoptr = inttoptr i64 %loaded to ptr
33  ret ptr %inttoptr
34}
35
36
37!0 = !{}
38!1 = !{i64 1, i64 140737488355327}
39