1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=mergeicmps -verify-dom-info -S | FileCheck %s
4 target triple = "x86_64"
6 ; This is very much not an x86 ABI, in current use, but we're testing
7 ; that we've fixed a bug where accumulateConstantOffset() was called incorrectly.
8 target datalayout = "e-p:64:64:64:32"
10 ; Define a cunstom data layout that has index width < pointer width
11 ; and make sure that doesn't mreak anything
12 define void @fat_ptrs(ptr dereferenceable(16) %a, ptr dereferenceable(16) %b) {
13 ; CHECK-LABEL: @fat_ptrs(
15 ; CHECK-NEXT: [[PTR_A1:%.*]] = getelementptr inbounds [2 x i64], ptr [[A:%.*]], i32 0, i32 1
16 ; CHECK-NEXT: [[PTR_B1:%.*]] = getelementptr inbounds [2 x i64], ptr [[B:%.*]], i32 0, i32 1
17 ; CHECK-NEXT: br label %"bb1+bb2"
19 ; CHECK-NEXT: [[MEMCMP:%.*]] = call i32 @memcmp(ptr [[A]], ptr [[B]], i64 16)
20 ; CHECK-NEXT: [[TMP0:%.*]] = icmp eq i32 [[MEMCMP]], 0
21 ; CHECK-NEXT: br label [[BB3:%.*]]
23 ; CHECK-NEXT: ret void
26 %ptr_a1 = getelementptr inbounds [2 x i64], ptr %a, i32 0, i32 1
27 %ptr_b1 = getelementptr inbounds [2 x i64], ptr %b, i32 0, i32 1
31 %a0 = load i64, ptr %a
32 %b0 = load i64, ptr %b
33 %cond0 = icmp eq i64 %a0, %b0
34 br i1 %cond0, label %bb2, label %bb3
37 %a1 = load i64, ptr %ptr_a1
38 %b1 = load i64, ptr %ptr_b1
39 %cond1 = icmp eq i64 %a1, %b1
42 bb3: ; preds = %bb2, %bb1
43 %necessary = phi i1 [ %cond1, %bb2 ], [ false, %bb1 ]