[llvm] 8c6aea6 - [GVNHoist] Convert test to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 5 00:30:45 PDT 2023
Author: Nikita Popov
Date: 2023-07-05T09:30:24+02:00
New Revision: 8c6aea6c5662e48526cf575f7163a5830abd1d43
URL: https://github.com/llvm/llvm-project/commit/8c6aea6c5662e48526cf575f7163a5830abd1d43
DIFF: https://github.com/llvm/llvm-project/commit/8c6aea6c5662e48526cf575f7163a5830abd1d43.diff
LOG: [GVNHoist] Convert test to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/GVNHoist/hoist.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/GVNHoist/hoist.ll b/llvm/test/Transforms/GVNHoist/hoist.ll
index caf49bf8989f5d..6249111d600ef0 100644
--- a/llvm/test/Transforms/GVNHoist/hoist.ll
+++ b/llvm/test/Transforms/GVNHoist/hoist.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -opaque-pointers=0 -passes=gvn-hoist -S < %s | FileCheck %s
+; RUN: opt -passes=gvn-hoist -S < %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@@ -54,25 +54,25 @@ if.end: ; preds = %if.else, %if.then
; Check that all loads and scalars depending on the loads are hoisted.
; Check that getelementptr computation gets hoisted before the load.
-define float @readsAndScalarsHoisting(float %d, float* %min, float* %max, float* %a) {
+define float @readsAndScalarsHoisting(float %d, ptr %min, ptr %max, ptr %a) {
; CHECK-LABEL: @readsAndScalarsHoisting(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DIV:%.*]] = fdiv float 1.000000e+00, [[D:%.*]]
; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[DIV]], 0.000000e+00
-; CHECK-NEXT: [[TMP0:%.*]] = getelementptr float, float* [[MIN:%.*]], i32 1
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[TMP0]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[A:%.*]], align 4
-; CHECK-NEXT: [[TMP3:%.*]] = load float, float* [[MAX:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[MIN:%.*]], i32 1
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[TMP0]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[A:%.*]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[MAX:%.*]], align 4
; CHECK-NEXT: [[SUB:%.*]] = fsub float [[TMP1]], [[TMP2]]
; CHECK-NEXT: [[MUL:%.*]] = fmul float [[SUB]], [[DIV]]
; CHECK-NEXT: [[SUB1:%.*]] = fsub float [[TMP3]], [[TMP2]]
; CHECK-NEXT: [[MUL2:%.*]] = fmul float [[SUB1]], [[DIV]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[A:%.*]] = getelementptr float, float* [[MIN]], i32 1
+; CHECK-NEXT: [[A:%.*]] = getelementptr float, ptr [[MIN]], i32 1
; CHECK-NEXT: br label [[IF_END:%.*]]
; CHECK: if.else:
-; CHECK-NEXT: [[B:%.*]] = getelementptr float, float* [[MIN]], i32 1
+; CHECK-NEXT: [[B:%.*]] = getelementptr float, ptr [[MIN]], i32 1
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
; CHECK-NEXT: [[TMAX_0:%.*]] = phi float [ [[MUL2]], [[IF_THEN]] ], [ [[MUL]], [[IF_ELSE]] ]
@@ -86,23 +86,23 @@ entry:
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
- %A = getelementptr float, float* %min, i32 1
- %0 = load float, float* %A, align 4
- %1 = load float, float* %a, align 4
+ %A = getelementptr float, ptr %min, i32 1
+ %0 = load float, ptr %A, align 4
+ %1 = load float, ptr %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
- %2 = load float, float* %max, align 4
+ %2 = load float, ptr %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
- %3 = load float, float* %max, align 4
- %4 = load float, float* %a, align 4
+ %3 = load float, ptr %max, align 4
+ %4 = load float, ptr %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
- %B = getelementptr float, float* %min, i32 1
- %5 = load float, float* %B, align 4
+ %B = getelementptr float, ptr %min, i32 1
+ %5 = load float, ptr %B, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
@@ -116,24 +116,24 @@ if.end: ; preds = %if.else, %if.then
; Check that we do not hoist loads after a store: the first two loads will be
; hoisted, and then the third load will not be hoisted.
-define float @readsAndWrites(float %d, float* %min, float* %max, float* %a) {
+define float @readsAndWrites(float %d, ptr %min, ptr %max, ptr %a) {
; CHECK-LABEL: @readsAndWrites(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DIV:%.*]] = fdiv float 1.000000e+00, [[D:%.*]]
; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[DIV]], 0.000000e+00
-; CHECK-NEXT: [[TMP0:%.*]] = load float, float* [[MIN:%.*]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[A:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[MIN:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[A:%.*]], align 4
; CHECK-NEXT: [[SUB:%.*]] = fsub float [[TMP0]], [[TMP1]]
; CHECK-NEXT: [[MUL:%.*]] = fmul float [[SUB]], [[DIV]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: store float [[TMP0]], float* @GlobalVar, align 4
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[MAX:%.*]], align 4
+; CHECK-NEXT: store float [[TMP0]], ptr @GlobalVar, align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[MAX:%.*]], align 4
; CHECK-NEXT: [[SUB1:%.*]] = fsub float [[TMP2]], [[TMP1]]
; CHECK-NEXT: [[MUL2:%.*]] = fmul float [[SUB1]], [[DIV]]
; CHECK-NEXT: br label [[IF_END:%.*]]
; CHECK: if.else:
-; CHECK-NEXT: [[TMP3:%.*]] = load float, float* [[MAX]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[MAX]], align 4
; CHECK-NEXT: [[SUB3:%.*]] = fsub float [[TMP3]], [[TMP1]]
; CHECK-NEXT: [[MUL4:%.*]] = fmul float [[SUB3]], [[DIV]]
; CHECK-NEXT: br label [[IF_END]]
@@ -149,22 +149,22 @@ entry:
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
- %0 = load float, float* %min, align 4
- %1 = load float, float* %a, align 4
- store float %0, float* @GlobalVar
+ %0 = load float, ptr %min, align 4
+ %1 = load float, ptr %a, align 4
+ store float %0, ptr @GlobalVar
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
- %2 = load float, float* %max, align 4
+ %2 = load float, ptr %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
- %3 = load float, float* %max, align 4
- %4 = load float, float* %a, align 4
+ %3 = load float, ptr %max, align 4
+ %4 = load float, ptr %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
- %5 = load float, float* %min, align 4
+ %5 = load float, ptr %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
@@ -177,15 +177,15 @@ if.end: ; preds = %if.else, %if.then
}
; Check that we do hoist loads when the store is above the insertion point.
-define float @readsAndWriteAboveInsertPt(float %d, float* %min, float* %max, float* %a) {
+define float @readsAndWriteAboveInsertPt(float %d, ptr %min, ptr %max, ptr %a) {
; CHECK-LABEL: @readsAndWriteAboveInsertPt(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DIV:%.*]] = fdiv float 1.000000e+00, [[D:%.*]]
-; CHECK-NEXT: store float 0.000000e+00, float* @GlobalVar, align 4
+; CHECK-NEXT: store float 0.000000e+00, ptr @GlobalVar, align 4
; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[DIV]], 0.000000e+00
-; CHECK-NEXT: [[TMP0:%.*]] = load float, float* [[MIN:%.*]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[A:%.*]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[MAX:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[MIN:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[A:%.*]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[MAX:%.*]], align 4
; CHECK-NEXT: [[SUB:%.*]] = fsub float [[TMP0]], [[TMP1]]
; CHECK-NEXT: [[MUL:%.*]] = fmul float [[SUB]], [[DIV]]
; CHECK-NEXT: [[SUB1:%.*]] = fsub float [[TMP2]], [[TMP1]]
@@ -203,26 +203,26 @@ define float @readsAndWriteAboveInsertPt(float %d, float* %min, float* %max, flo
;
entry:
%div = fdiv float 1.000000e+00, %d
- store float 0.000000e+00, float* @GlobalVar
+ store float 0.000000e+00, ptr @GlobalVar
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
- %0 = load float, float* %min, align 4
- %1 = load float, float* %a, align 4
+ %0 = load float, ptr %min, align 4
+ %1 = load float, ptr %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
- %2 = load float, float* %max, align 4
+ %2 = load float, ptr %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
- %3 = load float, float* %max, align 4
- %4 = load float, float* %a, align 4
+ %3 = load float, ptr %max, align 4
+ %4 = load float, ptr %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
- %5 = load float, float* %min, align 4
+ %5 = load float, ptr %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
@@ -325,14 +325,14 @@ if.end:
}
; Check that we hoist load and scalar expressions in triangles.
-define float @triangleHoisting(float %d, float* %min, float* %max, float* %a) {
+define float @triangleHoisting(float %d, ptr %min, ptr %max, ptr %a) {
; CHECK-LABEL: @triangleHoisting(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DIV:%.*]] = fdiv float 1.000000e+00, [[D:%.*]]
; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[DIV]], 0.000000e+00
-; CHECK-NEXT: [[TMP0:%.*]] = load float, float* [[MIN:%.*]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[A:%.*]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[MAX:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[MIN:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[A:%.*]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[MAX:%.*]], align 4
; CHECK-NEXT: [[SUB5:%.*]] = fsub float [[TMP0]], [[TMP1]]
; CHECK-NEXT: [[MUL6:%.*]] = fmul float [[SUB5]], [[DIV]]
; CHECK-NEXT: [[SUB3:%.*]] = fsub float [[TMP2]], [[TMP1]]
@@ -354,11 +354,11 @@ entry:
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- %0 = load float, float* %min, align 4
- %1 = load float, float* %a, align 4
+ %0 = load float, ptr %min, align 4
+ %1 = load float, ptr %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
- %2 = load float, float* %max, align 4
+ %2 = load float, ptr %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
@@ -366,11 +366,11 @@ if.then: ; preds = %entry
if.end: ; preds = %entry
%p1 = phi float [ %mul2, %if.then ], [ 0.000000e+00, %entry ]
%p2 = phi float [ %mul, %if.then ], [ 0.000000e+00, %entry ]
- %3 = load float, float* %max, align 4
- %4 = load float, float* %a, align 4
+ %3 = load float, ptr %max, align 4
+ %4 = load float, ptr %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
- %5 = load float, float* %min, align 4
+ %5 = load float, ptr %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
@@ -385,24 +385,24 @@ define i32 @noHoistInSingleBBWithStore() {
; CHECK-LABEL: @noHoistInSingleBBWithStore(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = alloca i32, align 4
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[D]] to i8*
-; CHECK-NEXT: [[BF:%.*]] = load i8, i8* [[TMP0]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast ptr [[D]] to ptr
+; CHECK-NEXT: [[BF:%.*]] = load i8, ptr [[TMP0]], align 4
; CHECK-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF]], -3
-; CHECK-NEXT: store i8 [[BF_CLEAR]], i8* [[TMP0]], align 4
-; CHECK-NEXT: [[BF1:%.*]] = load i8, i8* [[TMP0]], align 4
+; CHECK-NEXT: store i8 [[BF_CLEAR]], ptr [[TMP0]], align 4
+; CHECK-NEXT: [[BF1:%.*]] = load i8, ptr [[TMP0]], align 4
; CHECK-NEXT: [[BF_CLEAR1:%.*]] = and i8 [[BF1]], 1
-; CHECK-NEXT: store i8 [[BF_CLEAR1]], i8* [[TMP0]], align 4
+; CHECK-NEXT: store i8 [[BF_CLEAR1]], ptr [[TMP0]], align 4
; CHECK-NEXT: ret i32 0
;
entry:
%D = alloca i32, align 4
- %0 = bitcast i32* %D to i8*
- %bf = load i8, i8* %0, align 4
+ %0 = bitcast ptr %D to ptr
+ %bf = load i8, ptr %0, align 4
%bf.clear = and i8 %bf, -3
- store i8 %bf.clear, i8* %0, align 4
- %bf1 = load i8, i8* %0, align 4
+ store i8 %bf.clear, ptr %0, align 4
+ %bf1 = load i8, ptr %0, align 4
%bf.clear1 = and i8 %bf1, 1
- store i8 %bf.clear1, i8* %0, align 4
+ store i8 %bf.clear1, ptr %0, align 4
ret i32 0
}
@@ -412,59 +412,59 @@ define i32 @noHoistInSingleBBWithCall() {
; CHECK-LABEL: @noHoistInSingleBBWithCall(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = alloca i32, align 4
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[D]] to i8*
-; CHECK-NEXT: [[BF:%.*]] = load i8, i8* [[TMP0]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast ptr [[D]] to ptr
+; CHECK-NEXT: [[BF:%.*]] = load i8, ptr [[TMP0]], align 4
; CHECK-NEXT: [[BF_CLEAR:%.*]] = and i8 [[BF]], -3
; CHECK-NEXT: call void @foo()
-; CHECK-NEXT: [[BF1:%.*]] = load i8, i8* [[TMP0]], align 4
+; CHECK-NEXT: [[BF1:%.*]] = load i8, ptr [[TMP0]], align 4
; CHECK-NEXT: [[BF_CLEAR1:%.*]] = and i8 [[BF1]], 1
; CHECK-NEXT: ret i32 0
;
entry:
%D = alloca i32, align 4
- %0 = bitcast i32* %D to i8*
- %bf = load i8, i8* %0, align 4
+ %0 = bitcast ptr %D to ptr
+ %bf = load i8, ptr %0, align 4
%bf.clear = and i8 %bf, -3
call void @foo()
- %bf1 = load i8, i8* %0, align 4
+ %bf1 = load i8, ptr %0, align 4
%bf.clear1 = and i8 %bf1, 1
ret i32 0
}
; Check that we do not hoist loads past stores in any branch of a diamond.
-define float @noHoistInDiamondWithOneStore1(float %d, float* %min, float* %max, float* %a) {
+define float @noHoistInDiamondWithOneStore1(float %d, ptr %min, ptr %max, ptr %a) {
; CHECK-LABEL: @noHoistInDiamondWithOneStore1(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DIV:%.*]] = fdiv float 1.000000e+00, [[D:%.*]]
; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[DIV]], 0.000000e+00
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: store float 0.000000e+00, float* @GlobalVar, align 4
-; CHECK-NEXT: [[TMP0:%.*]] = load float, float* [[MIN:%.*]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[A:%.*]], align 4
+; CHECK-NEXT: store float 0.000000e+00, ptr @GlobalVar, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[MIN:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[A:%.*]], align 4
; CHECK-NEXT: [[SUB:%.*]] = fsub float [[TMP0]], [[TMP1]]
; CHECK-NEXT: [[MUL:%.*]] = fmul float [[SUB]], [[DIV]]
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[MAX:%.*]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[MAX:%.*]], align 4
; CHECK-NEXT: [[SUB1:%.*]] = fsub float [[TMP2]], [[TMP1]]
; CHECK-NEXT: [[MUL2:%.*]] = fmul float [[SUB1]], [[DIV]]
; CHECK-NEXT: br label [[IF_END:%.*]]
; CHECK: if.else:
-; CHECK-NEXT: [[TMP3:%.*]] = load float, float* [[MAX]], align 4
-; CHECK-NEXT: [[TMP4:%.*]] = load float, float* [[A]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[MAX]], align 4
+; CHECK-NEXT: [[TMP4:%.*]] = load float, ptr [[A]], align 4
; CHECK-NEXT: [[SUB3:%.*]] = fsub float [[TMP3]], [[TMP4]]
; CHECK-NEXT: [[MUL4:%.*]] = fmul float [[SUB3]], [[DIV]]
-; CHECK-NEXT: [[TMP5:%.*]] = load float, float* [[MIN]], align 4
+; CHECK-NEXT: [[TMP5:%.*]] = load float, ptr [[MIN]], align 4
; CHECK-NEXT: [[SUB5:%.*]] = fsub float [[TMP5]], [[TMP4]]
; CHECK-NEXT: [[MUL6:%.*]] = fmul float [[SUB5]], [[DIV]]
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
; CHECK-NEXT: [[TMAX_0:%.*]] = phi float [ [[MUL2]], [[IF_THEN]] ], [ [[MUL6]], [[IF_ELSE]] ]
; CHECK-NEXT: [[TMIN_0:%.*]] = phi float [ [[MUL]], [[IF_THEN]] ], [ [[MUL4]], [[IF_ELSE]] ]
-; CHECK-NEXT: [[TMP6:%.*]] = load float, float* [[MAX]], align 4
-; CHECK-NEXT: [[TMP7:%.*]] = load float, float* [[A]], align 4
+; CHECK-NEXT: [[TMP6:%.*]] = load float, ptr [[MAX]], align 4
+; CHECK-NEXT: [[TMP7:%.*]] = load float, ptr [[A]], align 4
; CHECK-NEXT: [[SUB6:%.*]] = fsub float [[TMP6]], [[TMP7]]
; CHECK-NEXT: [[MUL7:%.*]] = fmul float [[SUB6]], [[DIV]]
-; CHECK-NEXT: [[TMP8:%.*]] = load float, float* [[MIN]], align 4
+; CHECK-NEXT: [[TMP8:%.*]] = load float, ptr [[MIN]], align 4
; CHECK-NEXT: [[SUB8:%.*]] = fsub float [[TMP8]], [[TMP7]]
; CHECK-NEXT: [[MUL9:%.*]] = fmul float [[SUB8]], [[DIV]]
; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMAX_0]], [[TMIN_0]]
@@ -476,23 +476,23 @@ entry:
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
- store float 0.000000e+00, float* @GlobalVar
- %0 = load float, float* %min, align 4
- %1 = load float, float* %a, align 4
+ store float 0.000000e+00, ptr @GlobalVar
+ %0 = load float, ptr %min, align 4
+ %1 = load float, ptr %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
- %2 = load float, float* %max, align 4
+ %2 = load float, ptr %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
; There are no side effects on the if.else branch.
- %3 = load float, float* %max, align 4
- %4 = load float, float* %a, align 4
+ %3 = load float, ptr %max, align 4
+ %4 = load float, ptr %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
- %5 = load float, float* %min, align 4
+ %5 = load float, ptr %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
@@ -501,11 +501,11 @@ if.end: ; preds = %if.else, %if.then
%tmax.0 = phi float [ %mul2, %if.then ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %if.then ], [ %mul4, %if.else ]
- %6 = load float, float* %max, align 4
- %7 = load float, float* %a, align 4
+ %6 = load float, ptr %max, align 4
+ %7 = load float, ptr %a, align 4
%sub6 = fsub float %6, %7
%mul7 = fmul float %sub6, %div
- %8 = load float, float* %min, align 4
+ %8 = load float, ptr %min, align 4
%sub8 = fsub float %8, %7
%mul9 = fmul float %sub8, %div
@@ -514,21 +514,21 @@ if.end: ; preds = %if.else, %if.then
}
; Check that we do not hoist loads past stores from half diamond.
-define float @noHoistInHalfDiamondPastStore(float %d, float* %min, float* %max, float* %a) {
+define float @noHoistInHalfDiamondPastStore(float %d, ptr %min, ptr %max, ptr %a) {
; CHECK-LABEL: @noHoistInHalfDiamondPastStore(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DIV:%.*]] = fdiv float 1.000000e+00, [[D:%.*]]
; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[DIV]], 0.000000e+00
-; CHECK-NEXT: [[TMP0:%.*]] = load float, float* [[MIN:%.*]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[A:%.*]], align 4
-; CHECK-NEXT: store float 0.000000e+00, float* @GlobalVar, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[MIN:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[A:%.*]], align 4
+; CHECK-NEXT: store float 0.000000e+00, ptr @GlobalVar, align 4
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[MAX:%.*]], align 4
-; CHECK-NEXT: [[TMP3:%.*]] = load float, float* [[A]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[MAX:%.*]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[A]], align 4
; CHECK-NEXT: [[SUB3:%.*]] = fsub float [[TMP2]], [[TMP3]]
; CHECK-NEXT: [[MUL4:%.*]] = fmul float [[SUB3]], [[DIV]]
-; CHECK-NEXT: [[TMP4:%.*]] = load float, float* [[MIN]], align 4
+; CHECK-NEXT: [[TMP4:%.*]] = load float, ptr [[MIN]], align 4
; CHECK-NEXT: [[SUB5:%.*]] = fsub float [[TMP4]], [[TMP3]]
; CHECK-NEXT: [[MUL6:%.*]] = fmul float [[SUB5]], [[DIV]]
; CHECK-NEXT: br label [[IF_END]]
@@ -541,21 +541,21 @@ define float @noHoistInHalfDiamondPastStore(float %d, float* %min, float* %max,
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
- %0 = load float, float* %min, align 4
- %1 = load float, float* %a, align 4
+ %0 = load float, ptr %min, align 4
+ %1 = load float, ptr %a, align 4
; Loads should not be hoisted above this store.
- store float 0.000000e+00, float* @GlobalVar
+ store float 0.000000e+00, ptr @GlobalVar
br i1 %cmp, label %if.then, label %if.end
if.then:
; There are no side effects on the if.then branch.
- %2 = load float, float* %max, align 4
- %3 = load float, float* %a, align 4
+ %2 = load float, ptr %max, align 4
+ %3 = load float, ptr %a, align 4
%sub3 = fsub float %2, %3
%mul4 = fmul float %sub3, %div
- %4 = load float, float* %min, align 4
+ %4 = load float, ptr %min, align 4
%sub5 = fsub float %4, %3
%mul6 = fmul float %sub5, %div
br label %if.end
@@ -569,39 +569,39 @@ if.end:
}
; Check that we do not hoist loads past a store in any branch of a diamond.
-define float @noHoistInDiamondWithOneStore2(float %d, float* %min, float* %max, float* %a) {
+define float @noHoistInDiamondWithOneStore2(float %d, ptr %min, ptr %max, ptr %a) {
; CHECK-LABEL: @noHoistInDiamondWithOneStore2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DIV:%.*]] = fdiv float 1.000000e+00, [[D:%.*]]
; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[DIV]], 0.000000e+00
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[TMP0:%.*]] = load float, float* [[MIN:%.*]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[A:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[MIN:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[A:%.*]], align 4
; CHECK-NEXT: [[SUB:%.*]] = fsub float [[TMP0]], [[TMP1]]
; CHECK-NEXT: [[MUL:%.*]] = fmul float [[SUB]], [[DIV]]
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[MAX:%.*]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[MAX:%.*]], align 4
; CHECK-NEXT: [[SUB1:%.*]] = fsub float [[TMP2]], [[TMP1]]
; CHECK-NEXT: [[MUL2:%.*]] = fmul float [[SUB1]], [[DIV]]
; CHECK-NEXT: br label [[IF_END:%.*]]
; CHECK: if.else:
-; CHECK-NEXT: store float 0.000000e+00, float* @GlobalVar, align 4
-; CHECK-NEXT: [[TMP3:%.*]] = load float, float* [[MAX]], align 4
-; CHECK-NEXT: [[TMP4:%.*]] = load float, float* [[A]], align 4
+; CHECK-NEXT: store float 0.000000e+00, ptr @GlobalVar, align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[MAX]], align 4
+; CHECK-NEXT: [[TMP4:%.*]] = load float, ptr [[A]], align 4
; CHECK-NEXT: [[SUB3:%.*]] = fsub float [[TMP3]], [[TMP4]]
; CHECK-NEXT: [[MUL4:%.*]] = fmul float [[SUB3]], [[DIV]]
-; CHECK-NEXT: [[TMP5:%.*]] = load float, float* [[MIN]], align 4
+; CHECK-NEXT: [[TMP5:%.*]] = load float, ptr [[MIN]], align 4
; CHECK-NEXT: [[SUB5:%.*]] = fsub float [[TMP5]], [[TMP4]]
; CHECK-NEXT: [[MUL6:%.*]] = fmul float [[SUB5]], [[DIV]]
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
; CHECK-NEXT: [[TMAX_0:%.*]] = phi float [ [[MUL2]], [[IF_THEN]] ], [ [[MUL6]], [[IF_ELSE]] ]
; CHECK-NEXT: [[TMIN_0:%.*]] = phi float [ [[MUL]], [[IF_THEN]] ], [ [[MUL4]], [[IF_ELSE]] ]
-; CHECK-NEXT: [[TMP6:%.*]] = load float, float* [[MAX]], align 4
-; CHECK-NEXT: [[TMP7:%.*]] = load float, float* [[A]], align 4
+; CHECK-NEXT: [[TMP6:%.*]] = load float, ptr [[MAX]], align 4
+; CHECK-NEXT: [[TMP7:%.*]] = load float, ptr [[A]], align 4
; CHECK-NEXT: [[SUB6:%.*]] = fsub float [[TMP6]], [[TMP7]]
; CHECK-NEXT: [[MUL7:%.*]] = fmul float [[SUB6]], [[DIV]]
-; CHECK-NEXT: [[TMP8:%.*]] = load float, float* [[MIN]], align 4
+; CHECK-NEXT: [[TMP8:%.*]] = load float, ptr [[MIN]], align 4
; CHECK-NEXT: [[SUB8:%.*]] = fsub float [[TMP8]], [[TMP7]]
; CHECK-NEXT: [[MUL9:%.*]] = fmul float [[SUB8]], [[DIV]]
; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMAX_0]], [[TMIN_0]]
@@ -614,22 +614,22 @@ entry:
if.then: ; preds = %entry
; There are no side effects on the if.then branch.
- %0 = load float, float* %min, align 4
- %1 = load float, float* %a, align 4
+ %0 = load float, ptr %min, align 4
+ %1 = load float, ptr %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
- %2 = load float, float* %max, align 4
+ %2 = load float, ptr %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
- store float 0.000000e+00, float* @GlobalVar
- %3 = load float, float* %max, align 4
- %4 = load float, float* %a, align 4
+ store float 0.000000e+00, ptr @GlobalVar
+ %3 = load float, ptr %max, align 4
+ %4 = load float, ptr %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
- %5 = load float, float* %min, align 4
+ %5 = load float, ptr %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
@@ -638,11 +638,11 @@ if.end: ; preds = %if.else, %if.then
%tmax.0 = phi float [ %mul2, %if.then ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %if.then ], [ %mul4, %if.else ]
- %6 = load float, float* %max, align 4
- %7 = load float, float* %a, align 4
+ %6 = load float, ptr %max, align 4
+ %7 = load float, ptr %a, align 4
%sub6 = fsub float %6, %7
%mul7 = fmul float %sub6, %div
- %8 = load float, float* %min, align 4
+ %8 = load float, ptr %min, align 4
%sub8 = fsub float %8, %7
%mul9 = fmul float %sub8, %div
@@ -651,19 +651,19 @@ if.end: ; preds = %if.else, %if.then
}
; Check that we do not hoist loads outside a loop containing stores.
-define float @noHoistInLoopsWithStores(float %d, float* %min, float* %max, float* %a) {
+define float @noHoistInLoopsWithStores(float %d, ptr %min, ptr %max, ptr %a) {
; CHECK-LABEL: @noHoistInLoopsWithStores(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DIV:%.*]] = fdiv float 1.000000e+00, [[D:%.*]]
; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[DIV]], 0.000000e+00
; CHECK-NEXT: br i1 [[CMP]], label [[DO_BODY:%.*]], label [[IF_ELSE:%.*]]
; CHECK: do.body:
-; CHECK-NEXT: [[TMP0:%.*]] = load float, float* [[MIN:%.*]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load float, float* [[A:%.*]], align 4
-; CHECK-NEXT: store float 0.000000e+00, float* @GlobalVar, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[MIN:%.*]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[A:%.*]], align 4
+; CHECK-NEXT: store float 0.000000e+00, ptr @GlobalVar, align 4
; CHECK-NEXT: [[SUB:%.*]] = fsub float [[TMP0]], [[TMP1]]
; CHECK-NEXT: [[MUL:%.*]] = fmul float [[SUB]], [[DIV]]
-; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[MAX:%.*]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[MAX:%.*]], align 4
; CHECK-NEXT: [[SUB1:%.*]] = fsub float [[TMP2]], [[TMP1]]
; CHECK-NEXT: [[MUL2:%.*]] = fmul float [[SUB1]], [[DIV]]
; CHECK-NEXT: br label [[WHILE_COND:%.*]]
@@ -671,11 +671,11 @@ define float @noHoistInLoopsWithStores(float %d, float* %min, float* %max, float
; CHECK-NEXT: [[CMP1:%.*]] = fcmp oge float [[MUL2]], 0.000000e+00
; CHECK-NEXT: br i1 [[CMP1]], label [[IF_END:%.*]], label [[DO_BODY]]
; CHECK: if.else:
-; CHECK-NEXT: [[TMP3:%.*]] = load float, float* [[MAX]], align 4
-; CHECK-NEXT: [[TMP4:%.*]] = load float, float* [[A]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[MAX]], align 4
+; CHECK-NEXT: [[TMP4:%.*]] = load float, ptr [[A]], align 4
; CHECK-NEXT: [[SUB3:%.*]] = fsub float [[TMP3]], [[TMP4]]
; CHECK-NEXT: [[MUL4:%.*]] = fmul float [[SUB3]], [[DIV]]
-; CHECK-NEXT: [[TMP5:%.*]] = load float, float* [[MIN]], align 4
+; CHECK-NEXT: [[TMP5:%.*]] = load float, ptr [[MIN]], align 4
; CHECK-NEXT: [[SUB5:%.*]] = fsub float [[TMP5]], [[TMP4]]
; CHECK-NEXT: [[MUL6:%.*]] = fmul float [[SUB5]], [[DIV]]
; CHECK-NEXT: br label [[IF_END]]
@@ -691,15 +691,15 @@ entry:
br i1 %cmp, label %do.body, label %if.else
do.body:
- %0 = load float, float* %min, align 4
- %1 = load float, float* %a, align 4
+ %0 = load float, ptr %min, align 4
+ %1 = load float, ptr %a, align 4
; It is unsafe to hoist the loads outside the loop because of the store.
- store float 0.000000e+00, float* @GlobalVar
+ store float 0.000000e+00, ptr @GlobalVar
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
- %2 = load float, float* %max, align 4
+ %2 = load float, ptr %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %while.cond
@@ -709,11 +709,11 @@ while.cond:
br i1 %cmp1, label %if.end, label %do.body
if.else:
- %3 = load float, float* %max, align 4
- %4 = load float, float* %a, align 4
+ %3 = load float, ptr %max, align 4
+ %4 = load float, ptr %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
- %5 = load float, float* %min, align 4
+ %5 = load float, ptr %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
@@ -729,40 +729,40 @@ if.end:
; Check that we hoist stores: all the instructions from the then branch
; should be hoisted.
-%struct.foo = type { i16* }
+%struct.foo = type { ptr }
-define void @hoistStores(%struct.foo* %s, i32* %coord, i1 zeroext %delta) {
+define void @hoistStores(ptr %s, ptr %coord, i1 zeroext %delta) {
; CHECK-LABEL: @hoistStores(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[FROMBOOL:%.*]] = zext i1 [[DELTA:%.*]] to i8
; CHECK-NEXT: [[TOBOOL:%.*]] = trunc i8 [[FROMBOOL]] to i1
-; CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], %struct.foo* [[S:%.*]], i32 0, i32 0
-; CHECK-NEXT: [[TMP1:%.*]] = load i16*, i16** [[TMP0]], align 8
-; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT_FOO]], %struct.foo* [[S]], i32 0, i32 0
-; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i16, i16* [[TMP1]], i32 1
-; CHECK-NEXT: store i16* [[TMP3]], i16** [[TMP2]], align 8
-; CHECK-NEXT: [[TMP4:%.*]] = load i16, i16* [[TMP1]], align 2
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[COORD:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT_FOO:%.*]], ptr [[S:%.*]], i32 0, i32 0
+; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT_FOO]], ptr [[S]], i32 0, i32 0
+; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i16, ptr [[TMP1]], i32 1
+; CHECK-NEXT: store ptr [[TMP3]], ptr [[TMP2]], align 8
+; CHECK-NEXT: [[TMP4:%.*]] = load i16, ptr [[TMP1]], align 2
+; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[COORD:%.*]], align 4
; CHECK-NEXT: [[CONV:%.*]] = zext i16 [[TMP4]] to i32
; CHECK-NEXT: [[ADD:%.*]] = add i32 [[TMP5]], [[CONV]]
-; CHECK-NEXT: store i32 [[ADD]], i32* [[COORD]], align 4
+; CHECK-NEXT: store i32 [[ADD]], ptr [[COORD]], align 4
; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[P:%.*]] = getelementptr inbounds [[STRUCT_FOO]], %struct.foo* [[S]], i32 0, i32 0
-; CHECK-NEXT: [[INCDEC_PTR:%.*]] = getelementptr inbounds i16, i16* [[TMP1]], i32 1
+; CHECK-NEXT: [[P:%.*]] = getelementptr inbounds [[STRUCT_FOO]], ptr [[S]], i32 0, i32 0
+; CHECK-NEXT: [[INCDEC_PTR:%.*]] = getelementptr inbounds i16, ptr [[TMP1]], i32 1
; CHECK-NEXT: br label [[IF_END:%.*]]
; CHECK: if.else:
-; CHECK-NEXT: [[P1:%.*]] = getelementptr inbounds [[STRUCT_FOO]], %struct.foo* [[S]], i32 0, i32 0
-; CHECK-NEXT: [[INCDEC_PTR2:%.*]] = getelementptr inbounds i16, i16* [[TMP1]], i32 1
-; CHECK-NEXT: [[TMP6:%.*]] = load i16*, i16** [[P1]], align 8
-; CHECK-NEXT: [[INCDEC_PTR6:%.*]] = getelementptr inbounds i16, i16* [[TMP6]], i32 1
-; CHECK-NEXT: store i16* [[INCDEC_PTR6]], i16** [[P1]], align 8
-; CHECK-NEXT: [[TMP7:%.*]] = load i16, i16* [[TMP6]], align 2
+; CHECK-NEXT: [[P1:%.*]] = getelementptr inbounds [[STRUCT_FOO]], ptr [[S]], i32 0, i32 0
+; CHECK-NEXT: [[INCDEC_PTR2:%.*]] = getelementptr inbounds i16, ptr [[TMP1]], i32 1
+; CHECK-NEXT: [[TMP6:%.*]] = load ptr, ptr [[P1]], align 8
+; CHECK-NEXT: [[INCDEC_PTR6:%.*]] = getelementptr inbounds i16, ptr [[TMP6]], i32 1
+; CHECK-NEXT: store ptr [[INCDEC_PTR6]], ptr [[P1]], align 8
+; CHECK-NEXT: [[TMP7:%.*]] = load i16, ptr [[TMP6]], align 2
; CHECK-NEXT: [[CONV7:%.*]] = zext i16 [[TMP7]] to i32
; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[CONV7]], 8
-; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* [[COORD]], align 4
+; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr [[COORD]], align 4
; CHECK-NEXT: [[ADD8:%.*]] = add i32 [[TMP8]], [[SHL]]
-; CHECK-NEXT: store i32 [[ADD8]], i32* [[COORD]], align 4
+; CHECK-NEXT: store i32 [[ADD8]], ptr [[COORD]], align 4
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
; CHECK-NEXT: ret void
@@ -773,46 +773,46 @@ entry:
br i1 %tobool, label %if.then, label %if.else
if.then: ; preds = %entry
- %p = getelementptr inbounds %struct.foo, %struct.foo* %s, i32 0, i32 0
- %0 = load i16*, i16** %p, align 8
- %incdec.ptr = getelementptr inbounds i16, i16* %0, i32 1
- store i16* %incdec.ptr, i16** %p, align 8
- %1 = load i16, i16* %0, align 2
+ %p = getelementptr inbounds %struct.foo, ptr %s, i32 0, i32 0
+ %0 = load ptr, ptr %p, align 8
+ %incdec.ptr = getelementptr inbounds i16, ptr %0, i32 1
+ store ptr %incdec.ptr, ptr %p, align 8
+ %1 = load i16, ptr %0, align 2
%conv = zext i16 %1 to i32
- %2 = load i32, i32* %coord, align 4
+ %2 = load i32, ptr %coord, align 4
%add = add i32 %2, %conv
- store i32 %add, i32* %coord, align 4
+ store i32 %add, ptr %coord, align 4
br label %if.end
if.else: ; preds = %entry
- %p1 = getelementptr inbounds %struct.foo, %struct.foo* %s, i32 0, i32 0
- %3 = load i16*, i16** %p1, align 8
- %incdec.ptr2 = getelementptr inbounds i16, i16* %3, i32 1
- store i16* %incdec.ptr2, i16** %p1, align 8
- %4 = load i16, i16* %3, align 2
+ %p1 = getelementptr inbounds %struct.foo, ptr %s, i32 0, i32 0
+ %3 = load ptr, ptr %p1, align 8
+ %incdec.ptr2 = getelementptr inbounds i16, ptr %3, i32 1
+ store ptr %incdec.ptr2, ptr %p1, align 8
+ %4 = load i16, ptr %3, align 2
%conv3 = zext i16 %4 to i32
- %5 = load i32, i32* %coord, align 4
+ %5 = load i32, ptr %coord, align 4
%add4 = add i32 %5, %conv3
- store i32 %add4, i32* %coord, align 4
- %6 = load i16*, i16** %p1, align 8
- %incdec.ptr6 = getelementptr inbounds i16, i16* %6, i32 1
- store i16* %incdec.ptr6, i16** %p1, align 8
- %7 = load i16, i16* %6, align 2
+ store i32 %add4, ptr %coord, align 4
+ %6 = load ptr, ptr %p1, align 8
+ %incdec.ptr6 = getelementptr inbounds i16, ptr %6, i32 1
+ store ptr %incdec.ptr6, ptr %p1, align 8
+ %7 = load i16, ptr %6, align 2
%conv7 = zext i16 %7 to i32
%shl = shl i32 %conv7, 8
- %8 = load i32, i32* %coord, align 4
+ %8 = load i32, ptr %coord, align 4
%add8 = add i32 %8, %shl
- store i32 %add8, i32* %coord, align 4
+ store i32 %add8, ptr %coord, align 4
br label %if.end
if.end: ; preds = %if.else, %if.then
ret void
}
-define i32 @mergeAlignments(i1 %b, i32* %y) {
+define i32 @mergeAlignments(i1 %b, ptr %y) {
; CHECK-LABEL: @mergeAlignments(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[L1:%.*]] = load i32, i32* [[Y:%.*]], align 1
+; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[Y:%.*]], align 1
; CHECK-NEXT: br i1 [[B:%.*]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: br label [[RETURN:%.*]]
@@ -826,11 +826,11 @@ entry:
br i1 %b, label %if.then, label %if.end
if.then: ; preds = %entry
- %l1 = load i32, i32* %y, align 4
+ %l1 = load i32, ptr %y, align 4
br label %return
if.end: ; preds = %entry
- %l2 = load i32, i32* %y, align 1
+ %l2 = load i32, ptr %y, align 1
br label %return
return: ; preds = %if.end, %if.then
@@ -840,20 +840,20 @@ return: ; preds = %if.end, %if.then
declare i8 @pr30991_f() nounwind readonly
declare void @pr30991_f1(i8)
-define i8 @pr30991(i8* %sp, i8* %word, i1 %b1, i1 %b2) {
+define i8 @pr30991(ptr %sp, ptr %word, i1 %b1, i1 %b2) {
; CHECK-LABEL: @pr30991(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[R0:%.*]] = load i8, i8* [[WORD:%.*]], align 1
+; CHECK-NEXT: [[R0:%.*]] = load i8, ptr [[WORD:%.*]], align 1
; CHECK-NEXT: br i1 [[B1:%.*]], label [[A:%.*]], label [[B:%.*]]
; CHECK: a:
-; CHECK-NEXT: [[INCDEC_PTR:%.*]] = getelementptr i8, i8* [[SP:%.*]], i32 1
+; CHECK-NEXT: [[INCDEC_PTR:%.*]] = getelementptr i8, ptr [[SP:%.*]], i32 1
; CHECK-NEXT: [[RR0:%.*]] = call i8 @pr30991_f() #[[ATTR0:[0-9]+]]
; CHECK-NEXT: call void @pr30991_f1(i8 [[R0]])
; CHECK-NEXT: ret i8 [[RR0]]
; CHECK: b:
; CHECK-NEXT: br i1 [[B2:%.*]], label [[C:%.*]], label [[X:%.*]]
; CHECK: c:
-; CHECK-NEXT: [[INCDEC_PTR115:%.*]] = getelementptr i8, i8* [[SP]], i32 1
+; CHECK-NEXT: [[INCDEC_PTR115:%.*]] = getelementptr i8, ptr [[SP]], i32 1
; CHECK-NEXT: [[RR1:%.*]] = call i8 @pr30991_f() #[[ATTR0]]
; CHECK-NEXT: call void @pr30991_f1(i8 [[R0]])
; CHECK-NEXT: ret i8 [[RR1]]
@@ -864,8 +864,8 @@ entry:
br i1 %b1, label %a, label %b
a:
- %r0 = load i8, i8* %word, align 1
- %incdec.ptr = getelementptr i8, i8* %sp, i32 1
+ %r0 = load i8, ptr %word, align 1
+ %incdec.ptr = getelementptr i8, ptr %sp, i32 1
%rr0 = call i8 @pr30991_f() nounwind readonly
call void @pr30991_f1(i8 %r0)
ret i8 %rr0
@@ -874,13 +874,13 @@ b:
br i1 %b2, label %c, label %x
c:
- %r1 = load i8, i8* %word, align 1
- %incdec.ptr115 = getelementptr i8, i8* %sp, i32 1
+ %r1 = load i8, ptr %word, align 1
+ %incdec.ptr115 = getelementptr i8, ptr %sp, i32 1
%rr1 = call i8 @pr30991_f() nounwind readonly
call void @pr30991_f1(i8 %r1)
ret i8 %rr1
x:
- %r2 = load i8, i8* %word, align 1
+ %r2 = load i8, ptr %word, align 1
ret i8 %r2
}
More information about the llvm-commits
mailing list