[llvm] 83d5052 - JumpThreading: Convert tests to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 08:19:33 PST 2022
Author: Matt Arsenault
Date: 2022-11-27T11:19:28-05:00
New Revision: 83d5052768b6460c14346dd663d7cabaec1b0c22
URL: https://github.com/llvm/llvm-project/commit/83d5052768b6460c14346dd663d7cabaec1b0c22
DIFF: https://github.com/llvm/llvm-project/commit/83d5052768b6460c14346dd663d7cabaec1b0c22.diff
LOG: JumpThreading: Convert tests to opaque pointers
phi-known.ll:test2 required deleting one manual check for a bitcast
Also strip trailing whitespace while we're touching everything.
Added:
Modified:
llvm/test/Transforms/JumpThreading/2010-08-26-and.ll
llvm/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll
llvm/test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll
llvm/test/Transforms/JumpThreading/PR33357-lvi-recursion.ll
llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll
llvm/test/Transforms/JumpThreading/assume-edge-dom.ll
llvm/test/Transforms/JumpThreading/assume.ll
llvm/test/Transforms/JumpThreading/callbr-edge-split.ll
llvm/test/Transforms/JumpThreading/codesize-loop.ll
llvm/test/Transforms/JumpThreading/combine-metadata.ll
llvm/test/Transforms/JumpThreading/constant-fold-status.ll
llvm/test/Transforms/JumpThreading/crash.ll
llvm/test/Transforms/JumpThreading/ddt-crash.ll
llvm/test/Transforms/JumpThreading/ddt-crash2.ll
llvm/test/Transforms/JumpThreading/ddt-crash3.ll
llvm/test/Transforms/JumpThreading/ddt-crash4.ll
llvm/test/Transforms/JumpThreading/domtree-updates.ll
llvm/test/Transforms/JumpThreading/fold-not-thread.ll
llvm/test/Transforms/JumpThreading/free_instructions.ll
llvm/test/Transforms/JumpThreading/guards.ll
llvm/test/Transforms/JumpThreading/implied-cond.ll
llvm/test/Transforms/JumpThreading/indirectbr-cast-int-op.ll
llvm/test/Transforms/JumpThreading/indirectbr-in-predpred.ll
llvm/test/Transforms/JumpThreading/indirectbr.ll
llvm/test/Transforms/JumpThreading/landing-pad.ll
llvm/test/Transforms/JumpThreading/lvi-load.ll
llvm/test/Transforms/JumpThreading/no-irreducible-loops.ll
llvm/test/Transforms/JumpThreading/noalias-scope-decl.ll
llvm/test/Transforms/JumpThreading/nonnull-gep-out-of-bounds.ll
llvm/test/Transforms/JumpThreading/or-undef.ll
llvm/test/Transforms/JumpThreading/phi-eq.ll
llvm/test/Transforms/JumpThreading/phi-known.ll
llvm/test/Transforms/JumpThreading/pr27840.ll
llvm/test/Transforms/JumpThreading/pr33605.ll
llvm/test/Transforms/JumpThreading/pr33917.ll
llvm/test/Transforms/JumpThreading/pr36133.ll
llvm/test/Transforms/JumpThreading/pr40992-indirectbr-folding.ll
llvm/test/Transforms/JumpThreading/pr43276.ll
llvm/test/Transforms/JumpThreading/pre-load.ll
llvm/test/Transforms/JumpThreading/select.ll
llvm/test/Transforms/JumpThreading/stale-loop-info-after-unfold-select.ll
llvm/test/Transforms/JumpThreading/static-profile.ll
llvm/test/Transforms/JumpThreading/thread-cmp.ll
llvm/test/Transforms/JumpThreading/thread-loads.ll
llvm/test/Transforms/JumpThreading/thread-two-bbs-msvc.ll
llvm/test/Transforms/JumpThreading/thread-two-bbs-threshold.ll
llvm/test/Transforms/JumpThreading/thread-two-bbs.ll
llvm/test/Transforms/JumpThreading/threading_prof1.ll
llvm/test/Transforms/JumpThreading/threading_prof2.ll
llvm/test/Transforms/JumpThreading/unreachable-loops.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/JumpThreading/2010-08-26-and.ll b/llvm/test/Transforms/JumpThreading/2010-08-26-and.ll
index cc56ac9cc84c7..bde993a4d3de6 100644
--- a/llvm/test/Transforms/JumpThreading/2010-08-26-and.ll
+++ b/llvm/test/Transforms/JumpThreading/2010-08-26-and.ll
@@ -3,18 +3,18 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-darwin10.0.0"
-%class.StringSwitch = type { i8*, i32, i32, i8 }
-
- at .str = private constant [4 x i8] c"red\00" ; <[4 x i8]*> [#uses=1]
- at .str1 = private constant [7 x i8] c"orange\00" ; <[7 x i8]*> [#uses=1]
- at .str2 = private constant [7 x i8] c"yellow\00" ; <[7 x i8]*> [#uses=1]
- at .str3 = private constant [6 x i8] c"green\00" ; <[6 x i8]*> [#uses=1]
- at .str4 = private constant [5 x i8] c"blue\00" ; <[5 x i8]*> [#uses=1]
- at .str5 = private constant [7 x i8] c"indigo\00" ; <[7 x i8]*> [#uses=1]
- at .str6 = private constant [7 x i8] c"violet\00" ; <[7 x i8]*> [#uses=1]
- at .str7 = private constant [12 x i8] c"Color = %d\0A\00" ; <[12 x i8]*> [#uses=1]
-
-define i32 @main(i32 %argc, i8** nocapture %argv) nounwind ssp {
+%class.StringSwitch = type { ptr, i32, i32, i8 }
+
+ at .str = private constant [4 x i8] c"red\00" ; <ptr> [#uses=1]
+ at .str1 = private constant [7 x i8] c"orange\00" ; <ptr> [#uses=1]
+ at .str2 = private constant [7 x i8] c"yellow\00" ; <ptr> [#uses=1]
+ at .str3 = private constant [6 x i8] c"green\00" ; <ptr> [#uses=1]
+ at .str4 = private constant [5 x i8] c"blue\00" ; <ptr> [#uses=1]
+ at .str5 = private constant [7 x i8] c"indigo\00" ; <ptr> [#uses=1]
+ at .str6 = private constant [7 x i8] c"violet\00" ; <ptr> [#uses=1]
+ at .str7 = private constant [12 x i8] c"Color = %d\0A\00" ; <ptr> [#uses=1]
+
+define i32 @main(i32 %argc, ptr nocapture %argv) nounwind ssp {
entry:
%cmp142 = icmp sgt i32 %argc, 1 ; <i1> [#uses=1]
br i1 %cmp142, label %bb.nph, label %for.end
@@ -29,9 +29,9 @@ land.lhs.true.i: ; preds = %_ZN12StringSwitchI5
%retval.0.i.pre161 = phi i32 [ undef, %bb.nph ], [ %retval.0.i.pre, %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134 ] ; <i32> [#uses=3]
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp146, %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134 ] ; <i64> [#uses=1]
%tmp146 = add i64 %indvar, 1 ; <i64> [#uses=3]
- %arrayidx = getelementptr i8*, i8** %argv, i64 %tmp146 ; <i8**> [#uses=1]
- %tmp6 = load i8*, i8** %arrayidx, align 8 ; <i8*> [#uses=8]
- %call.i.i = call i64 @strlen(i8* %tmp6) nounwind ; <i64> [#uses=1]
+ %arrayidx = getelementptr ptr, ptr %argv, i64 %tmp146 ; <ptr> [#uses=1]
+ %tmp6 = load ptr, ptr %arrayidx, align 8 ; <ptr> [#uses=8]
+ %call.i.i = call i64 @strlen(ptr %tmp6) nounwind ; <i64> [#uses=1]
%conv.i.i = trunc i64 %call.i.i to i32 ; <i32> [#uses=6]\
; CHECK: switch i32 %conv.i.i
; CHECK-NOT: if.then.i40
@@ -42,7 +42,7 @@ land.lhs.true.i: ; preds = %_ZN12StringSwitchI5
]
land.lhs.true5.i: ; preds = %land.lhs.true.i
- %call.i = call i32 @memcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %tmp6, i64 4) nounwind ; <i32> [#uses=1]
+ %call.i = call i32 @memcmp(ptr @.str, ptr %tmp6, i64 4) nounwind ; <i32> [#uses=1]
%cmp9.i = icmp eq i32 %call.i, 0 ; <i1> [#uses=1]
br i1 %cmp9.i, label %_ZN12StringSwitchI5ColorE4CaseILj4EEERS1_RAT__KcRKS0_.exit, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit
@@ -50,7 +50,7 @@ _ZN12StringSwitchI5ColorE4CaseILj4EEERS1_RAT__KcRKS0_.exit: ; preds = %land.lhs.
br label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit
land.lhs.true5.i37: ; preds = %land.lhs.true.i
- %call.i35 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str1, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1]
+ %call.i35 = call i32 @memcmp(ptr @.str1, ptr %tmp6, i64 7) nounwind ; <i32> [#uses=1]
%cmp9.i36 = icmp eq i32 %call.i35, 0 ; <i1> [#uses=1]
br i1 %cmp9.i36, label %if.then.i40, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit
@@ -66,7 +66,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit: ; preds = %if.then.i
br i1 %or.cond, label %land.lhs.true5.i55, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit60
land.lhs.true5.i55: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit
- %call.i53 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str2, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1]
+ %call.i53 = call i32 @memcmp(ptr @.str2, ptr %tmp6, i64 7) nounwind ; <i32> [#uses=1]
%cmp9.i54 = icmp eq i32 %call.i53, 0 ; <i1> [#uses=1]
br i1 %cmp9.i54, label %if.then.i58, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit60
@@ -83,7 +83,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit60: ; preds = %if.then
br i1 %or.cond168, label %land.lhs.true5.i74, label %_ZN12StringSwitchI5ColorE4CaseILj6EEERS1_RAT__KcRKS0_.exit
land.lhs.true5.i74: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit60
- %call.i72 = call i32 @memcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i8* %tmp6, i64 6) nounwind ; <i32> [#uses=1]
+ %call.i72 = call i32 @memcmp(ptr @.str3, ptr %tmp6, i64 6) nounwind ; <i32> [#uses=1]
%cmp9.i73 = icmp eq i32 %call.i72, 0 ; <i1> [#uses=1]
br i1 %cmp9.i73, label %if.then.i77, label %_ZN12StringSwitchI5ColorE4CaseILj6EEERS1_RAT__KcRKS0_.exit
@@ -100,7 +100,7 @@ _ZN12StringSwitchI5ColorE4CaseILj6EEERS1_RAT__KcRKS0_.exit: ; preds = %if.then.i
br i1 %or.cond169, label %land.lhs.true5.i92, label %_ZN12StringSwitchI5ColorE4CaseILj5EEERS1_RAT__KcRKS0_.exit
land.lhs.true5.i92: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj6EEERS1_RAT__KcRKS0_.exit
- %call.i90 = call i32 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str4, i64 0, i64 0), i8* %tmp6, i64 5) nounwind ; <i32> [#uses=1]
+ %call.i90 = call i32 @memcmp(ptr @.str4, ptr %tmp6, i64 5) nounwind ; <i32> [#uses=1]
%cmp9.i91 = icmp eq i32 %call.i90, 0 ; <i1> [#uses=1]
br i1 %cmp9.i91, label %if.then.i95, label %_ZN12StringSwitchI5ColorE4CaseILj5EEERS1_RAT__KcRKS0_.exit
@@ -117,7 +117,7 @@ _ZN12StringSwitchI5ColorE4CaseILj5EEERS1_RAT__KcRKS0_.exit: ; preds = %if.then.i
br i1 %or.cond170, label %land.lhs.true5.i110, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit115
land.lhs.true5.i110: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj5EEERS1_RAT__KcRKS0_.exit
- %call.i108 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str5, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1]
+ %call.i108 = call i32 @memcmp(ptr @.str5, ptr %tmp6, i64 7) nounwind ; <i32> [#uses=1]
%cmp9.i109 = icmp eq i32 %call.i108, 0 ; <i1> [#uses=1]
br i1 %cmp9.i109, label %if.then.i113, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit115
@@ -134,7 +134,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit115: ; preds = %if.the
br i1 %or.cond171, label %land.lhs.true5.i129, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134
land.lhs.true5.i129: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit115
- %call.i127 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str6, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1]
+ %call.i127 = call i32 @memcmp(ptr @.str6, ptr %tmp6, i64 7) nounwind ; <i32> [#uses=1]
%cmp9.i128 = icmp eq i32 %call.i127, 0 ; <i1> [#uses=1]
br i1 %cmp9.i128, label %if.then.i132, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134
@@ -147,7 +147,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134: ; preds = %if.the
%tmp7.i138 = and i8 %tmp2.i137, 1 ; <i8> [#uses=1]
%tobool.i139 = icmp eq i8 %tmp7.i138, 0 ; <i1> [#uses=1]
%retval.0.i = select i1 %tobool.i139, i32 0, i32 %retval.0.i.pre ; <i32> [#uses=1]
- %call22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str7, i64 0, i64 0), i32 %retval.0.i) ; <i32> [#uses=0]
+ %call22 = call i32 (ptr, ...) @printf(ptr @.str7, i32 %retval.0.i) ; <i32> [#uses=0]
%exitcond = icmp eq i64 %tmp146, %tmp145 ; <i1> [#uses=1]
br i1 %exitcond, label %for.end, label %land.lhs.true.i
@@ -155,8 +155,8 @@ for.end: ; preds = %_ZN12StringSwitchI5
ret i32 0
}
-declare i32 @printf(i8* nocapture, ...) nounwind
+declare i32 @printf(ptr nocapture, ...) nounwind
-declare i32 @memcmp(i8* nocapture, i8* nocapture, i64) nounwind readonly
+declare i32 @memcmp(ptr nocapture, ptr nocapture, i64) nounwind readonly
-declare i64 @strlen(i8* nocapture) nounwind readonly
+declare i64 @strlen(ptr nocapture) nounwind readonly
diff --git a/llvm/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll b/llvm/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll
index 0323723a3a858..d905244ddd5cf 100644
--- a/llvm/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll
+++ b/llvm/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll
@@ -15,7 +15,7 @@ for.cond1177:
br i1 %cmp1179, label %for.cond1177, label %land.rhs1320
land.rhs1320:
- %tmp1324 = load volatile i64, i64* getelementptr inbounds (%0, %0* @g_338, i64 0, i32 2), align 1
+ %tmp1324 = load volatile i64, ptr getelementptr inbounds (%0, ptr @g_338, i64 0, i32 2), align 1
br label %if.end.i
if.end.i:
diff --git a/llvm/test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll b/llvm/test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll
index 1c2c0c75e36f4..a8b89fe96a257 100644
--- a/llvm/test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll
+++ b/llvm/test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll
@@ -4,5 +4,5 @@
define i32 @f() nounwind {
entry:
- indirectbr i8* undef, []
+ indirectbr ptr undef, []
}
diff --git a/llvm/test/Transforms/JumpThreading/PR33357-lvi-recursion.ll b/llvm/test/Transforms/JumpThreading/PR33357-lvi-recursion.ll
index e328f32c9c3b7..a2a006ac8f3bf 100644
--- a/llvm/test/Transforms/JumpThreading/PR33357-lvi-recursion.ll
+++ b/llvm/test/Transforms/JumpThreading/PR33357-lvi-recursion.ll
@@ -23,7 +23,7 @@ bb2:
br i1 %2, label %bb3, label %bb4
bb3:
- store i16 undef, i16* @a, align 1
+ store i16 undef, ptr @a, align 1
br label %bb4
bb4:
diff --git a/llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll b/llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll
index 5bcd0018de6f4..163f790a90c25 100644
--- a/llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll
+++ b/llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll
@@ -2,7 +2,7 @@
; RUN: opt -jump-threading -aa-pipeline basic-aa -S -disable-output %s
; RUN: opt -passes=jump-threading -aa-pipeline basic-aa -S -disable-output %s
-define void @foo(i8** %arg1, i32* %arg2) {
+define void @foo(ptr %arg1, ptr %arg2) {
bb:
br label %bb1
@@ -21,19 +21,19 @@ bb13:
br label %bb14
bb14:
- %tmp15 = phi i32* [ %tmp21, %bb20 ], [ %arg2, %bb13 ]
- %tmp16 = phi i8** [ %tmp22, %bb20 ], [ %arg1, %bb13 ]
- store atomic i32 0, i32* %tmp15 unordered, align 4
- %tmp17 = load atomic i8*, i8** %tmp16 unordered, align 8
- %tmp18 = icmp eq i8* %tmp17, null
+ %tmp15 = phi ptr [ %tmp21, %bb20 ], [ %arg2, %bb13 ]
+ %tmp16 = phi ptr [ %tmp22, %bb20 ], [ %arg1, %bb13 ]
+ store atomic i32 0, ptr %tmp15 unordered, align 4
+ %tmp17 = load atomic ptr, ptr %tmp16 unordered, align 8
+ %tmp18 = icmp eq ptr %tmp17, null
br i1 %tmp18, label %bb25, label %bb19
bb19:
ret void
bb20:
- %tmp21 = phi i32* [ %arg2, %bb9 ]
- %tmp22 = phi i8** [ %arg1, %bb9 ]
+ %tmp21 = phi ptr [ %arg2, %bb9 ]
+ %tmp22 = phi ptr [ %arg1, %bb9 ]
br label %bb14
bb24:
diff --git a/llvm/test/Transforms/JumpThreading/assume-edge-dom.ll b/llvm/test/Transforms/JumpThreading/assume-edge-dom.ll
index f1d0f41e25053..902bf0aa8f041 100644
--- a/llvm/test/Transforms/JumpThreading/assume-edge-dom.ll
+++ b/llvm/test/Transforms/JumpThreading/assume-edge-dom.ll
@@ -1,6 +1,6 @@
; RUN: opt -S -jump-threading < %s | FileCheck %s
-declare i8* @escape()
+declare ptr @escape()
declare void @llvm.assume(i1)
define i1 @test1(i1 %cond) {
@@ -12,13 +12,13 @@ entry:
; CHECK: ret i1 true
taken:
- %res1 = call i8* @escape()
- %a = icmp eq i8* %res1, null
+ %res1 = call ptr @escape()
+ %a = icmp eq ptr %res1, null
tail call void @llvm.assume(i1 %a)
br label %done
not_taken:
- %res2 = call i8* @escape()
- %b = icmp ne i8* %res2, null
+ %res2 = call ptr @escape()
+ %b = icmp ne ptr %res2, null
tail call void @llvm.assume(i1 %b)
br label %done
@@ -27,8 +27,8 @@ not_taken:
; this still can be simplified.
done:
- %res = phi i8* [ %res1, %taken ], [ %res2, %not_taken ]
- %cnd = icmp ne i8* %res, null
+ %res = phi ptr [ %res1, %taken ], [ %res2, %not_taken ]
+ %cnd = icmp ne ptr %res, null
br i1 %cnd, label %yes, label %no
yes:
diff --git a/llvm/test/Transforms/JumpThreading/assume.ll b/llvm/test/Transforms/JumpThreading/assume.ll
index 08775b01d7509..77e8658b93a89 100644
--- a/llvm/test/Transforms/JumpThreading/assume.ll
+++ b/llvm/test/Transforms/JumpThreading/assume.ll
@@ -60,12 +60,12 @@ return: ; preds = %entry, %if.then
; Check that we do prove a fact using an assume within the block.
; We can fold the assume based on the semantics of assume.
-define void @can_fold_assume(i32* %array) {
+define void @can_fold_assume(ptr %array) {
; CHECK-LABEL: @can_fold_assume
; CHECK-NOT: call void @llvm.assume
; CHECK-NOT: br
; CHECK: ret void
- %notnull = icmp ne i32* %array, null
+ %notnull = icmp ne ptr %array, null
call void @llvm.assume(i1 %notnull)
br i1 %notnull, label %normal, label %error
@@ -73,20 +73,20 @@ normal:
ret void
error:
- store atomic i32 0, i32* @g unordered, align 4
+ store atomic i32 0, ptr @g unordered, align 4
ret void
}
declare void @f(i1)
declare void @exit()
; We can fold the assume but not the uses before the assume.
-define void @cannot_fold_use_before_assume(i32* %array) {
+define void @cannot_fold_use_before_assume(ptr %array) {
; CHECK-LABEL:@cannot_fold_use_before_assume
; CHECK: @f(i1 %notnull)
; CHECK-NEXT: exit()
; CHECK-NOT: assume
; CHECK-NEXT: ret void
- %notnull = icmp ne i32* %array, null
+ %notnull = icmp ne ptr %array, null
call void @f(i1 %notnull)
call void @exit()
call void @llvm.assume(i1 %notnull)
@@ -96,19 +96,19 @@ normal:
ret void
error:
- store atomic i32 0, i32* @g unordered, align 4
+ store atomic i32 0, ptr @g unordered, align 4
ret void
}
declare void @dummy(i1) nounwind willreturn
-define void @can_fold_some_use_before_assume(i32* %array) {
+define void @can_fold_some_use_before_assume(ptr %array) {
; CHECK-LABEL:@can_fold_some_use_before_assume
; CHECK: @f(i1 %notnull)
; CHECK-NEXT: @dummy(i1 true)
; CHECK-NOT: assume
; CHECK-NEXT: ret void
- %notnull = icmp ne i32* %array, null
+ %notnull = icmp ne ptr %array, null
call void @f(i1 %notnull)
call void @dummy(i1 %notnull)
call void @llvm.assume(i1 %notnull)
@@ -118,14 +118,14 @@ normal:
ret void
error:
- store atomic i32 0, i32* @g unordered, align 4
+ store atomic i32 0, ptr @g unordered, align 4
ret void
}
; FIXME: can fold assume and all uses before/after assume.
; because the trapping exit call is after the assume.
-define void @can_fold_assume_and_all_uses(i32* %array) {
+define void @can_fold_assume_and_all_uses(ptr %array) {
; CHECK-LABEL:@can_fold_assume_and_all_uses
; CHECK: @dummy(i1 %notnull)
; CHECK-NEXT: assume(i1 %notnull)
@@ -133,7 +133,7 @@ define void @can_fold_assume_and_all_uses(i32* %array) {
; CHECK-NEXT: %notnull2 = or i1 true, false
; CHECK-NEXT: @f(i1 %notnull2)
; CHECK-NEXT: ret void
- %notnull = icmp ne i32* %array, null
+ %notnull = icmp ne ptr %array, null
call void @dummy(i1 %notnull)
call void @llvm.assume(i1 %notnull)
call void @exit()
@@ -145,14 +145,14 @@ normal:
ret void
error:
- store atomic i32 0, i32* @g unordered, align 4
+ store atomic i32 0, ptr @g unordered, align 4
ret void
}
declare void @fz(i8)
; FIXME: We can fold assume to true, and the use after assume, but we do not do so
; currently, because of the function call after the assume.
-define void @can_fold_assume2(i32* %array) {
+define void @can_fold_assume2(ptr %array) {
; CHECK-LABEL:@can_fold_assume2
; CHECK: @f(i1 %notnull)
@@ -162,7 +162,7 @@ define void @can_fold_assume2(i32* %array) {
; CHECK-NEXT: @f(i1 true)
; CHECK-NEXT: @fz(i8 %znotnull)
; CHECK-NEXT: ret void
- %notnull = icmp ne i32* %array, null
+ %notnull = icmp ne ptr %array, null
call void @f(i1 %notnull)
call void @llvm.assume(i1 %notnull)
%znotnull = zext i1 %notnull to i8
@@ -175,14 +175,14 @@ normal:
ret void
error:
- store atomic i32 0, i32* @g unordered, align 4
+ store atomic i32 0, ptr @g unordered, align 4
ret void
}
declare void @llvm.experimental.guard(i1, ...)
; FIXME: We can fold assume to true, but we do not do so
; because of the guard following the assume.
-define void @can_fold_assume3(i32* %array){
+define void @can_fold_assume3(ptr %array){
; CHECK-LABEL:@can_fold_assume3
; CHECK: @f(i1 %notnull)
@@ -192,7 +192,7 @@ define void @can_fold_assume3(i32* %array){
; CHECK-NEXT: @f(i1 true)
; CHECK-NEXT: @fz(i8 %znotnull)
; CHECK-NEXT: ret void
- %notnull = icmp ne i32* %array, null
+ %notnull = icmp ne ptr %array, null
call void @f(i1 %notnull)
call void @llvm.assume(i1 %notnull)
call void(i1, ...) @llvm.experimental.guard(i1 %notnull) [ "deopt"() ]
@@ -205,18 +205,18 @@ normal:
ret void
error:
- store atomic i32 0, i32* @g unordered, align 4
+ store atomic i32 0, ptr @g unordered, align 4
ret void
}
; can fold all uses and remove the cond
-define void @can_fold_assume4(i32* %array) {
+define void @can_fold_assume4(ptr %array) {
; CHECK-LABEL: can_fold_assume4
; CHECK-NOT: notnull
; CHECK: dummy(i1 true)
; CHECK-NEXT: ret void
- %notnull = icmp ne i32* %array, null
+ %notnull = icmp ne ptr %array, null
call void @exit()
call void @dummy(i1 %notnull)
call void @llvm.assume(i1 %notnull)
@@ -226,7 +226,7 @@ normal:
ret void
error:
- store atomic i32 0, i32* @g unordered, align 4
+ store atomic i32 0, ptr @g unordered, align 4
ret void
}
; Function Attrs: nounwind
diff --git a/llvm/test/Transforms/JumpThreading/callbr-edge-split.ll b/llvm/test/Transforms/JumpThreading/callbr-edge-split.ll
index d96f5cff63dc4..9b9dedbc88df9 100644
--- a/llvm/test/Transforms/JumpThreading/callbr-edge-split.ll
+++ b/llvm/test/Transforms/JumpThreading/callbr-edge-split.ll
@@ -8,7 +8,7 @@
define i32 @c() {
; CHECK-LABEL: @c(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0
; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_END:%.*]]
; CHECK: if.else:
@@ -25,7 +25,7 @@ define i32 @c() {
; CHECK-NEXT: ret i32 undef
;
entry:
- %0 = load i32, i32* @a
+ %0 = load i32, ptr @a
%tobool = icmp eq i32 %0, 0
br i1 %tobool, label %if.else, label %if.then
diff --git a/llvm/test/Transforms/JumpThreading/codesize-loop.ll b/llvm/test/Transforms/JumpThreading/codesize-loop.ll
index 3556debfed858..5818ad8d51e05 100644
--- a/llvm/test/Transforms/JumpThreading/codesize-loop.ll
+++ b/llvm/test/Transforms/JumpThreading/codesize-loop.ll
@@ -3,15 +3,15 @@
; RUN: opt -jump-threading -S -jump-threading-threshold=6 %s -o - | FileCheck %s --check-prefix=OVERIDE
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
-define i32 @test_minsize(i32 %argc, i8** nocapture readonly %argv) local_unnamed_addr #0 {
+define i32 @test_minsize(i32 %argc, ptr nocapture readonly %argv) local_unnamed_addr #0 {
; DEFAULT-LABEL: @test_minsize(
; DEFAULT-NEXT: entry:
; DEFAULT-NEXT: [[CMP:%.*]] = icmp eq i32 [[ARGC:%.*]], 2
; DEFAULT-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_END:%.*]]
; DEFAULT: cond.true:
-; DEFAULT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[ARGV:%.*]], i32 1
-; DEFAULT-NEXT: [[TMP0:%.*]] = load i8*, i8** [[ARRAYIDX]], align 4
-; DEFAULT-NEXT: [[CALL:%.*]] = tail call i32 @atoi(i8* [[TMP0]])
+; DEFAULT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[ARGV:%.*]], i32 1
+; DEFAULT-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARRAYIDX]], align 4
+; DEFAULT-NEXT: [[CALL:%.*]] = tail call i32 @atoi(ptr [[TMP0]])
; DEFAULT-NEXT: br label [[COND_END]]
; DEFAULT: cond.end:
; DEFAULT-NEXT: [[COND:%.*]] = phi i32 [ [[CALL]], [[COND_TRUE]] ], [ 46, [[ENTRY:%.*]] ]
@@ -26,7 +26,7 @@ define i32 @test_minsize(i32 %argc, i8** nocapture readonly %argv) local_unnamed
; DEFAULT: 6:
; DEFAULT-NEXT: [[TMP7:%.*]] = phi i32 [ [[COND]], [[TMP5]] ], [ 0, [[COND_END]] ]
; DEFAULT-NEXT: [[TMP8:%.*]] = mul i32 [[TMP3]], [[TMP7]]
-; DEFAULT-NEXT: [[CALL33:%.*]] = tail call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 [[TMP8]])
+; DEFAULT-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP8]])
; DEFAULT-NEXT: ret i32 0
;
; OVERIDE-LABEL: @test_minsize(
@@ -34,9 +34,9 @@ define i32 @test_minsize(i32 %argc, i8** nocapture readonly %argv) local_unnamed
; OVERIDE-NEXT: [[CMP:%.*]] = icmp eq i32 [[ARGC:%.*]], 2
; OVERIDE-NEXT: br i1 [[CMP]], label [[COND_END:%.*]], label [[COND_END_THREAD:%.*]]
; OVERIDE: cond.end:
-; OVERIDE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[ARGV:%.*]], i32 1
-; OVERIDE-NEXT: [[TMP0:%.*]] = load i8*, i8** [[ARRAYIDX]], align 4
-; OVERIDE-NEXT: [[CALL:%.*]] = tail call i32 @atoi(i8* [[TMP0]])
+; OVERIDE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[ARGV:%.*]], i32 1
+; OVERIDE-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARRAYIDX]], align 4
+; OVERIDE-NEXT: [[CALL:%.*]] = tail call i32 @atoi(ptr [[TMP0]])
; OVERIDE-NEXT: [[TMP1:%.*]] = mul i32 [[CALL]], [[CALL]]
; OVERIDE-NEXT: [[TMP2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; OVERIDE-NEXT: [[TMP3:%.*]] = mul i32 [[CALL]], [[TMP2]]
@@ -51,7 +51,7 @@ define i32 @test_minsize(i32 %argc, i8** nocapture readonly %argv) local_unnamed
; OVERIDE-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP5]], [[COND_END_THREAD]] ], [ [[TMP3]], [[COND_END]] ]
; OVERIDE-NEXT: [[TMP8:%.*]] = phi i32 [ [[COND3]], [[COND_END_THREAD]] ], [ 0, [[COND_END]] ]
; OVERIDE-NEXT: [[TMP9:%.*]] = mul i32 [[TMP7]], [[TMP8]]
-; OVERIDE-NEXT: [[CALL33:%.*]] = tail call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 [[TMP9]])
+; OVERIDE-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP9]])
; OVERIDE-NEXT: ret i32 0
;
entry:
@@ -59,9 +59,9 @@ entry:
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
- %arrayidx = getelementptr inbounds i8*, i8** %argv, i32 1
- %0 = load i8*, i8** %arrayidx, align 4
- %call = tail call i32 @atoi(i8* %0)
+ %arrayidx = getelementptr inbounds ptr, ptr %argv, i32 1
+ %0 = load ptr, ptr %arrayidx, align 4
+ %call = tail call i32 @atoi(ptr %0)
br label %cond.end
cond.end: ; preds = %entry, %cond.true
@@ -72,19 +72,19 @@ cond.end: ; preds = %entry, %cond.true
%4 = icmp sgt i32 %cond, 0
%spec.select = select i1 %4, i32 %cond, i32 0
%5 = mul i32 %3, %spec.select
- %call33 = tail call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %5) #4
+ %call33 = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 %5) #4
ret i32 0
}
-define i32 @test_optsize(i32 %argc, i8** nocapture readonly %argv) local_unnamed_addr #1 {
+define i32 @test_optsize(i32 %argc, ptr nocapture readonly %argv) local_unnamed_addr #1 {
; DEFAULT-LABEL: @test_optsize(
; DEFAULT-NEXT: entry:
; DEFAULT-NEXT: [[CMP:%.*]] = icmp eq i32 [[ARGC:%.*]], 2
; DEFAULT-NEXT: br i1 [[CMP]], label [[COND_END:%.*]], label [[COND_END_THREAD:%.*]]
; DEFAULT: cond.end:
-; DEFAULT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[ARGV:%.*]], i32 1
-; DEFAULT-NEXT: [[TMP0:%.*]] = load i8*, i8** [[ARRAYIDX]], align 4
-; DEFAULT-NEXT: [[CALL:%.*]] = tail call i32 @atoi(i8* [[TMP0]])
+; DEFAULT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[ARGV:%.*]], i32 1
+; DEFAULT-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARRAYIDX]], align 4
+; DEFAULT-NEXT: [[CALL:%.*]] = tail call i32 @atoi(ptr [[TMP0]])
; DEFAULT-NEXT: [[TMP1:%.*]] = mul i32 [[CALL]], [[CALL]]
; DEFAULT-NEXT: [[TMP2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; DEFAULT-NEXT: [[TMP3:%.*]] = mul i32 [[CALL]], [[TMP2]]
@@ -99,7 +99,7 @@ define i32 @test_optsize(i32 %argc, i8** nocapture readonly %argv) local_unnamed
; DEFAULT-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP5]], [[COND_END_THREAD]] ], [ [[TMP3]], [[COND_END]] ]
; DEFAULT-NEXT: [[TMP8:%.*]] = phi i32 [ [[COND3]], [[COND_END_THREAD]] ], [ 0, [[COND_END]] ]
; DEFAULT-NEXT: [[TMP9:%.*]] = mul i32 [[TMP7]], [[TMP8]]
-; DEFAULT-NEXT: [[CALL33:%.*]] = tail call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 [[TMP9]])
+; DEFAULT-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP9]])
; DEFAULT-NEXT: ret i32 0
;
; OVERIDE-LABEL: @test_optsize(
@@ -107,9 +107,9 @@ define i32 @test_optsize(i32 %argc, i8** nocapture readonly %argv) local_unnamed
; OVERIDE-NEXT: [[CMP:%.*]] = icmp eq i32 [[ARGC:%.*]], 2
; OVERIDE-NEXT: br i1 [[CMP]], label [[COND_END:%.*]], label [[COND_END_THREAD:%.*]]
; OVERIDE: cond.end:
-; OVERIDE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[ARGV:%.*]], i32 1
-; OVERIDE-NEXT: [[TMP0:%.*]] = load i8*, i8** [[ARRAYIDX]], align 4
-; OVERIDE-NEXT: [[CALL:%.*]] = tail call i32 @atoi(i8* [[TMP0]])
+; OVERIDE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[ARGV:%.*]], i32 1
+; OVERIDE-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARRAYIDX]], align 4
+; OVERIDE-NEXT: [[CALL:%.*]] = tail call i32 @atoi(ptr [[TMP0]])
; OVERIDE-NEXT: [[TMP1:%.*]] = mul i32 [[CALL]], [[CALL]]
; OVERIDE-NEXT: [[TMP2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; OVERIDE-NEXT: [[TMP3:%.*]] = mul i32 [[CALL]], [[TMP2]]
@@ -124,7 +124,7 @@ define i32 @test_optsize(i32 %argc, i8** nocapture readonly %argv) local_unnamed
; OVERIDE-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP5]], [[COND_END_THREAD]] ], [ [[TMP3]], [[COND_END]] ]
; OVERIDE-NEXT: [[TMP8:%.*]] = phi i32 [ [[COND3]], [[COND_END_THREAD]] ], [ 0, [[COND_END]] ]
; OVERIDE-NEXT: [[TMP9:%.*]] = mul i32 [[TMP7]], [[TMP8]]
-; OVERIDE-NEXT: [[CALL33:%.*]] = tail call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 [[TMP9]])
+; OVERIDE-NEXT: [[CALL33:%.*]] = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 [[TMP9]])
; OVERIDE-NEXT: ret i32 0
;
entry:
@@ -132,9 +132,9 @@ entry:
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
- %arrayidx = getelementptr inbounds i8*, i8** %argv, i32 1
- %0 = load i8*, i8** %arrayidx, align 4
- %call = tail call i32 @atoi(i8* %0)
+ %arrayidx = getelementptr inbounds ptr, ptr %argv, i32 1
+ %0 = load ptr, ptr %arrayidx, align 4
+ %call = tail call i32 @atoi(ptr %0)
br label %cond.end
cond.end: ; preds = %entry, %cond.true
@@ -145,11 +145,11 @@ cond.end: ; preds = %entry, %cond.true
%4 = icmp sgt i32 %cond, 0
%spec.select = select i1 %4, i32 %cond, i32 0
%5 = mul i32 %3, %spec.select
- %call33 = tail call i32 (i8*, ...) @printf(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %5) #4
+ %call33 = tail call i32 (ptr, ...) @printf(ptr nonnull dereferenceable(1) @.str, i32 %5) #4
ret i32 0
}
-declare i32 @atoi(i8* nocapture) local_unnamed_addr
-declare i32 @printf(i8* nocapture readonly, ...) local_unnamed_addr
+declare i32 @atoi(ptr nocapture) local_unnamed_addr
+declare i32 @printf(ptr nocapture readonly, ...) local_unnamed_addr
attributes #0 = { minsize optsize }
attributes #1 = { optsize }
diff --git a/llvm/test/Transforms/JumpThreading/combine-metadata.ll b/llvm/test/Transforms/JumpThreading/combine-metadata.ll
index 4ed6cfecc59aa..2dde9c42c08b8 100644
--- a/llvm/test/Transforms/JumpThreading/combine-metadata.ll
+++ b/llvm/test/Transforms/JumpThreading/combine-metadata.ll
@@ -3,45 +3,45 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin7"
-declare void @use(i32 *)
+declare void @use(ptr)
; Check that we propagate nonnull to dominated loads, when we find an available
; loaded value.
; CHECK-LABEL: @test1(
; CHECK-LABEL: ret1:
-; CHECK-NEXT: %[[p1:.*]] = load i32*, i32** %ptr
+; CHECK-NEXT: %[[p1:.*]] = load ptr, ptr %ptr
; CHECK-NOT: !nonnull
-; CHECK-NEXT: store i32 1, i32* %[[p1]]
-; CHECK-NEXT: tail call void @use(i32* null)
+; CHECK-NEXT: store i32 1, ptr %[[p1]]
+; CHECK-NEXT: tail call void @use(ptr null)
; CHECK-NEXT: ret void
; CHECK-LABEL: ret2:
-; CHECK-NEXT: %[[p2:.*]] = load i32*, i32** %ptr, align 4, !nonnull !0
-; CHECK: tail call void @use(i32* %[[p2]])
+; CHECK-NEXT: %[[p2:.*]] = load ptr, ptr %ptr, align 4, !nonnull !0
+; CHECK: tail call void @use(ptr %[[p2]])
; CHECK-NEXT: ret void
-define void @test1(i32** %ptr, i1 %c) {
+define void @test1(ptr %ptr, i1 %c) {
br i1 %c, label %d1, label %d2
d1:
- %p1 = load i32*, i32** %ptr, !nonnull !0
+ %p1 = load ptr, ptr %ptr, !nonnull !0
br label %d3
d2:
br label %d3
d3:
- %pm = phi i32* [ null, %d2 ], [ %p1, %d1 ]
- %p2 = load i32*, i32** %ptr
- store i32 1, i32* %p2
- %c2 = icmp eq i32* %pm, null
+ %pm = phi ptr [ null, %d2 ], [ %p1, %d1 ]
+ %p2 = load ptr, ptr %ptr
+ store i32 1, ptr %p2
+ %c2 = icmp eq ptr %pm, null
br i1 %c2, label %ret1, label %ret2
ret1:
- tail call void @use(i32* %pm) nounwind
+ tail call void @use(ptr %pm) nounwind
ret void
ret2:
- tail call void @use(i32* %pm) nounwind
+ tail call void @use(ptr %pm) nounwind
ret void
}
@@ -49,38 +49,38 @@ ret2:
; loaded value.
; CHECK-LABEL: @test2(
; CHECK-LABEL: d3.thread:
-; CHECK-NEXT: %[[p1:.*]] = load i32*, i32** %ptr, align 4, !nonnull !0
-; CHECK-NEXT: store i32 1, i32* %[[p1]]
+; CHECK-NEXT: %[[p1:.*]] = load ptr, ptr %ptr, align 4, !nonnull !0
+; CHECK-NEXT: store i32 1, ptr %[[p1]]
; CHECK-NEXT: br label %ret1
; CHECK-LABEL: d3:
-; CHECK-NEXT: %[[p_cmp:.*]] = load i32*, i32** %ptr
-; CHECK-NEXT: %[[p2:.*]] = load i32*, i32** %ptr, align 4, !nonnull !0
-; CHECK-NEXT: store i32 1, i32* %[[p2]]
-; CHECK-NEXT: icmp eq i32* %[[p_cmp]], null
-define void @test2(i32** %ptr, i1 %c) {
+; CHECK-NEXT: %[[p_cmp:.*]] = load ptr, ptr %ptr
+; CHECK-NEXT: %[[p2:.*]] = load ptr, ptr %ptr, align 4, !nonnull !0
+; CHECK-NEXT: store i32 1, ptr %[[p2]]
+; CHECK-NEXT: icmp eq ptr %[[p_cmp]], null
+define void @test2(ptr %ptr, i1 %c) {
br i1 %c, label %d1, label %d2
d1:
- %p1 = load i32*, i32** %ptr
+ %p1 = load ptr, ptr %ptr
br label %d3
d2:
br label %d3
d3:
- %pm = phi i32* [ null, %d2 ], [ %p1, %d1 ]
- %p2 = load i32*, i32** %ptr, !nonnull !0
- store i32 1, i32* %p2
- %c2 = icmp eq i32* %pm, null
+ %pm = phi ptr [ null, %d2 ], [ %p1, %d1 ]
+ %p2 = load ptr, ptr %ptr, !nonnull !0
+ store i32 1, ptr %p2
+ %c2 = icmp eq ptr %pm, null
br i1 %c2, label %ret1, label %ret2
ret1:
- tail call void @use(i32* %pm) nounwind
+ tail call void @use(ptr %pm) nounwind
ret void
ret2:
- tail call void @use(i32* %pm) nounwind
+ tail call void @use(ptr %pm) nounwind
ret void
}
@@ -88,27 +88,27 @@ ret2:
; to a PHI node.
; CHECK-LABEL: @test3(
; CHECK-LABEL: d1:
-; CHECK-NEXT: %[[p1:.*]] = load i32*, i32** %ptr
+; CHECK-NEXT: %[[p1:.*]] = load ptr, ptr %ptr
; CHECK-NOT: !nonnull
; CHECK-LABEL: d2:
-; CHECK-NEXT: %[[p2:.*]] = load i32*, i32** %ptr
+; CHECK-NEXT: %[[p2:.*]] = load ptr, ptr %ptr
; CHECK-NOT: !nonnull
; CHECK-LABEL: d3:
-; CHECK-NEXT: phi i32* [ %[[p2]], %d2 ], [ %[[p1]], %d1 ]
-define void @test3(i32** %ptr) {
+; CHECK-NEXT: phi ptr [ %[[p2]], %d2 ], [ %[[p1]], %d1 ]
+define void @test3(ptr %ptr) {
d1:
- %x = load i32*, i32** %ptr, !nonnull !0
+ %x = load ptr, ptr %ptr, !nonnull !0
br label %d3
d2:
br label %d3
d3:
- %y = load i32*, i32** %ptr
- store i32 1, i32* %y
- %c2 = icmp eq i32* %y, @p
+ %y = load ptr, ptr %ptr
+ store i32 1, ptr %y
+ %c2 = icmp eq ptr %y, @p
br i1 %c2, label %ret1, label %ret2
ret1:
diff --git a/llvm/test/Transforms/JumpThreading/constant-fold-status.ll b/llvm/test/Transforms/JumpThreading/constant-fold-status.ll
index 95cf8bab7a5ed..76a9db53861f9 100644
--- a/llvm/test/Transforms/JumpThreading/constant-fold-status.ll
+++ b/llvm/test/Transforms/JumpThreading/constant-fold-status.ll
@@ -8,13 +8,13 @@
; status check that is hidden under EXPENSIVE_CHECKS.
; CHECK-LABEL: entry:
-; CHECK-NEXT: br i1 icmp eq (i32 ptrtoint (i16* @a to i32), i32 0), label %overflow, label %cont
+; CHECK-NEXT: br i1 icmp eq (i32 ptrtoint (ptr @a to i32), i32 0), label %overflow, label %cont
@a = internal global i16 0
define void @foo(i16 %d) {
entry:
- %.not = icmp eq i16 zext (i1 icmp ne (i32 ptrtoint (i16* @a to i32), i32 0) to i16), 0
+ %.not = icmp eq i16 zext (i1 icmp ne (i32 ptrtoint (ptr @a to i32), i32 0) to i16), 0
br i1 %.not, label %overflow, label %cont
overflow: ; preds = %entry
diff --git a/llvm/test/Transforms/JumpThreading/crash.ll b/llvm/test/Transforms/JumpThreading/crash.ll
index 01bec4b2c2dee..260554ca53b61 100644
--- a/llvm/test/Transforms/JumpThreading/crash.ll
+++ b/llvm/test/Transforms/JumpThreading/crash.ll
@@ -26,32 +26,32 @@ declare %struct.system__secondary_stack__mark_id @system__secondary_stack__ss_ma
-define fastcc void @findratio(double* nocapture %res1, double* nocapture %res2) nounwind ssp {
+define fastcc void @findratio(ptr nocapture %res1, ptr nocapture %res2) nounwind ssp {
entry:
br label %bb12
-bb6.us:
- %tmp = icmp eq i32 undef, undef
- %tmp1 = fsub double undef, undef
- %tmp2 = fcmp ult double %tmp1, 0.000000e+00
+bb6.us:
+ %tmp = icmp eq i32 undef, undef
+ %tmp1 = fsub double undef, undef
+ %tmp2 = fcmp ult double %tmp1, 0.000000e+00
br i1 %tmp, label %bb6.us, label %bb13
-bb12:
- %tmp3 = fcmp ult double undef, 0.000000e+00
+bb12:
+ %tmp3 = fcmp ult double undef, 0.000000e+00
br label %bb13
-bb13:
+bb13:
%.lcssa31 = phi double [ undef, %bb12 ], [ %tmp1, %bb6.us ]
- %.lcssa30 = phi i1 [ %tmp3, %bb12 ], [ %tmp2, %bb6.us ]
+ %.lcssa30 = phi i1 [ %tmp3, %bb12 ], [ %tmp2, %bb6.us ]
br i1 %.lcssa30, label %bb15, label %bb61
-bb15:
- %tmp4 = fsub double -0.000000e+00, %.lcssa31
+bb15:
+ %tmp4 = fsub double -0.000000e+00, %.lcssa31
ret void
-bb61:
+bb61:
ret void
}
@@ -63,14 +63,14 @@ A:
F:
br label %A1
-A1:
+A1:
%d = phi i1 [false, %A], [true, %F]
%e = add i32 %a, %a
br i1 %d, label %B, label %G
-
+
G:
br i1 %cond2, label %B, label %D
-
+
B:
%f = phi i32 [%e, %G], [%e, %A1]
%b = add i32 0, 0
@@ -82,7 +82,7 @@ B:
C:
br label %D
-
+
D:
%c = phi i32 [%e, %B], [%e, %B], [%e, %B], [%f, %C], [%e, %G]
ret i32 %c
@@ -176,19 +176,19 @@ entry:
br i1 %tmp, label %bb12, label %bb13
-bb12:
+bb12:
br label %bb13
-bb13:
+bb13:
%.lcssa31 = phi i32 [ undef, %bb12 ], [ %tmp1, %entry ]
%A = and i1 undef, undef
br i1 %A, label %bb15, label %bb61
-bb15:
+bb15:
ret void
-bb61:
+bb61:
ret void
}
@@ -198,18 +198,18 @@ define fastcc void @test6(i1 %tmp, i1 %tmp1) nounwind ssp {
entry:
br i1 %tmp, label %bb12, label %bb14
-bb12:
+bb12:
br label %bb14
-bb14:
+bb14:
%A = phi i1 [ %A, %bb13 ], [ true, %bb12 ], [%tmp1, %entry]
br label %bb13
-bb13:
+bb13:
br i1 %A, label %bb14, label %bb61
-bb61:
+bb61:
ret void
}
@@ -225,16 +225,16 @@ tailrecurse:
i32 3, label %bb
]
-bb:
+bb:
switch i32 %x, label %return [
i32 2, label %bb2
i32 3, label %tailrecurse
]
-bb2:
+bb2:
ret void
-return:
+return:
ret void
}
@@ -324,7 +324,7 @@ entry:
br label %A
A: ; preds = %entry
- call void undef(i64 ptrtoint (i8* blockaddress(@test11, %A) to i64)) nounwind
+ call void undef(i64 ptrtoint (ptr blockaddress(@test11, %A) to i64)) nounwind
unreachable
}
@@ -347,19 +347,19 @@ if.end12: ; preds = %if.then, %lbl_51
; PR7356
-define i32 @test13(i32* %P, i8* %Ptr) {
+define i32 @test13(ptr %P, ptr %Ptr) {
entry:
- indirectbr i8* %Ptr, [label %BrBlock, label %B2]
-
+ indirectbr ptr %Ptr, [label %BrBlock, label %B2]
+
B2:
- store i32 4, i32 *%P
+ store i32 4, ptr %P
br label %BrBlock
BrBlock:
- %L = load i32, i32* %P
+ %L = load i32, ptr %P
%C = icmp eq i32 %L, 42
br i1 %C, label %T, label %F
-
+
T:
ret i32 123
F:
@@ -394,12 +394,12 @@ if.end: ; preds = %land.end69
define void @test15() nounwind {
entry:
ret void
-
+
if.then237:
br label %lbl_664
lbl_596: ; preds = %lbl_664, %for.end37
- store volatile i64 undef, i64* undef, align 4
+ store volatile i64 undef, ptr undef, align 4
br label %for.cond111
for.cond111: ; preds = %safe_sub_func_int64_t_s_s.exit, %lbl_596
@@ -418,7 +418,7 @@ cond.true.i100: ; preds = %for.inc120
lbl_709:
br label %if.end949
-
+
for.cond603: ; preds = %for.body607, %if.end336
br i1 undef, label %for.cond603, label %if.end949
@@ -448,16 +448,16 @@ land.rhs: ; preds = %entry
lor.lhs.false.i: ; preds = %land.rhs
br i1 %c3, label %land.end, label %land.end
-land.end:
+land.end:
%0 = phi i1 [ true, %entry ], [ false, %land.rhs ], [false, %lor.lhs.false.i], [false, %lor.lhs.false.i] ; <i1> [#uses=1]
- %cmp12 = and i1 %cmp, %0
+ %cmp12 = and i1 %cmp, %0
%xor1 = xor i1 %cmp12, %c4
br i1 %xor1, label %if.then, label %if.end
-if.then:
+if.then:
ret void
-if.end:
+if.end:
ret void
}
@@ -488,9 +488,9 @@ bb288.bb289.loopexit_crit_edge:
; PR 8247
%struct.S1 = type { i8, i8 }
@func_89.l_245 = internal constant %struct.S1 { i8 33, i8 6 }, align 1
-define void @func_89(i16 zeroext %p_90, %struct.S1* nocapture %p_91, i32* nocapture %p_92) nounwind ssp {
+define void @func_89(i16 zeroext %p_90, ptr nocapture %p_91, ptr nocapture %p_92) nounwind ssp {
entry:
- store i32 0, i32* %p_92, align 4
+ store i32 0, ptr %p_92, align 4
br i1 false, label %lbl_260, label %if.else
if.else: ; preds = %entry
@@ -530,8 +530,8 @@ bb:
br label %if.end2
if.end2:
- %B = phi i64 [ ptrtoint (i8* ()* @PR14233.f1 to i64), %bb ], [ %A, %if.end ]
- %cmp.ptr = icmp eq i64 %B, ptrtoint (i8* ()* @PR14233.f2 to i64)
+ %B = phi i64 [ ptrtoint (ptr @PR14233.f1 to i64), %bb ], [ %A, %if.end ]
+ %cmp.ptr = icmp eq i64 %B, ptrtoint (ptr @PR14233.f2 to i64)
br i1 %cmp.ptr, label %cond.true2, label %if.end3
cond.true2:
@@ -544,7 +544,7 @@ if.end4:
unreachable
if.end3:
- %cmp.ptr2 = icmp eq i64 %B, ptrtoint (i8* ()* @PR14233.f2 to i64)
+ %cmp.ptr2 = icmp eq i64 %B, ptrtoint (ptr @PR14233.f2 to i64)
br i1 %cmp.ptr2, label %ur, label %if.then601
if.then601:
@@ -561,9 +561,9 @@ ur:
unreachable
}
-declare i8* @PR14233.f1()
+declare ptr @PR14233.f1()
-declare i8* @PR14233.f2()
+declare ptr @PR14233.f2()
; Make sure the following compiles in a sane amount of time, as opposed
; to taking exponential time.
diff --git a/llvm/test/Transforms/JumpThreading/ddt-crash.ll b/llvm/test/Transforms/JumpThreading/ddt-crash.ll
index a5cf24d354c43..4cc1363c6beb8 100644
--- a/llvm/test/Transforms/JumpThreading/ddt-crash.ll
+++ b/llvm/test/Transforms/JumpThreading/ddt-crash.ll
@@ -1,18 +1,18 @@
; RUN: opt < %s -jump-threading -disable-output
%struct.ham = type { i8, i8, i16, i32 }
-%struct.zot = type { i32 (...)** }
+%struct.zot = type { ptr }
%struct.quux.0 = type { %struct.wombat }
%struct.wombat = type { %struct.zot }
- at global = external global %struct.ham*, align 8
- at global.1 = external constant i8*
+ at global = external global ptr, align 8
+ at global.1 = external constant ptr
declare i32 @wombat.2()
define void @blam() {
bb:
- %tmp = load i32, i32* undef
+ %tmp = load i32, ptr undef
%tmp1 = icmp eq i32 %tmp, 0
br i1 %tmp1, label %bb11, label %bb2
@@ -44,9 +44,9 @@ bb11:
ret void
}
-define void @spam(%struct.ham* %arg) {
+define void @spam(ptr %arg) {
bb:
- %tmp = load i8, i8* undef, align 8
+ %tmp = load i8, ptr undef, align 8
switch i8 %tmp, label %bb11 [
i8 1, label %bb11
i8 2, label %bb11
@@ -62,7 +62,7 @@ bb2:
br label %bb4
bb4:
- %tmp5 = load i8, i8* undef, align 8
+ %tmp5 = load i8, ptr undef, align 8
switch i8 %tmp5, label %bb11 [
i8 0, label %bb11
i8 1, label %bb10
@@ -78,7 +78,7 @@ bb7:
br i1 undef, label %bb8, label %bb10
bb8:
- %tmp9 = icmp eq %struct.ham* undef, %arg
+ %tmp9 = icmp eq ptr undef, %arg
br i1 %tmp9, label %bb10, label %bb2
bb10:
@@ -92,15 +92,15 @@ bb11:
unreachable
bb12:
- %tmp13 = load %struct.ham*, %struct.ham** undef
+ %tmp13 = load ptr, ptr undef
br label %bb14
bb14:
- %tmp15 = phi %struct.ham* [ %tmp13, %bb12 ], [ null, %bb10 ]
+ %tmp15 = phi ptr [ %tmp13, %bb12 ], [ null, %bb10 ]
br label %bb16
bb16:
- %tmp17 = load i8, i8* undef, align 8
+ %tmp17 = load i8, ptr undef, align 8
switch i8 %tmp17, label %bb11 [
i8 0, label %bb11
i8 11, label %bb18
@@ -114,7 +114,7 @@ bb19:
br label %bb20
bb20:
- %tmp21 = load %struct.ham*, %struct.ham** undef
+ %tmp21 = load ptr, ptr undef
switch i8 undef, label %bb22 [
i8 0, label %bb4
i8 11, label %bb10
@@ -125,23 +125,23 @@ bb22:
br label %bb23
bb23:
- %tmp24 = icmp eq %struct.ham* %tmp21, null
+ %tmp24 = icmp eq ptr %tmp21, null
br i1 %tmp24, label %bb35, label %bb25
bb25:
- %tmp26 = icmp eq %struct.ham* %tmp15, null
+ %tmp26 = icmp eq ptr %tmp15, null
br i1 %tmp26, label %bb34, label %bb27
bb27:
- %tmp28 = load %struct.ham*, %struct.ham** undef
- %tmp29 = icmp eq %struct.ham* %tmp28, %tmp21
+ %tmp28 = load ptr, ptr undef
+ %tmp29 = icmp eq ptr %tmp28, %tmp21
br i1 %tmp29, label %bb35, label %bb30
bb30:
br label %bb31
bb31:
- %tmp32 = load i8, i8* undef, align 8
+ %tmp32 = load i8, ptr undef, align 8
%tmp33 = icmp eq i8 %tmp32, 0
br i1 %tmp33, label %bb31, label %bb34
@@ -153,21 +153,21 @@ bb35:
br label %bb37
bb37:
- %tmp38 = icmp eq %struct.ham* %tmp15, null
+ %tmp38 = icmp eq ptr %tmp15, null
br i1 %tmp38, label %bb39, label %bb41
bb39:
- %tmp40 = load %struct.ham*, %struct.ham** @global
+ %tmp40 = load ptr, ptr @global
br label %bb41
bb41:
- %tmp42 = select i1 %tmp36, %struct.ham* undef, %struct.ham* undef
+ %tmp42 = select i1 %tmp36, ptr undef, ptr undef
ret void
}
declare i32 @foo(...)
-define void @zot() align 2 personality i8* bitcast (i32 (...)* @foo to i8*) {
+define void @zot() align 2 personality ptr @foo {
bb:
invoke void @bar()
to label %bb1 unwind label %bb3
@@ -181,15 +181,15 @@ bb2:
to label %bb6 unwind label %bb17
bb3:
- %tmp = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @global.1 to i8*)
- catch i8* null
+ %tmp = landingpad { ptr, i32 }
+ catch ptr @global.1
+ catch ptr null
unreachable
bb4:
- %tmp5 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @global.1 to i8*)
- catch i8* null
+ %tmp5 = landingpad { ptr, i32 }
+ catch ptr @global.1
+ catch ptr null
unreachable
bb6:
@@ -201,15 +201,15 @@ bb7:
to label %bb10 unwind label %bb8
bb8:
- %tmp9 = landingpad { i8*, i32 }
+ %tmp9 = landingpad { ptr, i32 }
cleanup
- catch i8* bitcast (i8** @global.1 to i8*)
- catch i8* null
+ catch ptr @global.1
+ catch ptr null
unreachable
bb10:
- %tmp11 = load i32 (%struct.zot*)*, i32 (%struct.zot*)** undef, align 8
- %tmp12 = invoke i32 %tmp11(%struct.zot* nonnull undef)
+ %tmp11 = load ptr, ptr undef, align 8
+ %tmp12 = invoke i32 %tmp11(ptr nonnull undef)
to label %bb13 unwind label %bb21
bb13:
@@ -217,45 +217,45 @@ bb13:
to label %bb14 unwind label %bb23
bb14:
- %tmp15 = load i32 (%struct.zot*)*, i32 (%struct.zot*)** undef, align 8
- %tmp16 = invoke i32 %tmp15(%struct.zot* nonnull undef)
+ %tmp15 = load ptr, ptr undef, align 8
+ %tmp16 = invoke i32 %tmp15(ptr nonnull undef)
to label %bb26 unwind label %bb23
bb17:
- %tmp18 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @global.1 to i8*)
- catch i8* null
+ %tmp18 = landingpad { ptr, i32 }
+ catch ptr @global.1
+ catch ptr null
unreachable
bb19:
- %tmp20 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @global.1 to i8*)
- catch i8* null
+ %tmp20 = landingpad { ptr, i32 }
+ catch ptr @global.1
+ catch ptr null
unreachable
bb21:
- %tmp22 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @global.1 to i8*)
- catch i8* null
+ %tmp22 = landingpad { ptr, i32 }
+ catch ptr @global.1
+ catch ptr null
unreachable
bb23:
- %tmp24 = phi %struct.quux.0* [ null, %bb26 ], [ null, %bb14 ], [ undef, %bb13 ]
- %tmp25 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @global.1 to i8*)
- catch i8* null
+ %tmp24 = phi ptr [ null, %bb26 ], [ null, %bb14 ], [ undef, %bb13 ]
+ %tmp25 = landingpad { ptr, i32 }
+ catch ptr @global.1
+ catch ptr null
br label %bb30
bb26:
- %tmp27 = load i32 (%struct.zot*)*, i32 (%struct.zot*)** undef, align 8
- %tmp28 = invoke i32 %tmp27(%struct.zot* nonnull undef)
+ %tmp27 = load ptr, ptr undef, align 8
+ %tmp28 = invoke i32 %tmp27(ptr nonnull undef)
to label %bb29 unwind label %bb23
bb29:
unreachable
bb30:
- %tmp31 = icmp eq %struct.quux.0* %tmp24, null
+ %tmp31 = icmp eq ptr %tmp24, null
br i1 %tmp31, label %bb32, label %bb29
bb32:
diff --git a/llvm/test/Transforms/JumpThreading/ddt-crash2.ll b/llvm/test/Transforms/JumpThreading/ddt-crash2.ll
index f9b7b89f5054d..04d7b62d53723 100644
--- a/llvm/test/Transforms/JumpThreading/ddt-crash2.ll
+++ b/llvm/test/Transforms/JumpThreading/ddt-crash2.ll
@@ -2,24 +2,23 @@
%struct.aaa = type { i8 }
-define void @chrome(%struct.aaa* noalias sret(%struct.aaa) %arg) local_unnamed_addr #0 align 2 personality i8* bitcast (i32 (...)* @chrome2 to i8*) {
+define void @chrome(ptr noalias sret(%struct.aaa) %arg) local_unnamed_addr #0 align 2 personality ptr @chrome2 {
bb:
- %tmp = load i32, i32* undef, align 4
+ %tmp = load i32, ptr undef, align 4
%tmp1 = icmp eq i32 %tmp, 0
br i1 %tmp1, label %bb2, label %bb13
bb2:
- %tmp3 = getelementptr inbounds %struct.aaa, %struct.aaa* %arg, i64 0, i32 0
- %tmp4 = load i8, i8* %tmp3, align 1
+ %tmp4 = load i8, ptr %arg, align 1
%tmp5 = icmp eq i8 %tmp4, 0
br i1 %tmp5, label %bb6, label %bb7
bb6:
- store i8 0, i8* %tmp3, align 1
+ store i8 0, ptr %arg, align 1
br label %bb7
bb7:
- %tmp8 = load i8, i8* %tmp3, align 1
+ %tmp8 = load i8, ptr %arg, align 1
%tmp9 = icmp ne i8 %tmp8, 0
%tmp10 = select i1 %tmp9, i1 true, i1 false
br i1 %tmp10, label %bb12, label %bb11
diff --git a/llvm/test/Transforms/JumpThreading/ddt-crash3.ll b/llvm/test/Transforms/JumpThreading/ddt-crash3.ll
index f36f0410fb2ca..cb45610eb3a11 100644
--- a/llvm/test/Transforms/JumpThreading/ddt-crash3.ll
+++ b/llvm/test/Transforms/JumpThreading/ddt-crash3.ll
@@ -13,12 +13,12 @@ bb:
br label %bb1
bb1: ; preds = %bb26, %bb
- %tmp = load i64, i64* @global, align 8, !tbaa !1
+ %tmp = load i64, ptr @global, align 8, !tbaa !1
%tmp2 = icmp eq i64 %tmp, 0
br i1 %tmp2, label %bb27, label %bb3
bb3: ; preds = %bb1
- %tmp4 = load i64, i64* @global.1, align 8, !tbaa !1
+ %tmp4 = load i64, ptr @global.1, align 8, !tbaa !1
%tmp5 = icmp eq i64 %tmp4, 0
br i1 %tmp5, label %bb23, label %bb23
diff --git a/llvm/test/Transforms/JumpThreading/ddt-crash4.ll b/llvm/test/Transforms/JumpThreading/ddt-crash4.ll
index 9bf08395d6601..24bf36e3b06ce 100644
--- a/llvm/test/Transforms/JumpThreading/ddt-crash4.ll
+++ b/llvm/test/Transforms/JumpThreading/ddt-crash4.ll
@@ -6,12 +6,12 @@ bb:
br label %bb1
bb1:
- %tmp = load i64, i64* @global, align 8
+ %tmp = load i64, ptr @global, align 8
%tmp2 = icmp eq i64 %tmp, 0
br i1 %tmp2, label %bb27, label %bb3
bb3:
- %tmp4 = load i64, i64* @global, align 8
+ %tmp4 = load i64, ptr @global, align 8
%tmp5 = icmp eq i64 %tmp4, 0
br i1 %tmp5, label %bb6, label %bb7
@@ -24,7 +24,7 @@ bb7:
br i1 false, label %bb10, label %bb23
bb10:
- %tmp11 = load i64, i64* @global, align 8
+ %tmp11 = load i64, ptr @global, align 8
%tmp12 = icmp slt i64 %tmp11, 5
br i1 %tmp12, label %bb13, label %bb17
diff --git a/llvm/test/Transforms/JumpThreading/domtree-updates.ll b/llvm/test/Transforms/JumpThreading/domtree-updates.ll
index 8e4af27635eab..31c3430f57d1b 100644
--- a/llvm/test/Transforms/JumpThreading/domtree-updates.ll
+++ b/llvm/test/Transforms/JumpThreading/domtree-updates.ll
@@ -83,7 +83,7 @@ cleanup: ; preds = %for.end10, %for.bod
if.end15: ; preds = %cleanup, %if.then, %for.cond1
%retval.2 = phi i16 [ %retval.1, %cleanup ], [ %retval.0, %if.then ], [ %retval.0, %for.cond1 ]
%i.2 = phi i16 [ %i.128, %cleanup ], [ %i.0, %if.then ], [ %i.0, %for.cond1 ]
- store i16 0, i16* @a, align 1
+ store i16 0, ptr @a, align 1
br label %cleanup16
cleanup16: ; preds = %if.end15, %cleanup
diff --git a/llvm/test/Transforms/JumpThreading/fold-not-thread.ll b/llvm/test/Transforms/JumpThreading/fold-not-thread.ll
index 85cdcc0d9b332..003cf811dfa99 100644
--- a/llvm/test/Transforms/JumpThreading/fold-not-thread.ll
+++ b/llvm/test/Transforms/JumpThreading/fold-not-thread.ll
@@ -56,7 +56,7 @@ L2:
; CHECK: L3:
define void @test_br_folding_not_threading(i1 %cond) nounwind {
entry:
- br i1 %cond, label %L0, label %L3
+ br i1 %cond, label %L0, label %L3
L0:
call i32 @f2()
call i32 @f2()
@@ -71,7 +71,7 @@ L0:
call i32 @f2()
call i32 @f2()
call i32 @f2()
- br i1 %cond, label %L1, label %L2
+ br i1 %cond, label %L1, label %L2
L1:
call void @f3()
@@ -101,10 +101,10 @@ entry:
br i1 %condx, label %X0, label %X1
X0:
- br i1 %cond, label %L0, label %L3
+ br i1 %cond, label %L0, label %L3
X1:
- br i1 %cond, label %L0, label %L3
+ br i1 %cond, label %L0, label %L3
L0:
call i32 @f2()
@@ -120,7 +120,7 @@ L0:
call i32 @f2()
call i32 @f2()
call i32 @f2()
- br i1 %cond, label %L1, label %L2
+ br i1 %cond, label %L1, label %L2
L1:
call void @f3()
@@ -140,7 +140,7 @@ L3:
define void @rauw_if_possible(i32 %value) nounwind {
entry:
%cmp = icmp eq i32 %value, 32
- br i1 %cmp, label %L0, label %L3
+ br i1 %cmp, label %L0, label %L3
L0:
call i32 @f2()
call i32 @f2()
@@ -164,12 +164,12 @@ L3:
; Make sure we can NOT do the RAUW for %add...
;
; CHECK-LABEL: @rauw_if_possible2(
-; CHECK: call void @f4(i32 %add)
+; CHECK: call void @f4(i32 %add)
define void @rauw_if_possible2(i32 %value) nounwind {
entry:
%cmp = icmp eq i32 %value, 32
%add = add i32 %value, 64
- br i1 %cmp, label %L0, label %L2
+ br i1 %cmp, label %L0, label %L2
L0:
call i32 @f2()
call i32 @f2()
@@ -195,7 +195,7 @@ L3:
; its target after L0 into account and that enables us to fold.
;
; L2 is the unreachable block here.
-;
+;
; CHECK-LABEL: @test_br_folding_not_threading_indirect_branch(
; CHECK: L1:
; CHECK: call i32 @f2()
@@ -214,7 +214,7 @@ X1:
br i1 %cond, label %XX1, label %L3
XX1:
- indirectbr i8* blockaddress(@test_br_folding_not_threading_indirect_branch, %L0), [label %L0]
+ indirectbr ptr blockaddress(@test_br_folding_not_threading_indirect_branch, %L0), [label %L0]
L0:
call i32 @f2()
diff --git a/llvm/test/Transforms/JumpThreading/free_instructions.ll b/llvm/test/Transforms/JumpThreading/free_instructions.ll
index 76392af77d33d..75b262856612a 100644
--- a/llvm/test/Transforms/JumpThreading/free_instructions.ll
+++ b/llvm/test/Transforms/JumpThreading/free_instructions.ll
@@ -3,51 +3,45 @@
; TODO: In this test case, only the stores in %join should cound towards
; the jump threading threshold, as everything else are free instructions.
-define i32 @free_instructions(i1 %c, i32* %p) {
+define i32 @free_instructions(i1 %c, ptr %p) {
; CHECK-LABEL: @free_instructions(
; CHECK-NEXT: br i1 [[C:%.*]], label [[IF2:%.*]], label [[ELSE2:%.*]]
; CHECK: if2:
-; CHECK-NEXT: store i32 -1, i32* [[P:%.*]], align 4
+; CHECK-NEXT: store i32 -1, ptr [[P:%.*]], align 4
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META0:![0-9]+]])
-; CHECK-NEXT: store i32 1, i32* [[P]], align 4, !noalias !0
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 32) ]
-; CHECK-NEXT: store i32 2, i32* [[P]], align 4
-; CHECK-NEXT: [[P21:%.*]] = bitcast i32* [[P]] to i8*
-; CHECK-NEXT: [[P32:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* [[P21]])
-; CHECK-NEXT: [[P43:%.*]] = bitcast i8* [[P32]] to i32*
-; CHECK-NEXT: store i32 3, i32* [[P43]], align 4, !invariant.group !3
+; CHECK-NEXT: store i32 1, ptr [[P]], align 4, !noalias !0
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 32) ]
+; CHECK-NEXT: store i32 2, ptr [[P]], align 4
+; CHECK-NEXT: [[P32:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[P]])
+; CHECK-NEXT: store i32 3, ptr [[P32]], align 4, !invariant.group !3
; CHECK-NEXT: ret i32 0
; CHECK: else2:
-; CHECK-NEXT: store i32 -2, i32* [[P]], align 4
+; CHECK-NEXT: store i32 -2, ptr [[P]], align 4
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META4:![0-9]+]])
-; CHECK-NEXT: store i32 1, i32* [[P]], align 4, !noalias !4
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 32) ]
-; CHECK-NEXT: store i32 2, i32* [[P]], align 4
-; CHECK-NEXT: [[P2:%.*]] = bitcast i32* [[P]] to i8*
-; CHECK-NEXT: [[P3:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* [[P2]])
-; CHECK-NEXT: [[P4:%.*]] = bitcast i8* [[P3]] to i32*
-; CHECK-NEXT: store i32 3, i32* [[P4]], align 4, !invariant.group !3
+; CHECK-NEXT: store i32 1, ptr [[P]], align 4, !noalias !4
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 32) ]
+; CHECK-NEXT: store i32 2, ptr [[P]], align 4
+; CHECK-NEXT: [[P3:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[P]])
+; CHECK-NEXT: store i32 3, ptr [[P3]], align 4, !invariant.group !3
; CHECK-NEXT: ret i32 1
;
br i1 %c, label %if, label %else
if:
- store i32 -1, i32* %p
+ store i32 -1, ptr %p
br label %join
else:
- store i32 -2, i32* %p
+ store i32 -2, ptr %p
br label %join
join:
call void @llvm.experimental.noalias.scope.decl(metadata !0)
- store i32 1, i32* %p, !noalias !0
- call void @llvm.assume(i1 true) ["align"(i32* %p, i64 32)]
- store i32 2, i32* %p
- %p2 = bitcast i32* %p to i8*
- %p3 = call i8* @llvm.launder.invariant.group.p0i8(i8* %p2)
- %p4 = bitcast i8* %p3 to i32*
- store i32 3, i32* %p4, !invariant.group !{}
+ store i32 1, ptr %p, !noalias !0
+ call void @llvm.assume(i1 true) ["align"(ptr %p, i64 32)]
+ store i32 2, ptr %p
+ %p3 = call ptr @llvm.launder.invariant.group.p0(ptr %p)
+ store i32 3, ptr %p3, !invariant.group !{}
br i1 %c, label %if2, label %else2
if2:
@@ -59,7 +53,7 @@ else2:
declare void @llvm.assume(i1)
declare void @llvm.experimental.noalias.scope.decl(metadata)
-declare i8* @llvm.launder.invariant.group.p0i8(i8*)
+declare ptr @llvm.launder.invariant.group.p0(ptr)
!0 = !{!1}
!1 = distinct !{!1, !2, !"scope"}
diff --git a/llvm/test/Transforms/JumpThreading/guards.ll b/llvm/test/Transforms/JumpThreading/guards.ll
index 5868947205ee0..68452155ed6ed 100644
--- a/llvm/test/Transforms/JumpThreading/guards.ll
+++ b/llvm/test/Transforms/JumpThreading/guards.ll
@@ -218,7 +218,7 @@ declare void @never_called(i1)
; LVI uses guard to identify value of %c2 in branch as true, we cannot replace that
; guard with guard(true & c1).
-define void @dont_fold_guard(i8* %addr, i32 %i, i32 %length) {
+define void @dont_fold_guard(ptr %addr, i32 %i, i32 %length) {
; CHECK-LABEL: @dont_fold_guard(
; CHECK-NEXT: BB1:
; CHECK-NEXT: [[C1:%.*]] = icmp ult i32 [[I:%.*]], [[LENGTH:%.*]]
@@ -245,7 +245,7 @@ BB2:
declare void @dummy(i1) nounwind willreturn
; same as dont_fold_guard1 but there's a use immediately after guard and before
; branch. We can fold that use.
-define void @dont_fold_guard2(i8* %addr, i32 %i, i32 %length) {
+define void @dont_fold_guard2(ptr %addr, i32 %i, i32 %length) {
; CHECK-LABEL: @dont_fold_guard2(
; CHECK-NEXT: BB1:
; CHECK-NEXT: [[C1:%.*]] = icmp ult i32 [[I:%.*]], [[LENGTH:%.*]]
@@ -274,7 +274,7 @@ BB2:
; same as dont_fold_guard1 but condition %cmp is not an instruction.
; We cannot fold the guard under any circumstance.
; FIXME: We can merge unreachableBB2 into not_zero.
-define void @dont_fold_guard3(i8* %addr, i1 %cmp, i32 %i, i32 %length) {
+define void @dont_fold_guard3(ptr %addr, i1 %cmp, i32 %i, i32 %length) {
; CHECK-LABEL: @dont_fold_guard3(
; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[CMP:%.*]]) [ "deopt"() ]
; CHECK-NEXT: br i1 [[CMP]], label [[BB1:%.*]], label [[BB2:%.*]]
@@ -332,13 +332,13 @@ L3:
}
; Make sure that we don't PRE a non-speculable load across a guard.
-define void @unsafe_pre_across_guard(i8* %p, i1 %load.is.valid) {
+define void @unsafe_pre_across_guard(ptr %p, i1 %load.is.valid) {
; CHECK-LABEL: @unsafe_pre_across_guard(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: call void (i1, ...) @llvm.experimental.guard(i1 [[LOAD_IS_VALID:%.*]]) [ "deopt"() ]
-; CHECK-NEXT: [[LOADED:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[LOADED:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: [[CONTINUE:%.*]] = icmp eq i8 [[LOADED]], 0
; CHECK-NEXT: br i1 [[CONTINUE]], label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
@@ -349,7 +349,7 @@ entry:
loop: ; preds = %loop, %entry
call void (i1, ...) @llvm.experimental.guard(i1 %load.is.valid) [ "deopt"() ]
- %loaded = load i8, i8* %p
+ %loaded = load i8, ptr %p
%continue = icmp eq i8 %loaded, 0
br i1 %continue, label %exit, label %loop
@@ -358,10 +358,10 @@ exit: ; preds = %loop
}
; Make sure that we can safely PRE a speculable load across a guard.
-define void @safe_pre_across_guard(i8* noalias nocapture readonly dereferenceable(8) %p, i1 %load.is.valid) nofree nosync {
+define void @safe_pre_across_guard(ptr noalias nocapture readonly dereferenceable(8) %p, i1 %load.is.valid) nofree nosync {
; CHECK-LABEL: @safe_pre_across_guard(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LOADED_PR:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[LOADED_PR:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[LOADED]], [[LOOP]] ], [ [[LOADED_PR]], [[ENTRY:%.*]] ]
@@ -377,7 +377,7 @@ entry:
loop: ; preds = %loop, %entry
call void (i1, ...) @llvm.experimental.guard(i1 %load.is.valid) [ "deopt"() ]
- %loaded = load i8, i8* %p
+ %loaded = load i8, ptr %p
%continue = icmp eq i8 %loaded, 0
br i1 %continue, label %exit, label %loop
@@ -387,13 +387,13 @@ exit: ; preds = %loop
; Make sure that we don't PRE a non-speculable load across a call which may
; alias with the load.
-define void @unsafe_pre_across_call(i8* %p) {
+define void @unsafe_pre_across_call(ptr %p) {
; CHECK-LABEL: @unsafe_pre_across_call(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[TMP0:%.*]] = call i32 @f1()
-; CHECK-NEXT: [[LOADED:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[LOADED:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: [[CONTINUE:%.*]] = icmp eq i8 [[LOADED]], 0
; CHECK-NEXT: br i1 [[CONTINUE]], label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
@@ -404,7 +404,7 @@ entry:
loop: ; preds = %loop, %entry
call i32 @f1()
- %loaded = load i8, i8* %p
+ %loaded = load i8, ptr %p
%continue = icmp eq i8 %loaded, 0
br i1 %continue, label %exit, label %loop
@@ -413,10 +413,10 @@ exit: ; preds = %loop
}
; Make sure that we can safely PRE a speculable load across a call.
-define void @safe_pre_across_call(i8* noalias nocapture readonly dereferenceable(8) %p) nofree nosync {
+define void @safe_pre_across_call(ptr noalias nocapture readonly dereferenceable(8) %p) nofree nosync {
; CHECK-LABEL: @safe_pre_across_call(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LOADED_PR:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[LOADED_PR:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[LOADED:%.*]] = phi i8 [ [[LOADED]], [[LOOP]] ], [ [[LOADED_PR]], [[ENTRY:%.*]] ]
@@ -432,7 +432,7 @@ entry:
loop: ; preds = %loop, %entry
call i32 @f1()
- %loaded = load i8, i8* %p
+ %loaded = load i8, ptr %p
%continue = icmp eq i8 %loaded, 0
br i1 %continue, label %exit, label %loop
diff --git a/llvm/test/Transforms/JumpThreading/implied-cond.ll b/llvm/test/Transforms/JumpThreading/implied-cond.ll
index 6da05791456da..49c0982b7a4f3 100644
--- a/llvm/test/Transforms/JumpThreading/implied-cond.ll
+++ b/llvm/test/Transforms/JumpThreading/implied-cond.ll
@@ -62,7 +62,7 @@ define void @test1(i32 %i, i32 %len) {
ret void
}
-define void @test2(i32 %i, i32 %len, i1* %c.ptr) {
+define void @test2(i32 %i, i32 %len, ptr %c.ptr) {
; CHECK-LABEL: @test2(
; CHECK: entry:
@@ -79,7 +79,7 @@ define void @test2(i32 %i, i32 %len, i1* %c.ptr) {
br i1 %c0, label %cont, label %right
cont:
- %c = load i1, i1* %c.ptr
+ %c = load i1, ptr %c.ptr
br i1 %c, label %left, label %right
left:
diff --git a/llvm/test/Transforms/JumpThreading/indirectbr-cast-int-op.ll b/llvm/test/Transforms/JumpThreading/indirectbr-cast-int-op.ll
index f5555b67f41d2..bb83153393fbf 100644
--- a/llvm/test/Transforms/JumpThreading/indirectbr-cast-int-op.ll
+++ b/llvm/test/Transforms/JumpThreading/indirectbr-cast-int-op.ll
@@ -6,18 +6,18 @@
define void @cast_with_binop() {
; CHECK-LABEL: @cast_with_binop(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[OP:%.*]] = add i64 ptrtoint (i8* inttoptr (i32 1 to i8*) to i64), undef
-; CHECK-NEXT: [[CAST:%.*]] = inttoptr i64 [[OP]] to i8*
-; CHECK-NEXT: indirectbr i8* [[CAST]], [label [[BB3:%.*]], label %bb2]
+; CHECK-NEXT: [[OP:%.*]] = add i64 ptrtoint (ptr inttoptr (i32 1 to ptr) to i64), undef
+; CHECK-NEXT: [[CAST:%.*]] = inttoptr i64 [[OP]] to ptr
+; CHECK-NEXT: indirectbr ptr [[CAST]], [label [[BB3:%.*]], label %bb2]
; CHECK: bb2:
; CHECK-NEXT: unreachable
; CHECK: bb3:
; CHECK-NEXT: ret void
;
bb:
- %op = add i64 ptrtoint (i8* inttoptr (i32 1 to i8*) to i64), undef
- %cast = inttoptr i64 %op to i8*
- indirectbr i8* %cast, [label %bb3, label %bb2]
+ %op = add i64 ptrtoint (ptr inttoptr (i32 1 to ptr) to i64), undef
+ %cast = inttoptr i64 %op to ptr
+ indirectbr ptr %cast, [label %bb3, label %bb2]
bb2:
unreachable
bb3:
@@ -30,8 +30,8 @@ define void @cast_with_i1(i1 %x, i1 %y) {
; CHECK-LABEL: @cast_with_i1(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[OP:%.*]] = add i1 [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[CAST:%.*]] = inttoptr i1 [[OP]] to i8*
-; CHECK-NEXT: indirectbr i8* [[CAST]], [label [[BB3:%.*]], label %bb2]
+; CHECK-NEXT: [[CAST:%.*]] = inttoptr i1 [[OP]] to ptr
+; CHECK-NEXT: indirectbr ptr [[CAST]], [label [[BB3:%.*]], label %bb2]
; CHECK: bb2:
; CHECK-NEXT: unreachable
; CHECK: bb3:
@@ -39,8 +39,8 @@ define void @cast_with_i1(i1 %x, i1 %y) {
;
bb:
%op = add i1 %x, %y
- %cast = inttoptr i1 %op to i8*
- indirectbr i8* %cast, [label %bb3, label %bb2]
+ %cast = inttoptr i1 %op to ptr
+ indirectbr ptr %cast, [label %bb3, label %bb2]
bb2:
unreachable
bb3:
@@ -53,8 +53,8 @@ define void @cast_with_cmp(i1 %x, i1 %y) {
; CHECK-LABEL: @cast_with_cmp(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[OP:%.*]] = icmp slt i1 [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[CAST:%.*]] = inttoptr i1 [[OP]] to i8*
-; CHECK-NEXT: indirectbr i8* [[CAST]], [label [[BB3:%.*]], label %bb2]
+; CHECK-NEXT: [[CAST:%.*]] = inttoptr i1 [[OP]] to ptr
+; CHECK-NEXT: indirectbr ptr [[CAST]], [label [[BB3:%.*]], label %bb2]
; CHECK: bb2:
; CHECK-NEXT: unreachable
; CHECK: bb3:
@@ -62,8 +62,8 @@ define void @cast_with_cmp(i1 %x, i1 %y) {
;
bb:
%op = icmp slt i1 %x, %y
- %cast = inttoptr i1 %op to i8*
- indirectbr i8* %cast, [label %bb3, label %bb2]
+ %cast = inttoptr i1 %op to ptr
+ indirectbr ptr %cast, [label %bb3, label %bb2]
bb2:
unreachable
bb3:
diff --git a/llvm/test/Transforms/JumpThreading/indirectbr-in-predpred.ll b/llvm/test/Transforms/JumpThreading/indirectbr-in-predpred.ll
index a2005600470d0..1ed903d26a0c7 100644
--- a/llvm/test/Transforms/JumpThreading/indirectbr-in-predpred.ll
+++ b/llvm/test/Transforms/JumpThreading/indirectbr-in-predpred.ll
@@ -6,8 +6,8 @@ define i1 @test1(i32 %0) #0 {
; CHECK-NEXT: PredPredBB1:
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[TMP0:%.*]], 0
; CHECK-NEXT: [[TMP1:%.*]] = add i32 32, [[TMP0]]
-; CHECK-NEXT: [[INDIRECT_GOTO_DEST:%.*]] = select i1 [[CMP]], i8* blockaddress(@test1, [[PREDBB1:%.*]]), i8* blockaddress(@test1, [[PREDPREDBB2:%.*]])
-; CHECK-NEXT: indirectbr i8* [[INDIRECT_GOTO_DEST]], [label [[PREDBB1]], label %PredPredBB2]
+; CHECK-NEXT: [[INDIRECT_GOTO_DEST:%.*]] = select i1 [[CMP]], ptr blockaddress(@test1, [[PREDBB1:%.*]]), ptr blockaddress(@test1, [[PREDPREDBB2:%.*]])
+; CHECK-NEXT: indirectbr ptr [[INDIRECT_GOTO_DEST]], [label [[PREDBB1]], label %PredPredBB2]
; CHECK: PredPredBB2:
; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i32 [[TMP0]], 1
; CHECK-NEXT: br i1 [[CMP1]], label [[PREDBB1]], label [[BB2:%.*]]
@@ -27,8 +27,8 @@ define i1 @test1(i32 %0) #0 {
PredPredBB1:
%cmp = icmp ne i32 %0, 0
%1 = add i32 32, %0
- %indirect.goto.dest = select i1 %cmp, i8* blockaddress(@test1, %PredBB1), i8* blockaddress(@test1, %PredPredBB2)
- indirectbr i8* %indirect.goto.dest, [label %PredBB1, label %PredPredBB2]
+ %indirect.goto.dest = select i1 %cmp, ptr blockaddress(@test1, %PredBB1), ptr blockaddress(@test1, %PredPredBB2)
+ indirectbr ptr %indirect.goto.dest, [label %PredBB1, label %PredPredBB2]
PredPredBB2: ; preds = %PredPredBB1
%cmp1 = icmp ne i32 %0, 1
diff --git a/llvm/test/Transforms/JumpThreading/indirectbr.ll b/llvm/test/Transforms/JumpThreading/indirectbr.ll
index 197ca30f58ae6..43c8d9c759b4b 100644
--- a/llvm/test/Transforms/JumpThreading/indirectbr.ll
+++ b/llvm/test/Transforms/JumpThreading/indirectbr.ll
@@ -1,9 +1,9 @@
; RUN: opt -S < %s -jump-threading | FileCheck %s
; Keep block addresses alive.
- at addresses = constant [4 x i8*] [
- i8* blockaddress(@test1, %L1), i8* blockaddress(@test1, %L2),
- i8* blockaddress(@test2, %L1), i8* blockaddress(@test2, %L2)
+ at addresses = constant [4 x ptr] [
+ ptr blockaddress(@test1, %L1), ptr blockaddress(@test1, %L2),
+ ptr blockaddress(@test2, %L1), ptr blockaddress(@test2, %L2)
]
declare void @bar()
@@ -17,8 +17,8 @@ declare void @baz()
; CHECK: br i1 %tobool, label %L1, label %indirectgoto
; CHECK-NOT: if.else:
; CHECK: L1:
-; CHECK: indirectbr i8* %address, [label %L1, label %L2]
-define void @test1(i32 %i, i8* %address) nounwind {
+; CHECK: indirectbr ptr %address, [label %L1, label %L2]
+define void @test1(i32 %i, ptr %address) nounwind {
entry:
%rem = srem i32 %i, 2
%tobool = icmp ne i32 %rem, 0
@@ -36,8 +36,8 @@ L2: ; preds = %indirectgoto
ret void
indirectgoto: ; preds = %if.else, %entry
- %indirect.goto.dest = phi i8* [ %address, %if.else ], [ blockaddress(@test1, %L1), %entry ]
- indirectbr i8* %indirect.goto.dest, [label %L1, label %L2]
+ %indirect.goto.dest = phi ptr [ %address, %if.else ], [ blockaddress(@test1, %L1), %entry ]
+ indirectbr ptr %indirect.goto.dest, [label %L1, label %L2]
}
@@ -51,7 +51,7 @@ indirectgoto: ; preds = %if.else, %entry
; CHECK-NEXT: ret void
define void @test2() nounwind {
entry:
- indirectbr i8* blockaddress(@test2, %L1), [label %L1, label %L2]
+ indirectbr ptr blockaddress(@test2, %L1), [label %L1, label %L2]
L1: ; preds = %indirectgoto
call void @bar()
@@ -79,15 +79,15 @@ entry:
br label %__here
__here: ; preds = %entry
- %call = call i32 (...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here) to i64)) nounwind noredzone
+ %call = call i32 (...) @printf(ptr @.str, i64 ptrtoint (ptr blockaddress(@test3, %__here) to i64)) nounwind noredzone
br label %__here1
__here1: ; preds = %__here
- %call2 = call i32 (...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here1) to i64)) nounwind noredzone
+ %call2 = call i32 (...) @printf(ptr @.str, i64 ptrtoint (ptr blockaddress(@test3, %__here1) to i64)) nounwind noredzone
br label %__here3
__here3: ; preds = %__here1
- %call4 = call i32 (...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here3) to i64)) nounwind noredzone
+ %call4 = call i32 (...) @printf(ptr @.str, i64 ptrtoint (ptr blockaddress(@test3, %__here3) to i64)) nounwind noredzone
ret void
}
diff --git a/llvm/test/Transforms/JumpThreading/landing-pad.ll b/llvm/test/Transforms/JumpThreading/landing-pad.ll
index 5dcc5aa17e601..de80ff8189fe5 100644
--- a/llvm/test/Transforms/JumpThreading/landing-pad.ll
+++ b/llvm/test/Transforms/JumpThreading/landing-pad.ll
@@ -1,63 +1,57 @@
; RUN: opt < %s -disable-output -jump-threading
-%class.E = type { i32 (...)**, %class.C }
+%class.E = type { ptr, %class.C }
%class.C = type { %class.A }
%class.A = type { i32 }
%class.D = type { %class.F }
%class.F = type { %class.E }
-%class.B = type { %class.D* }
+%class.B = type { ptr }
- at _ZTV1D = unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1D to i8*), i8* bitcast (void (%class.D*)* @_ZN1D7doApplyEv to i8*)]
- at _ZTI1D = external unnamed_addr constant { i8*, i8*, i8* }
+ at _ZTV1D = unnamed_addr constant [3 x ptr] [ptr null, ptr @_ZTI1D, ptr @_ZN1D7doApplyEv]
+ at _ZTI1D = external unnamed_addr constant { ptr, ptr, ptr }
-define void @_ZN15EditCommandImpl5applyEv(%class.E* %this) uwtable align 2 {
+define void @_ZN15EditCommandImpl5applyEv(ptr %this) uwtable align 2 {
entry:
- %0 = bitcast %class.E* %this to void (%class.E*)***
- %vtable = load void (%class.E*)**, void (%class.E*)*** %0, align 8
- %1 = load void (%class.E*)*, void (%class.E*)** %vtable, align 8
- call void %1(%class.E* %this)
+ %vtable = load ptr, ptr %this, align 8
+ %0 = load ptr, ptr %vtable, align 8
+ call void %0(ptr %this)
ret void
}
-define void @_ZN1DC1Ev(%class.D* nocapture %this) unnamed_addr uwtable align 2 {
+define void @_ZN1DC1Ev(ptr nocapture %this) unnamed_addr uwtable align 2 {
entry:
call void @_ZN24CompositeEditCommandImplC2Ev()
- %0 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, i32 0, i32 0
- store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8
+ store ptr getelementptr inbounds ([3 x ptr], ptr @_ZTV1D, i64 0, i64 2), ptr %this, align 8
ret void
}
-define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr uwtable align 2 {
+define void @_ZN1DC2Ev(ptr nocapture %this) unnamed_addr uwtable align 2 {
entry:
call void @_ZN24CompositeEditCommandImplC2Ev()
- %0 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, i32 0, i32 0
- store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8
+ store ptr getelementptr inbounds ([3 x ptr], ptr @_ZTV1D, i64 0, i64 2), ptr %this, align 8
ret void
}
declare void @_ZN24CompositeEditCommandImplC2Ev() #1
-define void @_ZN1D7doApplyEv(%class.D* nocapture %this) unnamed_addr nounwind readnone uwtable align 2 {
+define void @_ZN1D7doApplyEv(ptr nocapture %this) unnamed_addr nounwind readnone uwtable align 2 {
entry:
ret void
}
-define void @_Z3fn1v() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @_Z3fn1v() uwtable personality ptr @__gxx_personality_v0 {
entry:
- %call = call noalias i8* @_Znwm() #8
+ %call = call noalias ptr @_Znwm() #8
invoke void @_ZN24CompositeEditCommandImplC2Ev()
to label %_ZN1DC1Ev.exit unwind label %lpad
_ZN1DC1Ev.exit: ; preds = %entry
- %0 = bitcast i8* %call to i32 (...)***
- store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8
- %_ref.i.i.i = getelementptr inbounds i8, i8* %call, i64 8
- %1 = bitcast i8* %_ref.i.i.i to i32*
- %2 = load i32, i32* %1, align 4
- %inc.i.i.i = add nsw i32 %2, 1
- store i32 %inc.i.i.i, i32* %1, align 4
- %3 = bitcast i8* %call to %class.D*
- invoke void @_ZN1D7doApplyEv(%class.D* %3)
+ store ptr getelementptr inbounds ([3 x ptr], ptr @_ZTV1D, i64 0, i64 2), ptr %call, align 8
+ %_ref.i.i.i = getelementptr inbounds i8, ptr %call, i64 8
+ %0 = load i32, ptr %_ref.i.i.i, align 4
+ %inc.i.i.i = add nsw i32 %0, 1
+ store i32 %inc.i.i.i, ptr %_ref.i.i.i, align 4
+ invoke void @_ZN1D7doApplyEv(ptr %call)
to label %_ZN15EditCommandImpl5applyEv.exit unwind label %lpad1
_ZN15EditCommandImpl5applyEv.exit: ; preds = %_ZN1DC1Ev.exit
@@ -68,16 +62,16 @@ invoke.cont7: ; preds = %_ZN15EditCommandImp
ret void
lpad: ; preds = %entry
- %4 = landingpad { i8*, i32 }
+ %1 = landingpad { ptr, i32 }
cleanup
call void @_ZdlPv() #9
unreachable
lpad1: ; preds = %_ZN1DC1Ev.exit, %_ZN15EditCommandImpl5applyEv.exit
- %5 = landingpad { i8*, i32 }
+ %2 = landingpad { ptr, i32 }
cleanup
- %6 = load i32, i32* %1, align 4
- %tobool.i.i.i = icmp eq i32 %6, 0
+ %3 = load i32, ptr %_ref.i.i.i, align 4
+ %tobool.i.i.i = icmp eq i32 %3, 0
br i1 %tobool.i.i.i, label %_ZN1BI1DED1Ev.exit, label %if.then.i.i.i
if.then.i.i.i: ; preds = %lpad1
@@ -88,46 +82,43 @@ delete.notnull.i.i.i: ; preds = %if.then.i.i.i
unreachable
_ZN1BI1DED1Ev.exit: ; preds = %lpad1, %if.then.i.i.i
- resume { i8*, i32 } undef
+ resume { ptr, i32 } undef
terminate.lpad: ; No predecessors!
- %7 = landingpad { i8*, i32 }
- catch i8* null
+ %4 = landingpad { ptr, i32 }
+ catch ptr null
unreachable
}
-define void @_ZN1BI1DEC1EPS0_(%class.B* nocapture %this, %class.D* %p1) unnamed_addr uwtable align 2 {
+define void @_ZN1BI1DEC1EPS0_(ptr nocapture %this, ptr %p1) unnamed_addr uwtable align 2 {
entry:
- %m_ptr.i = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
- store %class.D* %p1, %class.D** %m_ptr.i, align 8
- %_ref.i.i = getelementptr inbounds %class.D, %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
- %0 = load i32, i32* %_ref.i.i, align 4
+ store ptr %p1, ptr %this, align 8
+ %_ref.i.i = getelementptr inbounds %class.D, ptr %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
+ %0 = load i32, ptr %_ref.i.i, align 4
%inc.i.i = add nsw i32 %0, 1
- store i32 %inc.i.i, i32* %_ref.i.i, align 4
+ store i32 %inc.i.i, ptr %_ref.i.i, align 4
ret void
}
-declare noalias i8* @_Znwm()
+declare noalias ptr @_Znwm()
declare i32 @__gxx_personality_v0(...)
declare void @_ZdlPv()
-define %class.D* @_ZN1BI1DEptEv(%class.B* nocapture readonly %this) nounwind readonly uwtable align 2 {
+define ptr @_ZN1BI1DEptEv(ptr nocapture readonly %this) nounwind readonly uwtable align 2 {
entry:
- %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
- %0 = load %class.D*, %class.D** %m_ptr, align 8
- ret %class.D* %0
+ %0 = load ptr, ptr %this, align 8
+ ret ptr %0
}
declare void @_ZN1D16deleteKeyPressedEv()
-define void @_ZN1BI1DED1Ev(%class.B* nocapture readonly %this) unnamed_addr uwtable align 2 {
+define void @_ZN1BI1DED1Ev(ptr nocapture readonly %this) unnamed_addr uwtable align 2 {
entry:
- %m_ptr.i = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
- %0 = load %class.D*, %class.D** %m_ptr.i, align 8
- %_ref.i.i = getelementptr inbounds %class.D, %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
- %1 = load i32, i32* %_ref.i.i, align 4
+ %0 = load ptr, ptr %this, align 8
+ %_ref.i.i = getelementptr inbounds %class.D, ptr %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
+ %1 = load i32, ptr %_ref.i.i, align 4
%tobool.i.i = icmp eq i32 %1, 0
br i1 %tobool.i.i, label %_ZN1BI1DED2Ev.exit, label %if.then.i.i
@@ -144,12 +135,11 @@ _ZN1BI1DED2Ev.exit: ; preds = %entry, %if.then.i.i
declare hidden void @__clang_call_terminate()
-define void @_ZN1BI1DED2Ev(%class.B* nocapture readonly %this) unnamed_addr uwtable align 2 {
+define void @_ZN1BI1DED2Ev(ptr nocapture readonly %this) unnamed_addr uwtable align 2 {
entry:
- %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
- %0 = load %class.D*, %class.D** %m_ptr, align 8
- %_ref.i = getelementptr inbounds %class.D, %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
- %1 = load i32, i32* %_ref.i, align 4
+ %0 = load ptr, ptr %this, align 8
+ %_ref.i = getelementptr inbounds %class.D, ptr %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
+ %1 = load i32, ptr %_ref.i, align 4
%tobool.i = icmp eq i32 %1, 0
br i1 %tobool.i, label %_ZN1AI1CE5derefEv.exit, label %if.then.i
@@ -164,10 +154,9 @@ _ZN1AI1CE5derefEv.exit: ; preds = %entry, %if.then.i
ret void
}
-define void @_ZN1AI1CE5derefEv(%class.A* nocapture readonly %this) nounwind uwtable align 2 {
+define void @_ZN1AI1CE5derefEv(ptr nocapture readonly %this) nounwind uwtable align 2 {
entry:
- %_ref = getelementptr inbounds %class.A, %class.A* %this, i64 0, i32 0
- %0 = load i32, i32* %_ref, align 4
+ %0 = load i32, ptr %this, align 4
%tobool = icmp eq i32 %0, 0
br i1 %tobool, label %if.end, label %if.then
@@ -182,22 +171,20 @@ if.end: ; preds = %entry, %if.then
ret void
}
-define void @_ZN1BI1DEC2EPS0_(%class.B* nocapture %this, %class.D* %p1) unnamed_addr uwtable align 2 {
+define void @_ZN1BI1DEC2EPS0_(ptr nocapture %this, ptr %p1) unnamed_addr uwtable align 2 {
entry:
- %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0
- store %class.D* %p1, %class.D** %m_ptr, align 8
- %_ref.i = getelementptr inbounds %class.D, %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
- %0 = load i32, i32* %_ref.i, align 4
+ store ptr %p1, ptr %this, align 8
+ %_ref.i = getelementptr inbounds %class.D, ptr %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0
+ %0 = load i32, ptr %_ref.i, align 4
%inc.i = add nsw i32 %0, 1
- store i32 %inc.i, i32* %_ref.i, align 4
+ store i32 %inc.i, ptr %_ref.i, align 4
ret void
}
-define void @_ZN1AI1CE3refEv(%class.A* nocapture %this) nounwind uwtable align 2 {
+define void @_ZN1AI1CE3refEv(ptr nocapture %this) nounwind uwtable align 2 {
entry:
- %_ref = getelementptr inbounds %class.A, %class.A* %this, i64 0, i32 0
- %0 = load i32, i32* %_ref, align 4
+ %0 = load i32, ptr %this, align 4
%inc = add nsw i32 %0, 1
- store i32 %inc, i32* %_ref, align 4
+ store i32 %inc, ptr %this, align 4
ret void
}
diff --git a/llvm/test/Transforms/JumpThreading/lvi-load.ll b/llvm/test/Transforms/JumpThreading/lvi-load.ll
index a36e263bf92c9..e37bf21870694 100644
--- a/llvm/test/Transforms/JumpThreading/lvi-load.ll
+++ b/llvm/test/Transforms/JumpThreading/lvi-load.ll
@@ -2,22 +2,22 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-darwin10.4"
-%"struct.llvm::PATypeHolder" = type { %"struct.llvm::Type"* }
+%"struct.llvm::PATypeHolder" = type { ptr }
%"struct.llvm::PointerIntPair<llvm::Use**,2u,llvm::Use::PrevPtrTag,llvm::PointerLikeTypeTraits<llvm::Use**> >" = type { i64 }
%"struct.llvm::Type" = type opaque
-%"struct.llvm::Use" = type { %"struct.llvm::Value"*, %"struct.llvm::Use"*, %"struct.llvm::PointerIntPair<llvm::Use**,2u,llvm::Use::PrevPtrTag,llvm::PointerLikeTypeTraits<llvm::Use**> >" }
-%"struct.llvm::Value" = type { i32 (...)**, i8, i8, i16, %"struct.llvm::PATypeHolder", %"struct.llvm::Use"*, %"struct.llvm::ValueName"* }
+%"struct.llvm::Use" = type { ptr, ptr, %"struct.llvm::PointerIntPair<llvm::Use**,2u,llvm::Use::PrevPtrTag,llvm::PointerLikeTypeTraits<llvm::Use**> >" }
+%"struct.llvm::Value" = type { ptr, i8, i8, i16, %"struct.llvm::PATypeHolder", ptr, ptr }
%"struct.llvm::ValueName" = type opaque
- at _ZZN4llvm4castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_E8__func__ = internal constant [5 x i8] c"cast\00", align 8 ; <[5 x i8]*> [#uses=1]
- at .str = private constant [31 x i8] c"include/llvm/Support/Casting.h\00", align 8 ; <[31 x i8]*> [#uses=1]
- at .str1 = private constant [59 x i8] c"isa<X>(Val) && \22cast<Ty>() argument of incompatible type!\22\00", align 8 ; <[59 x i8]*> [#uses=1]
+ at _ZZN4llvm4castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_E8__func__ = internal constant [5 x i8] c"cast\00", align 8 ; <ptr> [#uses=1]
+ at .str = private constant [31 x i8] c"include/llvm/Support/Casting.h\00", align 8 ; <ptr> [#uses=1]
+ at .str1 = private constant [59 x i8] c"isa<X>(Val) && \22cast<Ty>() argument of incompatible type!\22\00", align 8 ; <ptr> [#uses=1]
; CHECK: Z3fooPN4llvm5ValueE
-define zeroext i8 @_Z3fooPN4llvm5ValueE(%"struct.llvm::Value"* %V) ssp {
+define zeroext i8 @_Z3fooPN4llvm5ValueE(ptr %V) ssp {
entry:
- %0 = getelementptr inbounds %"struct.llvm::Value", %"struct.llvm::Value"* %V, i64 0, i32 1 ; <i8*> [#uses=1]
- %1 = load i8, i8* %0, align 8 ; <i8> [#uses=2]
+ %0 = getelementptr inbounds %"struct.llvm::Value", ptr %V, i64 0, i32 1 ; <ptr> [#uses=1]
+ %1 = load i8, ptr %0, align 8 ; <i8> [#uses=2]
%2 = icmp ugt i8 %1, 20 ; <i1> [#uses=1]
br i1 %2, label %bb.i, label %bb2
@@ -27,16 +27,16 @@ bb.i: ; preds = %entry
; CHECK-NOT: assert
bb6.i.i: ; preds = %bb.i
- tail call void @__assert_rtn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_ZZN4llvm4castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_E8__func__, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 202, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str1, i64 0, i64 0)) noreturn
+ tail call void @__assert_rtn(ptr @_ZZN4llvm4castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_E8__func__, ptr @.str, i32 202, ptr @.str1) noreturn
unreachable
_ZN4llvm8dyn_castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_.exit: ; preds = %bb.i
; CHECK-NOT: null
- %3 = icmp eq %"struct.llvm::Value"* %V, null ; <i1> [#uses=1]
+ %3 = icmp eq ptr %V, null ; <i1> [#uses=1]
br i1 %3, label %bb2, label %bb
bb: ; preds = %_ZN4llvm8dyn_castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_.exit
- tail call void @_ZNK4llvm5Value4dumpEv(%"struct.llvm::Value"* %V)
+ tail call void @_ZNK4llvm5Value4dumpEv(ptr %V)
; CHECK: ret
ret i8 1
@@ -44,6 +44,6 @@ bb2: ; preds = %entry, %_ZN4llvm8dy
ret i8 0
}
-declare void @__assert_rtn(i8*, i8*, i32, i8*) noreturn
+declare void @__assert_rtn(ptr, ptr, i32, ptr) noreturn
-declare void @_ZNK4llvm5Value4dumpEv(%"struct.llvm::Value"*)
+declare void @_ZNK4llvm5Value4dumpEv(ptr)
diff --git a/llvm/test/Transforms/JumpThreading/no-irreducible-loops.ll b/llvm/test/Transforms/JumpThreading/no-irreducible-loops.ll
index 7470ddebd0c26..8e4d7cb89c9ef 100644
--- a/llvm/test/Transforms/JumpThreading/no-irreducible-loops.ll
+++ b/llvm/test/Transforms/JumpThreading/no-irreducible-loops.ll
@@ -6,7 +6,7 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9.6"
- at v1 = external global i32 ; <i32*> [#uses=2]
+ at v1 = external global i32 ; <ptr> [#uses=2]
define i32 @unroll() nounwind {
entry:
@@ -17,11 +17,11 @@ bb: ; preds = %bb4
br i1 %0, label %bb1, label %bb2
bb1: ; preds = %bb
- store volatile i32 1000, i32* @v1, align 4
+ store volatile i32 1000, ptr @v1, align 4
br label %bb3
bb2: ; preds = %bb
- store volatile i32 1001, i32* @v1, align 4
+ store volatile i32 1001, ptr @v1, align 4
br label %bb3
bb3: ; preds = %bb2, %bb1
diff --git a/llvm/test/Transforms/JumpThreading/noalias-scope-decl.ll b/llvm/test/Transforms/JumpThreading/noalias-scope-decl.ll
index b032afaaf3135..362f232dda091 100644
--- a/llvm/test/Transforms/JumpThreading/noalias-scope-decl.ll
+++ b/llvm/test/Transforms/JumpThreading/noalias-scope-decl.ll
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -jump-threading < %s | FileCheck %s
-define void @test(i8* %ptr) {
+define void @test(ptr %ptr) {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !0)
@@ -12,14 +12,14 @@ define void @test(i8* %ptr) {
; CHECK-NEXT: br i1 [[C]], label [[EXIT:%.*]], label [[LATCH]]
; CHECK: latch:
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !3)
-; CHECK-NEXT: store i8 0, i8* [[PTR:%.*]], align 1, !noalias !0
-; CHECK-NEXT: store i8 1, i8* [[PTR]], align 1, !noalias !3
+; CHECK-NEXT: store i8 0, ptr [[PTR:%.*]], align 1, !noalias !0
+; CHECK-NEXT: store i8 1, ptr [[PTR]], align 1, !noalias !3
; CHECK-NEXT: [[I_INC]] = add i32 [[I]], 1
; CHECK-NEXT: br label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !5)
-; CHECK-NEXT: store i8 0, i8* [[PTR]], align 1, !noalias !0
-; CHECK-NEXT: store i8 1, i8* [[PTR]], align 1, !noalias !5
+; CHECK-NEXT: store i8 0, ptr [[PTR]], align 1, !noalias !0
+; CHECK-NEXT: store i8 1, ptr [[PTR]], align 1, !noalias !5
; CHECK-NEXT: ret void
;
entry:
@@ -37,8 +37,8 @@ if:
latch:
%p = phi i1 [ true, %if ], [ false, %loop ]
call void @llvm.experimental.noalias.scope.decl(metadata !3)
- store i8 0, i8* %ptr, !noalias !0
- store i8 1, i8* %ptr, !noalias !3
+ store i8 0, ptr %ptr, !noalias !0
+ store i8 1, ptr %ptr, !noalias !3
%i.inc = add i32 %i, 1
br i1 %p, label %exit, label %loop
diff --git a/llvm/test/Transforms/JumpThreading/nonnull-gep-out-of-bounds.ll b/llvm/test/Transforms/JumpThreading/nonnull-gep-out-of-bounds.ll
index 37737bb0dcd57..8a5139030beb4 100644
--- a/llvm/test/Transforms/JumpThreading/nonnull-gep-out-of-bounds.ll
+++ b/llvm/test/Transforms/JumpThreading/nonnull-gep-out-of-bounds.ll
@@ -1,14 +1,14 @@
; RUN: opt -jump-threading -S %s -o - | FileCheck %s
-define i32 @f(i64* %a, i64 %i) {
+define i32 @f(ptr %a, i64 %i) {
entry:
- store i64 0, i64* %a, align 8
- %p = getelementptr i64, i64* %a, i64 %i
- %c = icmp eq i64* %p, null
+ store i64 0, ptr %a, align 8
+ %p = getelementptr i64, ptr %a, i64 %i
+ %c = icmp eq ptr %p, null
; `%a` is non-null at the end of the block, because we store through it.
; However, `%p` is derived from `%a` via a GEP that is not `inbounds`, therefore we cannot judge `%p` is non-null as well
; and must retain the `icmp` instruction.
- ; CHECK: %c = icmp eq i64* %p, null
+ ; CHECK: %c = icmp eq ptr %p, null
br i1 %c, label %if.else, label %if.then
if.then:
ret i32 0
diff --git a/llvm/test/Transforms/JumpThreading/or-undef.ll b/llvm/test/Transforms/JumpThreading/or-undef.ll
index b55bdddc196da..54558c1539e33 100644
--- a/llvm/test/Transforms/JumpThreading/or-undef.ll
+++ b/llvm/test/Transforms/JumpThreading/or-undef.ll
@@ -4,41 +4,41 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-darwin11.0"
-define void @test1(i8* %args, i32 %from_tty) nounwind optsize ssp {
+define void @test1(ptr %args, i32 %from_tty) nounwind optsize ssp {
entry:
- %tmp = call i8* @f3(void (i8*)* null, i8* null) nounwind ; <i8*> [#uses=1]
- %tmp1 = icmp eq i8* %args, null ; <i1> [#uses=1]
+ %tmp = call ptr @f3(ptr null, ptr null) nounwind ; <ptr> [#uses=1]
+ %tmp1 = icmp eq ptr %args, null ; <i1> [#uses=1]
br i1 %tmp1, label %bb2, label %bb
; CHECK: entry:
-; CHECK-NEXT: %tmp = call i8* @f3
-; CHECK-NEXT: %tmp1 = icmp eq i8* %args, null
+; CHECK-NEXT: %tmp = call ptr @f3
+; CHECK-NEXT: %tmp1 = icmp eq ptr %args, null
; CHECK-NEXT: br i1 %tmp1, label %bb7, label %bb
bb: ; preds = %entry
- %tmp2 = call noalias i8** @buildargv(i8* %args) nounwind ; <i8**> [#uses=4]
- %tmp3 = icmp eq i8** %tmp2, null ; <i1> [#uses=1]
+ %tmp2 = call noalias ptr @buildargv(ptr %args) nounwind ; <ptr> [#uses=4]
+ %tmp3 = icmp eq ptr %tmp2, null ; <i1> [#uses=1]
br i1 %tmp3, label %bb2, label %bb1
bb1: ; preds = %bb
- call void @f2(i8** %tmp2) nounwind
+ call void @f2(ptr %tmp2) nounwind
br label %bb2
bb2: ; preds = %bb1, %bb, %entry
- %argv.0 = phi i8** [ %tmp2, %bb1 ], [ %tmp2, %bb ], [ undef, %entry ] ; <i8**> [#uses=4]
- %tmp5 = icmp eq i8* %args, null ; <i1> [#uses=1]
- %tmp6 = icmp eq i8** %argv.0, null ; <i1> [#uses=1]
+ %argv.0 = phi ptr [ %tmp2, %bb1 ], [ %tmp2, %bb ], [ undef, %entry ] ; <ptr> [#uses=4]
+ %tmp5 = icmp eq ptr %args, null ; <i1> [#uses=1]
+ %tmp6 = icmp eq ptr %argv.0, null ; <i1> [#uses=1]
%tmp7 = or i1 %tmp5, %tmp6 ; <i1> [#uses=1]
br i1 %tmp7, label %bb7, label %bb5
bb5: ; preds = %bb2
- %tmp8 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1]
- %tmp9 = icmp eq i8* %tmp8, null ; <i1> [#uses=1]
+ %tmp8 = load ptr, ptr %argv.0, align 8 ; <ptr> [#uses=1]
+ %tmp9 = icmp eq ptr %tmp8, null ; <i1> [#uses=1]
br i1 %tmp9, label %bb7, label %bb6
bb6: ; preds = %bb5
- %tmp10 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1]
- %tmp11 = load i8, i8* %tmp10, align 1 ; <i8> [#uses=1]
+ %tmp10 = load ptr, ptr %argv.0, align 8 ; <ptr> [#uses=1]
+ %tmp11 = load i8, ptr %tmp10, align 1 ; <i8> [#uses=1]
%tmp12 = icmp eq i8 %tmp11, 0 ; <i1> [#uses=1]
br i1 %tmp12, label %bb7, label %bb8
@@ -47,23 +47,23 @@ bb7: ; preds = %bb6, %bb5, %bb2
br label %bb9
bb8: ; preds = %bb6
- %tmp13 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1]
- %tmp14 = call i64 @f5(i8* %tmp13) nounwind ; <i64> [#uses=0]
+ %tmp13 = load ptr, ptr %argv.0, align 8 ; <ptr> [#uses=1]
+ %tmp14 = call i64 @f5(ptr %tmp13) nounwind ; <i64> [#uses=0]
br label %bb9
bb9: ; preds = %bb8, %bb7
- call void @f4(i8* %tmp) nounwind
+ call void @f4(ptr %tmp) nounwind
ret void
}
-declare noalias i8** @buildargv(i8*)
+declare noalias ptr @buildargv(ptr)
-declare void @f2(i8**)
+declare void @f2(ptr)
-declare void @f4(i8*)
+declare void @f4(ptr)
-declare i8* @f3(void (i8*)*, i8*)
+declare ptr @f3(ptr, ptr)
declare void @f1()
-declare i64 @f5(i8*)
+declare i64 @f5(ptr)
diff --git a/llvm/test/Transforms/JumpThreading/phi-eq.ll b/llvm/test/Transforms/JumpThreading/phi-eq.ll
index 75e8cc81fed8c..0a0c6899fc60f 100644
--- a/llvm/test/Transforms/JumpThreading/phi-eq.ll
+++ b/llvm/test/Transforms/JumpThreading/phi-eq.ll
@@ -1,31 +1,31 @@
; RUN: opt < %s -jump-threading -S | FileCheck %s
; Test whether two consecutive switches with identical structures assign the
-; proper value to the proper variable. This is really testing
-; Instruction::isIdenticalToWhenDefined, as previously that function was
-; returning true if the value part of the operands of two phis were identical,
+; proper value to the proper variable. This is really testing
+; Instruction::isIdenticalToWhenDefined, as previously that function was
+; returning true if the value part of the operands of two phis were identical,
; even if the incoming blocks were not.
; NB: this function should be pruned down more.
-%struct._GList = type { i8*, %struct._GList*, %struct._GList* }
-%struct.filter_def = type { i8*, i8* }
+%struct._GList = type { ptr, ptr, ptr }
+%struct.filter_def = type { ptr, ptr }
- at capture_filters = external hidden global %struct._GList*, align 8
- at display_filters = external hidden global %struct._GList*, align 8
+ at capture_filters = external hidden global ptr, align 8
+ at display_filters = external hidden global ptr, align 8
@.str2 = external hidden unnamed_addr constant [10 x i8], align 1
@__PRETTY_FUNCTION__.copy_filter_list = external hidden unnamed_addr constant [62 x i8], align 1
@.str12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str13 = external hidden unnamed_addr constant [31 x i8], align 1
- at capture_edited_filters = external hidden global %struct._GList*, align 8
- at display_edited_filters = external hidden global %struct._GList*, align 8
+ at capture_edited_filters = external hidden global ptr, align 8
+ at display_edited_filters = external hidden global ptr, align 8
@__PRETTY_FUNCTION__.get_filter_list = external hidden unnamed_addr constant [44 x i8], align 1
-declare void @g_assertion_message(i8*, i8*, i32, i8*, i8*) noreturn
+declare void @g_assertion_message(ptr, ptr, i32, ptr, ptr) noreturn
-declare void @g_free(i8*)
+declare void @g_free(ptr)
-declare %struct._GList* @g_list_first(%struct._GList*)
+declare ptr @g_list_first(ptr)
-declare noalias i8* @g_malloc(i64)
+declare noalias ptr @g_malloc(i64)
define void @copy_filter_list(i32 %dest_type, i32 %src_type) nounwind uwtable ssp {
entry:
@@ -39,7 +39,7 @@ if.then: ; preds = %do.body
br label %if.end
if.else: ; preds = %do.body
- call void @g_assertion_message_expr(i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str2, i32 0, i32 0), i32 581, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @__PRETTY_FUNCTION__.copy_filter_list, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str12, i32 0, i32 0)) noreturn
+ call void @g_assertion_message_expr(ptr null, ptr @.str2, i32 581, ptr @__PRETTY_FUNCTION__.copy_filter_list, ptr @.str12) noreturn
unreachable
if.end: ; preds = %if.then
@@ -66,11 +66,11 @@ sw.bb3.i: ; preds = %do.end
br label %get_filter_list.exit
sw.default.i: ; preds = %do.end
- call void @g_assertion_message(i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str2, i32 0, i32 0), i32 408, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @__PRETTY_FUNCTION__.get_filter_list, i32 0, i32 0), i8* null) noreturn nounwind
+ call void @g_assertion_message(ptr null, ptr @.str2, i32 408, ptr @__PRETTY_FUNCTION__.get_filter_list, ptr null) noreturn nounwind
unreachable
get_filter_list.exit: ; preds = %sw.bb3.i, %sw.bb2.i, %sw.bb1.i, %sw.bb.i
- %0 = phi %struct._GList** [ @display_edited_filters, %sw.bb3.i ], [ @capture_edited_filters, %sw.bb2.i ], [ @display_filters, %sw.bb1.i ], [ @capture_filters, %sw.bb.i ]
+ %0 = phi ptr [ @display_edited_filters, %sw.bb3.i ], [ @capture_edited_filters, %sw.bb2.i ], [ @display_filters, %sw.bb1.i ], [ @capture_filters, %sw.bb.i ]
switch i32 %src_type, label %sw.default.i5 [
i32 0, label %sw.bb.i1
i32 1, label %sw.bb1.i2
@@ -91,53 +91,49 @@ sw.bb3.i4: ; preds = %get_filter_list.exi
br label %get_filter_list.exit6
sw.default.i5: ; preds = %get_filter_list.exit
- call void @g_assertion_message(i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str2, i32 0, i32 0), i32 408, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @__PRETTY_FUNCTION__.get_filter_list, i32 0, i32 0), i8* null) noreturn nounwind
+ call void @g_assertion_message(ptr null, ptr @.str2, i32 408, ptr @__PRETTY_FUNCTION__.get_filter_list, ptr null) noreturn nounwind
unreachable
; CHECK: get_filter_list.exit
get_filter_list.exit6: ; preds = %sw.bb3.i4, %sw.bb2.i3, %sw.bb1.i2, %sw.bb.i1
- %1 = phi %struct._GList** [ @display_edited_filters, %sw.bb3.i4 ], [ @capture_edited_filters, %sw.bb2.i3 ], [ @display_filters, %sw.bb1.i2 ], [ @capture_filters, %sw.bb.i1 ]
+ %1 = phi ptr [ @display_edited_filters, %sw.bb3.i4 ], [ @capture_edited_filters, %sw.bb2.i3 ], [ @display_filters, %sw.bb1.i2 ], [ @capture_filters, %sw.bb.i1 ]
; CHECK: %2 = load
- %2 = load %struct._GList*, %struct._GList** %1, align 8
+ %2 = load ptr, ptr %1, align 8
; We should have jump-threading insert an additional load here for the value
; coming out of the first switch, which is picked up by a subsequent phi
-; CHECK: %.pr = load %struct._GList*, %struct._GList** %0
+; CHECK: %.pr = load ptr, ptr %0
; CHECK-NEXT: br label %while.cond
br label %while.cond
; CHECK: while.cond
while.cond: ; preds = %while.body, %get_filter_list.exit6
; CHECK: {{= phi .*%.pr}}
- %3 = load %struct._GList*, %struct._GList** %0, align 8
+ %3 = load ptr, ptr %0, align 8
; CHECK: tobool
- %tobool = icmp ne %struct._GList* %3, null
+ %tobool = icmp ne ptr %3, null
br i1 %tobool, label %while.body, label %while.end
while.body: ; preds = %while.cond
- %4 = load %struct._GList*, %struct._GList** %0, align 8
- %5 = load %struct._GList*, %struct._GList** %0, align 8
- %call2 = call %struct._GList* @g_list_first(%struct._GList* %5)
- %data.i = getelementptr inbounds %struct._GList, %struct._GList* %call2, i32 0, i32 0
- %6 = load i8*, i8** %data.i, align 8
- %7 = bitcast i8* %6 to %struct.filter_def*
- %name.i = getelementptr inbounds %struct.filter_def, %struct.filter_def* %7, i32 0, i32 0
- %8 = load i8*, i8** %name.i, align 8
- call void @g_free(i8* %8) nounwind
- %strval.i = getelementptr inbounds %struct.filter_def, %struct.filter_def* %7, i32 0, i32 1
- %9 = load i8*, i8** %strval.i, align 8
- call void @g_free(i8* %9) nounwind
- %10 = bitcast %struct.filter_def* %7 to i8*
- call void @g_free(i8* %10) nounwind
- %call.i = call %struct._GList* @g_list_remove_link(%struct._GList* %4, %struct._GList* %call2) nounwind
- store %struct._GList* %call.i, %struct._GList** %0, align 8
+ %4 = load ptr, ptr %0, align 8
+ %5 = load ptr, ptr %0, align 8
+ %call2 = call ptr @g_list_first(ptr %5)
+ %6 = load ptr, ptr %call2, align 8
+ %7 = load ptr, ptr %6, align 8
+ call void @g_free(ptr %7) nounwind
+ %strval.i = getelementptr inbounds %struct.filter_def, ptr %6, i32 0, i32 1
+ %8 = load ptr, ptr %strval.i, align 8
+ call void @g_free(ptr %8) nounwind
+ call void @g_free(ptr %6) nounwind
+ %call.i = call ptr @g_list_remove_link(ptr %4, ptr %call2) nounwind
+ store ptr %call.i, ptr %0, align 8
br label %while.cond
while.end: ; preds = %while.cond
br label %do.body4
do.body4: ; preds = %while.end
- %11 = load %struct._GList*, %struct._GList** %0, align 8
- %call5 = call i32 @g_list_length(%struct._GList* %11)
+ %9 = load ptr, ptr %0, align 8
+ %call5 = call i32 @g_list_length(ptr %9)
%cmp6 = icmp eq i32 %call5, 0
br i1 %cmp6, label %if.then7, label %if.else8
@@ -145,7 +141,7 @@ if.then7: ; preds = %do.body4
br label %if.end9
if.else8: ; preds = %do.body4
- call void @g_assertion_message_expr(i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str2, i32 0, i32 0), i32 600, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @__PRETTY_FUNCTION__.copy_filter_list, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str13, i32 0, i32 0)) noreturn
+ call void @g_assertion_message_expr(ptr null, ptr @.str2, i32 600, ptr @__PRETTY_FUNCTION__.copy_filter_list, ptr @.str13) noreturn
unreachable
if.end9: ; preds = %if.then7
@@ -155,55 +151,49 @@ do.end10: ; preds = %if.end9
br label %while.cond11
while.cond11: ; preds = %cond.end, %do.end10
- %cond10 = phi %struct._GList* [ %cond, %cond.end ], [ %2, %do.end10 ]
- %tobool12 = icmp ne %struct._GList* %cond10, null
+ %cond10 = phi ptr [ %cond, %cond.end ], [ %2, %do.end10 ]
+ %tobool12 = icmp ne ptr %cond10, null
br i1 %tobool12, label %while.body13, label %while.end16
while.body13: ; preds = %while.cond11
- %data = getelementptr inbounds %struct._GList, %struct._GList* %cond10, i32 0, i32 0
- %12 = load i8*, i8** %data, align 8
- %13 = bitcast i8* %12 to %struct.filter_def*
- %14 = load %struct._GList*, %struct._GList** %0, align 8
- %name = getelementptr inbounds %struct.filter_def, %struct.filter_def* %13, i32 0, i32 0
- %15 = load i8*, i8** %name, align 8
- %strval = getelementptr inbounds %struct.filter_def, %struct.filter_def* %13, i32 0, i32 1
- %16 = load i8*, i8** %strval, align 8
- %call.i7 = call noalias i8* @g_malloc(i64 16) nounwind
- %17 = bitcast i8* %call.i7 to %struct.filter_def*
- %call1.i = call noalias i8* @g_strdup(i8* %15) nounwind
- %name.i8 = getelementptr inbounds %struct.filter_def, %struct.filter_def* %17, i32 0, i32 0
- store i8* %call1.i, i8** %name.i8, align 8
- %call2.i = call noalias i8* @g_strdup(i8* %16) nounwind
- %strval.i9 = getelementptr inbounds %struct.filter_def, %struct.filter_def* %17, i32 0, i32 1
- store i8* %call2.i, i8** %strval.i9, align 8
- %18 = bitcast %struct.filter_def* %17 to i8*
- %call3.i = call %struct._GList* @g_list_append(%struct._GList* %14, i8* %18) nounwind
- store %struct._GList* %call3.i, %struct._GList** %0, align 8
- %tobool15 = icmp ne %struct._GList* %cond10, null
+ %10 = load ptr, ptr %cond10, align 8
+ %11 = load ptr, ptr %0, align 8
+ %12 = load ptr, ptr %10, align 8
+ %strval = getelementptr inbounds %struct.filter_def, ptr %10, i32 0, i32 1
+ %13 = load ptr, ptr %strval, align 8
+ %call.i7 = call noalias ptr @g_malloc(i64 16) nounwind
+ %call1.i = call noalias ptr @g_strdup(ptr %12) nounwind
+ store ptr %call1.i, ptr %call.i7, align 8
+ %call2.i = call noalias ptr @g_strdup(ptr %13) nounwind
+ %strval.i9 = getelementptr inbounds %struct.filter_def, ptr %call.i7, i32 0, i32 1
+ store ptr %call2.i, ptr %strval.i9, align 8
+ %call3.i = call ptr @g_list_append(ptr %11, ptr %call.i7) nounwind
+ store ptr %call3.i, ptr %0, align 8
+ %tobool15 = icmp ne ptr %cond10, null
br i1 %tobool15, label %cond.true, label %cond.false
cond.true: ; preds = %while.body13
- %next = getelementptr inbounds %struct._GList, %struct._GList* %cond10, i32 0, i32 1
- %19 = load %struct._GList*, %struct._GList** %next, align 8
+ %next = getelementptr inbounds %struct._GList, ptr %cond10, i32 0, i32 1
+ %14 = load ptr, ptr %next, align 8
br label %cond.end
cond.false: ; preds = %while.body13
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
- %cond = phi %struct._GList* [ %19, %cond.true ], [ null, %cond.false ]
+ %cond = phi ptr [ %14, %cond.true ], [ null, %cond.false ]
br label %while.cond11
while.end16: ; preds = %while.cond11
ret void
}
-declare void @g_assertion_message_expr(i8*, i8*, i32, i8*, i8*) noreturn
+declare void @g_assertion_message_expr(ptr, ptr, i32, ptr, ptr) noreturn
-declare i32 @g_list_length(%struct._GList*)
+declare i32 @g_list_length(ptr)
-declare noalias i8* @g_strdup(i8*)
+declare noalias ptr @g_strdup(ptr)
-declare %struct._GList* @g_list_append(%struct._GList*, i8*)
+declare ptr @g_list_append(ptr, ptr)
-declare %struct._GList* @g_list_remove_link(%struct._GList*, %struct._GList*)
+declare ptr @g_list_remove_link(ptr, ptr)
diff --git a/llvm/test/Transforms/JumpThreading/phi-known.ll b/llvm/test/Transforms/JumpThreading/phi-known.ll
index 3473806c0a64d..72be8dc2d4645 100644
--- a/llvm/test/Transforms/JumpThreading/phi-known.ll
+++ b/llvm/test/Transforms/JumpThreading/phi-known.ll
@@ -2,43 +2,41 @@
; Value of predicate known on all inputs (trivial case)
; Note: InstCombine/EarlyCSE would also get this case
-define void @test(i8* %p, i8** %addr) {
+define void @test(ptr %p, ptr %addr) {
; CHECK-LABEL: @test
entry:
- %cmp0 = icmp eq i8* %p, null
+ %cmp0 = icmp eq ptr %p, null
br i1 %cmp0, label %exit, label %loop
loop:
; CHECK-LABEL: loop:
; CHECK-NEXT: phi
; CHECK-NEXT: br label %loop
- %p1 = phi i8* [%p, %entry], [%p1, %loop]
- %cmp1 = icmp eq i8* %p1, null
+ %p1 = phi ptr [%p, %entry], [%p1, %loop]
+ %cmp1 = icmp eq ptr %p1, null
br i1 %cmp1, label %exit, label %loop
exit:
ret void
}
; Value of predicate known on all inputs (non-trivial)
-define void @test2(i8* %p) {
+define void @test2(ptr %p) {
; CHECK-LABEL: @test2
entry:
- %cmp0 = icmp eq i8* %p, null
+ %cmp0 = icmp eq ptr %p, null
br i1 %cmp0, label %exit, label %loop
loop:
- %p1 = phi i8* [%p, %entry], [%p2, %backedge]
- %cmp1 = icmp eq i8* %p1, null
+ %p1 = phi ptr [%p, %entry], [%p2, %backedge]
+ %cmp1 = icmp eq ptr %p1, null
br i1 %cmp1, label %exit, label %backedge
backedge:
; CHECK-LABEL: backedge:
; CHECK-NEXT: phi
-; CHECK-NEXT: bitcast
; CHECK-NEXT: load
; CHECK-NEXT: cmp
-; CHECK-NEXT: br
+; CHECK-NEXT: br
; CHECK-DAG: label %backedge
- %addr = bitcast i8* %p1 to i8**
- %p2 = load i8*, i8** %addr
- %cmp2 = icmp eq i8* %p2, null
+ %p2 = load ptr, ptr %p1
+ %cmp2 = icmp eq ptr %p2, null
br i1 %cmp2, label %exit, label %loop
exit:
ret void
@@ -47,18 +45,18 @@ exit:
; If the inputs don't branch the same way, we can't rewrite
; Well, we could unroll this loop exactly twice, but that's
; a
diff erent transform.
-define void @test_mixed(i8* %p) {
+define void @test_mixed(ptr %p) {
; CHECK-LABEL: @test_mixed
entry:
- %cmp0 = icmp eq i8* %p, null
+ %cmp0 = icmp eq ptr %p, null
br i1 %cmp0, label %exit, label %loop
loop:
; CHECK-LABEL: loop:
; CHECK-NEXT: phi
; CHECK-NEXT: %cmp1 = icmp
; CHECK-NEXT: br i1 %cmp1
- %p1 = phi i8* [%p, %entry], [%p1, %loop]
- %cmp1 = icmp ne i8* %p1, null
+ %p1 = phi ptr [%p, %entry], [%p1, %loop]
+ %cmp1 = icmp ne ptr %p1, null
br i1 %cmp1, label %exit, label %loop
exit:
ret void
@@ -70,21 +68,21 @@ exit:
declare void @goo()
declare void @hoo()
-define void @test3(i32 %m, i32** %t1) {
+define void @test3(i32 %m, ptr %t1) {
L1:
%t0 = add i32 %m, 7
- %t2 = load i32*, i32** %t1, align 8
+ %t2 = load ptr, ptr %t1, align 8
; CHECK-LABEL: @test3
-; CHECK: %t3 = icmp eq i32* %t2, null
+; CHECK: %t3 = icmp eq ptr %t2, null
; CHECK: br i1 %t3, label %[[LABEL2:.*]], label %[[LABEL1:.*]]
- %t3 = icmp eq i32* %t2, null
+ %t3 = icmp eq ptr %t2, null
br i1 %t3, label %L3, label %L2
; CHECK: [[LABEL1]]:
-; CHECK-NEXT: %t4 = load i32, i32* %t2, align 4
+; CHECK-NEXT: %t4 = load i32, ptr %t2, align 4
L2:
- %t4 = load i32, i32* %t2, align 4
+ %t4 = load i32, ptr %t2, align 4
br label %L3
L3:
diff --git a/llvm/test/Transforms/JumpThreading/pr27840.ll b/llvm/test/Transforms/JumpThreading/pr27840.ll
index cbee2af67fae5..5a05b98aa816d 100644
--- a/llvm/test/Transforms/JumpThreading/pr27840.ll
+++ b/llvm/test/Transforms/JumpThreading/pr27840.ll
@@ -7,7 +7,7 @@ declare void @helper()
declare i32 @__gxx_personality_v0(...)
-define void @pr27840(i8* %call, i1 %A) personality i32(...)* @__gxx_personality_v0 {
+define void @pr27840(ptr %call, i1 %A) personality ptr @__gxx_personality_v0 {
entry:
invoke void @helper()
to label %invoke.cont unwind label %lpad
@@ -23,7 +23,7 @@ invoke.cont:
lpad:
%b = phi i1 [ true, %invoke.cont ], [ false, %entry ]
- landingpad { i8*, i32 }
+ landingpad { ptr, i32 }
cleanup
%xor = xor i1 %b, %A
br i1 %xor, label %nowhere, label %invoke.cont
diff --git a/llvm/test/Transforms/JumpThreading/pr33605.ll b/llvm/test/Transforms/JumpThreading/pr33605.ll
index e1cd80952961b..1d64525f11576 100644
--- a/llvm/test/Transforms/JumpThreading/pr33605.ll
+++ b/llvm/test/Transforms/JumpThreading/pr33605.ll
@@ -28,7 +28,7 @@
; CHECK-NOT: br label %for.cond
; CHECK: if.end:
; CHECK: br label %for.cond
-define i1 @test(i32 %a, i32 %b, i32* %c) {
+define i1 @test(i32 %a, i32 %b, ptr %c) {
entry:
br label %for.cond
@@ -46,13 +46,13 @@ for.cond.cleanup: ; preds = %for.cond
for.body: ; preds = %for.cond
%or = or i32 %a, %b
%idxprom = sext i32 %dec to i64
- %arrayidx = getelementptr inbounds i32, i32* %c, i64 %idxprom
- %0 = load i32, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %c, i64 %idxprom
+ %0 = load i32, ptr %arrayidx, align 4
%cmp = icmp eq i32 %or, %0
br i1 %cmp, label %if.end, label %if.then
if.then: ; preds = %for.body
- store i32 %or, i32* %arrayidx, align 4
+ store i32 %or, ptr %arrayidx, align 4
call void @foo()
br label %if.end
diff --git a/llvm/test/Transforms/JumpThreading/pr33917.ll b/llvm/test/Transforms/JumpThreading/pr33917.ll
index 30652279a0e10..2264466452a8c 100644
--- a/llvm/test/Transforms/JumpThreading/pr33917.ll
+++ b/llvm/test/Transforms/JumpThreading/pr33917.ll
@@ -4,24 +4,24 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-declare i8* @foo()
+declare ptr @foo()
declare i32 @rust_eh_personality() unnamed_addr
; Function Attrs: nounwind
declare void @llvm.assume(i1) #0
-define void @patatino() personality i32 ()* @rust_eh_personality {
+define void @patatino() personality ptr @rust_eh_personality {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: bb9:
-; CHECK-NEXT: [[T9:%.*]] = invoke i8* @foo()
+; CHECK-NEXT: [[T9:%.*]] = invoke ptr @foo()
; CHECK-NEXT: to label [[GOOD:%.*]] unwind label [[BAD:%.*]]
; CHECK: bad:
-; CHECK-NEXT: [[T10:%.*]] = landingpad { i8*, i32 }
+; CHECK-NEXT: [[T10:%.*]] = landingpad { ptr, i32 }
; CHECK-NEXT: cleanup
-; CHECK-NEXT: resume { i8*, i32 } [[T10]]
+; CHECK-NEXT: resume { ptr, i32 } [[T10]]
; CHECK: good:
-; CHECK-NEXT: [[T11:%.*]] = icmp ne i8* [[T9]], null
+; CHECK-NEXT: [[T11:%.*]] = icmp ne ptr [[T9]], null
; CHECK-NEXT: [[T12:%.*]] = zext i1 [[T11]] to i64
; CHECK-NEXT: [[COND:%.*]] = icmp eq i64 [[T12]], 1
; CHECK-NEXT: br i1 [[COND]], label [[IF_TRUE:%.*]], label [[DONE:%.*]]
@@ -32,16 +32,16 @@ define void @patatino() personality i32 ()* @rust_eh_personality {
; CHECK-NEXT: ret void
;
bb9:
- %t9 = invoke i8* @foo()
+ %t9 = invoke ptr @foo()
to label %good unwind label %bad
bad:
- %t10 = landingpad { i8*, i32 }
+ %t10 = landingpad { ptr, i32 }
cleanup
- resume { i8*, i32 } %t10
+ resume { ptr, i32 } %t10
good:
- %t11 = icmp ne i8* %t9, null
+ %t11 = icmp ne ptr %t9, null
%t12 = zext i1 %t11 to i64
%cond = icmp eq i64 %t12, 1
br i1 %cond, label %if_true, label %done
diff --git a/llvm/test/Transforms/JumpThreading/pr36133.ll b/llvm/test/Transforms/JumpThreading/pr36133.ll
index b8d8c5fac4629..b593116dd1335 100644
--- a/llvm/test/Transforms/JumpThreading/pr36133.ll
+++ b/llvm/test/Transforms/JumpThreading/pr36133.ll
@@ -1,5 +1,5 @@
; RUN: opt -jump-threading -S < %s | FileCheck %s
- at global = external global i8*, align 8
+ at global = external global ptr, align 8
define i32 @foo(i32 %arg) {
; CHECK-LABEL: @foo
@@ -7,8 +7,8 @@ define i32 @foo(i32 %arg) {
; CHECK: icmp eq
; CHECK-NEXT: br i1 %tmp1, label %bb7, label %bb7
bb:
- %tmp = load i8*, i8** @global, align 8
- %tmp1 = icmp eq i8* %tmp, null
+ %tmp = load ptr, ptr @global, align 8
+ %tmp1 = icmp eq ptr %tmp, null
br i1 %tmp1, label %bb3, label %bb2
; CHECK-NOT: bb2:
diff --git a/llvm/test/Transforms/JumpThreading/pr40992-indirectbr-folding.ll b/llvm/test/Transforms/JumpThreading/pr40992-indirectbr-folding.ll
index b94d4c1b701a7..e4dadd303dc11 100644
--- a/llvm/test/Transforms/JumpThreading/pr40992-indirectbr-folding.ll
+++ b/llvm/test/Transforms/JumpThreading/pr40992-indirectbr-folding.ll
@@ -17,10 +17,10 @@ bb1:
; CHECK: bb2:
; CHECK-NEXT: select
-; CHECK-NEXT: indirectbr i8* %ba, [label %bb3, label %bb5]
+; CHECK-NEXT: indirectbr ptr %ba, [label %bb3, label %bb5]
bb2:
- %ba = select i1 %v3, i8* blockaddress(@jtbr, %bb3), i8* blockaddress(@jtbr, %bb4)
- indirectbr i8* %ba, [label %bb3, label %bb4]
+ %ba = select i1 %v3, ptr blockaddress(@jtbr, %bb3), ptr blockaddress(@jtbr, %bb4)
+ indirectbr ptr %ba, [label %bb3, label %bb4]
; CHECK: bb3:
bb3:
diff --git a/llvm/test/Transforms/JumpThreading/pr43276.ll b/llvm/test/Transforms/JumpThreading/pr43276.ll
index 3d933867e7da3..a0f544e300b6c 100644
--- a/llvm/test/Transforms/JumpThreading/pr43276.ll
+++ b/llvm/test/Transforms/JumpThreading/pr43276.ll
@@ -4,30 +4,28 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
target triple = "x86_64-unknown-linux-gnu"
- at global = external global i8*
+ at global = external global ptr
define i32 @wibble() {
; CHECK-LABEL: @wibble(
; CHECK-NEXT: bb19:
-; CHECK-NEXT: [[TMP20:%.*]] = getelementptr i8, i8* undef, i64 16
-; CHECK-NEXT: [[TMP21:%.*]] = load atomic i8*, i8** @global unordered, align 8
-; CHECK-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, i8* [[TMP21]], i64 936
+; CHECK-NEXT: [[TMP20:%.*]] = getelementptr i8, ptr undef, i64 16
+; CHECK-NEXT: [[TMP21:%.*]] = load atomic ptr, ptr @global unordered, align 8
+; CHECK-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, ptr [[TMP21]], i64 936
; CHECK-NEXT: br label [[BB3:%.*]]
; CHECK: bb2:
; CHECK-NEXT: br label [[BB3]]
; CHECK: bb3:
-; CHECK-NEXT: [[TMP:%.*]] = phi i8* [ [[TMP22]], [[BB19:%.*]] ], [ undef, [[BB2:%.*]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi i8* [ [[TMP21]], [[BB19]] ], [ undef, [[BB2]] ]
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP]] to i64*
-; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, i8* [[TMP4]], i64 848
-; CHECK-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to i8**
+; CHECK-NEXT: [[TMP:%.*]] = phi ptr [ [[TMP22]], [[BB19:%.*]] ], [ undef, [[BB2:%.*]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi ptr [ [[TMP21]], [[BB19]] ], [ undef, [[BB2]] ]
+; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i8, ptr [[TMP4]], i64 848
; CHECK-NEXT: br label [[BB11:%.*]]
; CHECK: bb11:
-; CHECK-NEXT: [[TMP12:%.*]] = load atomic i8*, i8** [[TMP7]] unordered, align 8
-; CHECK-NEXT: [[TMP13:%.*]] = icmp eq i8* [[TMP12]], null
+; CHECK-NEXT: [[TMP12:%.*]] = load atomic ptr, ptr [[TMP6]] unordered, align 8
+; CHECK-NEXT: [[TMP13:%.*]] = icmp eq ptr [[TMP12]], null
; CHECK-NEXT: br i1 [[TMP13]], label [[BB17:%.*]], label [[BB16:%.*]]
; CHECK: bb16:
-; CHECK-NEXT: store atomic i64 undef, i64* [[TMP5]] unordered, align 8
+; CHECK-NEXT: store atomic i64 undef, ptr [[TMP]] unordered, align 8
; CHECK-NEXT: br label [[BB11]]
; CHECK: bb17:
; CHECK-NEXT: ret i32 undef
@@ -42,16 +40,14 @@ bb2: ; No predecessors!
br label %bb3
bb3: ; preds = %bb19, %bb2
- %tmp = phi i8* [ %tmp22, %bb19 ], [ undef, %bb2 ]
- %tmp4 = phi i8* [ %tmp21, %bb19 ], [ undef, %bb2 ]
- %tmp5 = bitcast i8* %tmp to i64*
- %tmp6 = getelementptr inbounds i8, i8* %tmp4, i64 848
- %tmp7 = bitcast i8* %tmp6 to i8**
+ %tmp = phi ptr [ %tmp22, %bb19 ], [ undef, %bb2 ]
+ %tmp4 = phi ptr [ %tmp21, %bb19 ], [ undef, %bb2 ]
+ %tmp6 = getelementptr inbounds i8, ptr %tmp4, i64 848
br label %bb11
bb11: ; preds = %bb16, %bb3
- %tmp12 = load atomic i8*, i8** %tmp7 unordered, align 8
- %tmp13 = icmp eq i8* %tmp12, null
+ %tmp12 = load atomic ptr, ptr %tmp6 unordered, align 8
+ %tmp13 = icmp eq ptr %tmp12, null
br i1 %tmp13, label %bb17, label %bb14
bb14: ; preds = %bb11
@@ -61,7 +57,7 @@ bb15: ; preds = %bb14
br label %bb16
bb16: ; preds = %bb15
- store atomic i64 undef, i64* %tmp5 unordered, align 8
+ store atomic i64 undef, ptr %tmp unordered, align 8
br label %bb11
bb17: ; preds = %bb11
@@ -71,13 +67,13 @@ bb18: ; preds = %bb1
br label %bb19
bb19: ; preds = %bb18
- %tmp20 = getelementptr i8, i8* undef, i64 16
- %tmp21 = load atomic i8*, i8** @global unordered, align 8
- %tmp22 = getelementptr inbounds i8, i8* %tmp21, i64 936
+ %tmp20 = getelementptr i8, ptr undef, i64 16
+ %tmp21 = load atomic ptr, ptr @global unordered, align 8
+ %tmp22 = getelementptr inbounds i8, ptr %tmp21, i64 936
br label %bb3
}
-define void @zot(i8* align 8 dereferenceable_or_null(16) %arg, i32 %arg1) {
+define void @zot(ptr align 8 dereferenceable_or_null(16) %arg, i32 %arg1) {
; CHECK-LABEL: @zot(
; CHECK-NEXT: bb:
; CHECK-NEXT: ret void
diff --git a/llvm/test/Transforms/JumpThreading/pre-load.ll b/llvm/test/Transforms/JumpThreading/pre-load.ll
index d5df3acf6f7a1..c326b6a2f7f80 100644
--- a/llvm/test/Transforms/JumpThreading/pre-load.ll
+++ b/llvm/test/Transforms/JumpThreading/pre-load.ll
@@ -11,10 +11,10 @@ define i32 @pre(i1 %cond, i32 %n) {
; CHECK-LABEL: @pre(
; CHECK-NEXT: br i1 [[COND:%.*]], label [[C_THREAD:%.*]], label [[C:%.*]]
; CHECK: C.thread:
-; CHECK-NEXT: store i32 0, i32* @x, align 4
+; CHECK-NEXT: store i32 0, ptr @x, align 4
; CHECK-NEXT: br label [[YES:%.*]]
; CHECK: C:
-; CHECK-NEXT: [[A_PR:%.*]] = load i32, i32* @y, align 4
+; CHECK-NEXT: [[A_PR:%.*]] = load i32, ptr @y, align 4
; CHECK-NEXT: [[COND2:%.*]] = icmp eq i32 [[A_PR]], 0
; CHECK-NEXT: br i1 [[COND2]], label [[YES]], label [[NO:%.*]]
; CHECK: YES:
@@ -27,13 +27,13 @@ define i32 @pre(i1 %cond, i32 %n) {
;
br i1 %cond, label %A, label %B
A:
- store i32 0, i32* @x
+ store i32 0, ptr @x
br label %C
B:
br label %C
C:
- %ptr = phi i32* [@x, %A], [@y, %B]
- %a = load i32, i32* %ptr
+ %ptr = phi ptr [@x, %A], [@y, %B]
+ %a = load i32, ptr %ptr
%cond2 = icmp eq i32 %a, 0
br i1 %cond2, label %YES, label %NO
YES:
@@ -48,10 +48,10 @@ define i32 @pre_freeze(i1 %cond, i32 %n) {
; CHECK-LABEL: @pre_freeze(
; CHECK-NEXT: br i1 [[COND:%.*]], label [[C_THREAD:%.*]], label [[C:%.*]]
; CHECK: C.thread:
-; CHECK-NEXT: store i32 0, i32* @x, align 4
+; CHECK-NEXT: store i32 0, ptr @x, align 4
; CHECK-NEXT: br label [[YES:%.*]]
; CHECK: C:
-; CHECK-NEXT: [[A_PR:%.*]] = load i32, i32* @y, align 4
+; CHECK-NEXT: [[A_PR:%.*]] = load i32, ptr @y, align 4
; CHECK-NEXT: [[COND2:%.*]] = icmp eq i32 [[A_PR]], 0
; CHECK-NEXT: [[COND2_FR:%.*]] = freeze i1 [[COND2]]
; CHECK-NEXT: br i1 [[COND2_FR]], label [[YES]], label [[NO:%.*]]
@@ -65,13 +65,13 @@ define i32 @pre_freeze(i1 %cond, i32 %n) {
;
br i1 %cond, label %A, label %B
A:
- store i32 0, i32* @x
+ store i32 0, ptr @x
br label %C
B:
br label %C
C:
- %ptr = phi i32* [@x, %A], [@y, %B]
- %a = load i32, i32* %ptr
+ %ptr = phi ptr [@x, %A], [@y, %B]
+ %a = load i32, ptr %ptr
%cond2 = icmp eq i32 %a, 0
%cond2.fr = freeze i1 %cond2
br i1 %cond2.fr, label %YES, label %NO
diff --git a/llvm/test/Transforms/JumpThreading/select.ll b/llvm/test/Transforms/JumpThreading/select.ll
index 4c50be4f01309..2c9fb4882ba6f 100644
--- a/llvm/test/Transforms/JumpThreading/select.ll
+++ b/llvm/test/Transforms/JumpThreading/select.ll
@@ -89,16 +89,16 @@ L4:
; Make sure the blocks in the indirectbr test aren't trivially removable as
; successors by taking their addresses.
- at anchor = constant [3 x i8*] [
- i8* blockaddress(@test_indirectbr, %L1),
- i8* blockaddress(@test_indirectbr, %L2),
- i8* blockaddress(@test_indirectbr, %L3)
+ at anchor = constant [3 x ptr] [
+ ptr blockaddress(@test_indirectbr, %L1),
+ ptr blockaddress(@test_indirectbr, %L2),
+ ptr blockaddress(@test_indirectbr, %L3)
]
; Jump threading of indirectbr with select as address.
-define void @test_indirectbr(i1 %cond, i8* %address) nounwind {
+define void @test_indirectbr(i1 %cond, ptr %address) nounwind {
; CHECK-LABEL: @test_indirectbr(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[COND:%.*]], label [[L1:%.*]], label [[L3:%.*]]
@@ -112,8 +112,8 @@ define void @test_indirectbr(i1 %cond, i8* %address) nounwind {
entry:
br i1 %cond, label %L0, label %L3
L0:
- %indirect.goto.dest = select i1 %cond, i8* blockaddress(@test_indirectbr, %L1), i8* %address
- indirectbr i8* %indirect.goto.dest, [label %L1, label %L2, label %L3]
+ %indirect.goto.dest = select i1 %cond, ptr blockaddress(@test_indirectbr, %L1), ptr %address
+ indirectbr ptr %indirect.goto.dest, [label %L1, label %L2, label %L3]
L1:
call void @foo()
@@ -131,7 +131,7 @@ L3:
; duplication threshold for cases where indirectbr is being threaded
; through.
-define void @test_indirectbr_thresh(i1 %cond, i8* %address) nounwind {
+define void @test_indirectbr_thresh(i1 %cond, ptr %address) nounwind {
; CHECK-LABEL: @test_indirectbr_thresh(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[COND:%.*]], label [[L1:%.*]], label [[L3:%.*]]
@@ -148,11 +148,11 @@ define void @test_indirectbr_thresh(i1 %cond, i8* %address) nounwind {
entry:
br i1 %cond, label %L0, label %L3
L0:
- %indirect.goto.dest = select i1 %cond, i8* blockaddress(@test_indirectbr_thresh, %L1), i8* %address
+ %indirect.goto.dest = select i1 %cond, ptr blockaddress(@test_indirectbr_thresh, %L1), ptr %address
call void @quux()
call void @quux()
call void @quux()
- indirectbr i8* %indirect.goto.dest, [label %L1, label %L2, label %L3]
+ indirectbr ptr %indirect.goto.dest, [label %L1, label %L2, label %L3]
L1:
call void @foo()
@@ -220,45 +220,45 @@ L4:
; Make sure the edge value of %0 from entry to L2 includes 0 and L3 is
; reachable.
-define void @test_switch_default(i32* nocapture %status) nounwind {
+define void @test_switch_default(ptr nocapture %status) nounwind {
; CHECK-LABEL: @test_switch_default(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[STATUS:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[STATUS:%.*]], align 4
; CHECK-NEXT: switch i32 [[TMP0]], label [[L2:%.*]] [
; CHECK-NEXT: i32 5061, label [[L2_THREAD:%.*]]
; CHECK-NEXT: i32 0, label [[L2]]
; CHECK-NEXT: ]
; CHECK: L2.thread:
-; CHECK-NEXT: store i32 10025, i32* [[STATUS]], align 4
+; CHECK-NEXT: store i32 10025, ptr [[STATUS]], align 4
; CHECK-NEXT: br label [[L4:%.*]]
; CHECK: L2:
; CHECK-NEXT: [[TMP1:%.*]] = phi i32 [ [[TMP0]], [[ENTRY:%.*]] ], [ [[TMP0]], [[ENTRY]] ]
; CHECK-NEXT: [[CMP57_I:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[CMP57_I]], label [[L3:%.*]], label [[L4]]
; CHECK: L3:
-; CHECK-NEXT: store i32 10000, i32* [[STATUS]], align 4
+; CHECK-NEXT: store i32 10000, ptr [[STATUS]], align 4
; CHECK-NEXT: br label [[L4]]
; CHECK: L4:
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %status, align 4
+ %0 = load i32, ptr %status, align 4
switch i32 %0, label %L2 [
i32 5061, label %L1
i32 0, label %L2
]
L1:
- store i32 10025, i32* %status, align 4
+ store i32 10025, ptr %status, align 4
br label %L2
L2:
- %1 = load i32, i32* %status, align 4
+ %1 = load i32, ptr %status, align 4
%cmp57.i = icmp eq i32 %1, 0
br i1 %cmp57.i, label %L3, label %L4
L3:
- store i32 10000, i32* %status, align 4
+ store i32 10000, ptr %status, align 4
br label %L4
L4:
@@ -522,7 +522,7 @@ cond.false.15.i: ; preds = %cond.false.10.i
; When a select has a constant operand in one branch, and it feeds a phi node
; and the phi node feeds a switch we unfold the select
-define void @test_func(i32* nocapture readonly %a, i32* nocapture readonly %b, i32* nocapture readonly %c, i32 %n) local_unnamed_addr #0 {
+define void @test_func(ptr nocapture readonly %a, ptr nocapture readonly %b, ptr nocapture readonly %c, i32 %n) local_unnamed_addr #0 {
; CHECK-LABEL: @test_func(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_COND:%.*]]
@@ -534,15 +534,15 @@ define void @test_func(i32* nocapture readonly %a, i32* nocapture readonly %b, i
; CHECK-NEXT: ret void
; CHECK: for.body:
; CHECK-NEXT: [[TMP0:%.*]] = zext i32 [[I_0]] to i64
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[TMP0]]
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[TMP0]]
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP1]], 4
; CHECK-NEXT: br i1 [[CMP1]], label [[LAND_LHS_TRUE:%.*]], label [[IF_END:%.*]]
; CHECK: land.lhs.true:
-; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i32, i32* [[B:%.*]], i64 [[TMP0]]
-; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX3]], align 4
-; CHECK-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds i32, i32* [[C:%.*]], i64 [[TMP0]]
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX5]], align 4
+; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i32, ptr [[B:%.*]], i64 [[TMP0]]
+; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX3]], align 4
+; CHECK-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds i32, ptr [[C:%.*]], i64 [[TMP0]]
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARRAYIDX5]], align 4
; CHECK-NEXT: [[CMP6:%.*]] = icmp eq i32 [[TMP2]], [[TMP3]]
; CHECK-NEXT: br i1 [[CMP6]], label [[SW_BB:%.*]], label [[SW_BB7:%.*]]
; CHECK: if.end:
@@ -583,16 +583,16 @@ for.cond.cleanup: ; preds = %for.cond
for.body: ; preds = %for.cond
%0 = zext i32 %i.0 to i64
- %arrayidx = getelementptr inbounds i32, i32* %a, i64 %0
- %1 = load i32, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %a, i64 %0
+ %1 = load i32, ptr %arrayidx, align 4
%cmp1 = icmp eq i32 %1, 4
br i1 %cmp1, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.body
- %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %0
- %2 = load i32, i32* %arrayidx3, align 4
- %arrayidx5 = getelementptr inbounds i32, i32* %c, i64 %0
- %3 = load i32, i32* %arrayidx5, align 4
+ %arrayidx3 = getelementptr inbounds i32, ptr %b, i64 %0
+ %2 = load i32, ptr %arrayidx3, align 4
+ %arrayidx5 = getelementptr inbounds i32, ptr %c, i64 %0
+ %3 = load i32, ptr %arrayidx5, align 4
%cmp6 = icmp eq i32 %2, %3
%spec.select = select i1 %cmp6, i32 2, i32 4
br label %if.end
diff --git a/llvm/test/Transforms/JumpThreading/stale-loop-info-after-unfold-select.ll b/llvm/test/Transforms/JumpThreading/stale-loop-info-after-unfold-select.ll
index 7dbc794c36395..333d80803d4bb 100644
--- a/llvm/test/Transforms/JumpThreading/stale-loop-info-after-unfold-select.ll
+++ b/llvm/test/Transforms/JumpThreading/stale-loop-info-after-unfold-select.ll
@@ -3,7 +3,7 @@
%"type1" = type { i8 }
%"type2" = type opaque
-define dso_local i16* @func2(%"type1"* %this, %"type2"*) {
+define dso_local ptr @func2(ptr %this, ptr) {
entry:
br label %while.cond
diff --git a/llvm/test/Transforms/JumpThreading/static-profile.ll b/llvm/test/Transforms/JumpThreading/static-profile.ll
index 2b2e1cb89cca5..8e4dacd957a51 100644
--- a/llvm/test/Transforms/JumpThreading/static-profile.ll
+++ b/llvm/test/Transforms/JumpThreading/static-profile.ll
@@ -73,14 +73,14 @@
declare void @bar()
-define void @foo(i32 *%p, i32 %n) !prof !0 {
+define void @foo(ptr %p, i32 %n) !prof !0 {
entry:
%enter_loop = icmp eq i32 %n, 0
br i1 %enter_loop, label %exit, label %check_1, !prof !1
; CHECK: br i1 %enter_loop, label %exit, label %check_1, !prof !1
check_1:
- %v = load i32, i32* %p
+ %v = load i32, ptr %p
%cond1 = icmp eq i32 %v, 1
br i1 %cond1, label %eq_1, label %check_2
; No metadata:
diff --git a/llvm/test/Transforms/JumpThreading/thread-cmp.ll b/llvm/test/Transforms/JumpThreading/thread-cmp.ll
index 9508967447622..7f4d7e0c19f82 100644
--- a/llvm/test/Transforms/JumpThreading/thread-cmp.ll
+++ b/llvm/test/Transforms/JumpThreading/thread-cmp.ll
@@ -1,20 +1,20 @@
; RUN: opt -S -jump-threading %s | FileCheck %s
-; When simplify a branch based on LVI predicates, we should replace the
+; When simplify a branch based on LVI predicates, we should replace the
; comparison itself with a constant (when possible) in case it's otherwise used.
-define i32 @test(i32* %p) {
+define i32 @test(ptr %p) {
; CHECK-LABEL: @test
; CHECK: icmp eq
; CHECK-NEXT: br i1 %cmp, label %exit2, label %exit1
; CHECK-NOT: icmp ne
entry:
- %cmp = icmp eq i32* %p, null
+ %cmp = icmp eq ptr %p, null
br i1 %cmp, label %is_null, label %not_null
is_null:
- %cmp2 = icmp ne i32* %p, null
+ %cmp2 = icmp ne ptr %p, null
br i1 %cmp2, label %exit1, label %exit2
not_null:
- %cmp3 = icmp ne i32* %p, null
+ %cmp3 = icmp ne ptr %p, null
br i1 %cmp3, label %exit1, label %exit2
exit1:
ret i32 0
@@ -24,18 +24,18 @@ exit2:
declare void @use(i1)
-; It would not be legal to replace %cmp2 (well, in this case it actually is,
+; It would not be legal to replace %cmp2 (well, in this case it actually is,
; but that's a CSE problem, not a LVI/jump threading problem)
-define i32 @test_negative(i32* %p) {
+define i32 @test_negative(ptr %p) {
; CHECK-LABEL: @test
; CHECK: icmp ne
; CHECK: icmp eq
; CHECK-NEXT: br i1 %cmp, label %exit2, label %exit1
; CHECK-NOT: icmp ne
entry:
- %cmp2 = icmp ne i32* %p, null
+ %cmp2 = icmp ne ptr %p, null
call void @use(i1 %cmp2)
- %cmp = icmp eq i32* %p, null
+ %cmp = icmp eq ptr %p, null
br i1 %cmp, label %is_null, label %not_null
is_null:
br i1 %cmp2, label %exit1, label %exit2
@@ -48,15 +48,15 @@ exit2:
}
; In this case, we can remove cmp2 because it's otherwise unused
-define i32 @test2(i32* %p) {
+define i32 @test2(ptr %p) {
; CHECK-LABEL: @test
; CHECK-LABEL: entry:
; CHECK-NEXT: icmp eq
; CHECK-NEXT: br i1 %cmp, label %exit2, label %exit1
; CHECK-NOT: icmp ne
entry:
- %cmp2 = icmp ne i32* %p, null
- %cmp = icmp eq i32* %p, null
+ %cmp2 = icmp ne ptr %p, null
+ %cmp = icmp eq ptr %p, null
br i1 %cmp, label %is_null, label %not_null
is_null:
br i1 %cmp2, label %exit1, label %exit2
diff --git a/llvm/test/Transforms/JumpThreading/thread-loads.ll b/llvm/test/Transforms/JumpThreading/thread-loads.ll
index 6d60e7303ad8e..9f616eae47615 100644
--- a/llvm/test/Transforms/JumpThreading/thread-loads.ll
+++ b/llvm/test/Transforms/JumpThreading/thread-loads.ll
@@ -7,17 +7,17 @@ target triple = "i386-apple-darwin7"
; Test that we can thread through the block with the partially redundant load (%2).
; rdar://6402033
-define i32 @test1(i32* %P) nounwind {
+define i32 @test1(ptr %P) nounwind {
; CHECK-LABEL: @test1(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 (...) @f1() #[[ATTR0:[0-9]+]]
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 0
; CHECK-NEXT: br i1 [[TMP1]], label [[BB1:%.*]], label [[BB1_THREAD:%.*]]
; CHECK: bb1.thread:
-; CHECK-NEXT: store i32 42, i32* [[P:%.*]], align 4
+; CHECK-NEXT: store i32 42, ptr [[P:%.*]], align 4
; CHECK-NEXT: br label [[BB3:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[DOTPR:%.*]] = load i32, i32* [[P]], align 4
+; CHECK-NEXT: [[DOTPR:%.*]] = load i32, ptr [[P]], align 4
; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[DOTPR]], 36
; CHECK-NEXT: br i1 [[TMP2]], label [[BB3]], label [[BB2:%.*]]
; CHECK: bb2:
@@ -33,12 +33,12 @@ entry:
br i1 %1, label %bb1, label %bb
bb: ; preds = %entry
- store i32 42, i32* %P, align 4
+ store i32 42, ptr %P, align 4
br label %bb1
bb1: ; preds = %entry, %bb
%res.0 = phi i32 [ 1, %bb ], [ 0, %entry ] ; <i32> [#uses=2]
- %2 = load i32, i32* %P, align 4 ; <i32> [#uses=1]
+ %2 = load i32, ptr %P, align 4 ; <i32> [#uses=1]
%3 = icmp sgt i32 %2, 36 ; <i1> [#uses=1]
br i1 %3, label %bb3, label %bb2
@@ -58,17 +58,17 @@ declare i32 @f2(...)
;; Check that we preserve TBAA information.
; rdar://11039258
-define i32 @test2(i32* %P) nounwind {
+define i32 @test2(ptr %P) nounwind {
; CHECK-LABEL: @test2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = tail call i32 (...) @f1() #[[ATTR0]]
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 0
; CHECK-NEXT: br i1 [[TMP1]], label [[BB1:%.*]], label [[BB1_THREAD:%.*]]
; CHECK: bb1.thread:
-; CHECK-NEXT: store i32 42, i32* [[P:%.*]], align 4, !tbaa [[TBAA0:![0-9]+]]
+; CHECK-NEXT: store i32 42, ptr [[P:%.*]], align 4, !tbaa [[TBAA0:![0-9]+]]
; CHECK-NEXT: br label [[BB3:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[DOTPR:%.*]] = load i32, i32* [[P]], align 4, !tbaa [[TBAA0]]
+; CHECK-NEXT: [[DOTPR:%.*]] = load i32, ptr [[P]], align 4, !tbaa [[TBAA0]]
; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[DOTPR]], 36
; CHECK-NEXT: br i1 [[TMP2]], label [[BB3]], label [[BB2:%.*]]
; CHECK: bb2:
@@ -84,12 +84,12 @@ entry:
br i1 %1, label %bb1, label %bb
bb: ; preds = %entry
- store i32 42, i32* %P, align 4, !tbaa !0
+ store i32 42, ptr %P, align 4, !tbaa !0
br label %bb1
bb1: ; preds = %entry, %bb
%res.0 = phi i32 [ 1, %bb ], [ 0, %entry ]
- %2 = load i32, i32* %P, align 4, !tbaa !0
+ %2 = load i32, ptr %P, align 4, !tbaa !0
%3 = icmp sgt i32 %2, 36
br i1 %3, label %bb3, label %bb2
@@ -101,20 +101,18 @@ bb3: ; preds = %bb1
ret i32 %res.0
}
-define i32 @test3(i8** %x, i1 %f) {
+define i32 @test3(ptr %x, i1 %f) {
; Correctly thread loads of
diff erent (but compatible) types, placing bitcasts
; as necessary in the predecessors. This is especially tricky because the same
; predecessor ends up with two entries in the PHI node and they must share
; a single cast.
; CHECK-LABEL: @test3(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8** [[X:%.*]] to i32**
-; CHECK-NEXT: [[TMP1:%.*]] = load i32*, i32** [[TMP0]], align 8
-; CHECK-NEXT: [[TMP2:%.*]] = bitcast i32* [[TMP1]] to i8*
+; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[X:%.*]], align 8
; CHECK-NEXT: br i1 [[F:%.*]], label [[IF_END57:%.*]], label [[IF_END57]]
; CHECK: if.end57:
-; CHECK-NEXT: [[TMP3:%.*]] = phi i8* [ [[TMP2]], [[ENTRY:%.*]] ], [ [[TMP2]], [[ENTRY]] ]
-; CHECK-NEXT: [[TOBOOL59:%.*]] = icmp eq i8* [[TMP3]], null
+; CHECK-NEXT: [[TMP3:%.*]] = phi ptr [ [[TMP1]], [[ENTRY:%.*]] ], [ [[TMP1]], [[ENTRY]] ]
+; CHECK-NEXT: [[TOBOOL59:%.*]] = icmp eq ptr [[TMP3]], null
; CHECK-NEXT: br i1 [[TOBOOL59]], label [[RETURN:%.*]], label [[IF_THEN60:%.*]]
; CHECK: if.then60:
; CHECK-NEXT: ret i32 42
@@ -122,16 +120,15 @@ define i32 @test3(i8** %x, i1 %f) {
; CHECK-NEXT: ret i32 13
;
entry:
- %0 = bitcast i8** %x to i32**
- %1 = load i32*, i32** %0, align 8
+ %0 = load ptr, ptr %x, align 8
br i1 %f, label %if.end57, label %if.then56
if.then56:
br label %if.end57
if.end57:
- %2 = load i8*, i8** %x, align 8
- %tobool59 = icmp eq i8* %2, null
+ %1 = load ptr, ptr %x, align 8
+ %tobool59 = icmp eq ptr %1, null
br i1 %tobool59, label %return, label %if.then60
if.then60:
@@ -141,17 +138,17 @@ return:
ret i32 13
}
-define i32 @test4(i32* %P) {
+define i32 @test4(ptr %P) {
; CHECK-LABEL: @test4(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[V0:%.*]] = tail call i32 (...) @f1()
; CHECK-NEXT: [[V1:%.*]] = icmp eq i32 [[V0]], 0
; CHECK-NEXT: br i1 [[V1]], label [[BB1:%.*]], label [[BB1_THREAD:%.*]]
; CHECK: bb1.thread:
-; CHECK-NEXT: store atomic i32 42, i32* [[P:%.*]] unordered, align 4
+; CHECK-NEXT: store atomic i32 42, ptr [[P:%.*]] unordered, align 4
; CHECK-NEXT: br label [[BB3:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[V2_PR:%.*]] = load atomic i32, i32* [[P]] unordered, align 4
+; CHECK-NEXT: [[V2_PR:%.*]] = load atomic i32, ptr [[P]] unordered, align 4
; CHECK-NEXT: [[V3:%.*]] = icmp sgt i32 [[V2_PR]], 36
; CHECK-NEXT: br i1 [[V3]], label [[BB3]], label [[BB2:%.*]]
; CHECK: bb2:
@@ -167,12 +164,12 @@ entry:
br i1 %v1, label %bb1, label %bb
bb:
- store atomic i32 42, i32* %P unordered, align 4
+ store atomic i32 42, ptr %P unordered, align 4
br label %bb1
bb1:
%res.0 = phi i32 [ 1, %bb ], [ 0, %entry ]
- %v2 = load atomic i32, i32* %P unordered, align 4
+ %v2 = load atomic i32, ptr %P unordered, align 4
%v3 = icmp sgt i32 %v2, 36
br i1 %v3, label %bb3, label %bb2
@@ -184,7 +181,7 @@ bb3:
ret i32 %res.0
}
-define i32 @test5(i32* %P) {
+define i32 @test5(ptr %P) {
; Negative test
; CHECK-LABEL: @test5(
; CHECK-NEXT: entry:
@@ -192,11 +189,11 @@ define i32 @test5(i32* %P) {
; CHECK-NEXT: [[V1:%.*]] = icmp eq i32 [[V0]], 0
; CHECK-NEXT: br i1 [[V1]], label [[BB1:%.*]], label [[BB:%.*]]
; CHECK: bb:
-; CHECK-NEXT: store atomic i32 42, i32* [[P:%.*]] release, align 4
+; CHECK-NEXT: store atomic i32 42, ptr [[P:%.*]] release, align 4
; CHECK-NEXT: br label [[BB1]]
; CHECK: bb1:
; CHECK-NEXT: [[RES_0:%.*]] = phi i32 [ 1, [[BB]] ], [ 0, [[ENTRY:%.*]] ]
-; CHECK-NEXT: [[V2:%.*]] = load atomic i32, i32* [[P]] acquire, align 4
+; CHECK-NEXT: [[V2:%.*]] = load atomic i32, ptr [[P]] acquire, align 4
; CHECK-NEXT: [[V3:%.*]] = icmp sgt i32 [[V2]], 36
; CHECK-NEXT: br i1 [[V3]], label [[BB3:%.*]], label [[BB2:%.*]]
; CHECK: bb2:
@@ -211,13 +208,13 @@ entry:
br i1 %v1, label %bb1, label %bb
bb:
- store atomic i32 42, i32* %P release, align 4
+ store atomic i32 42, ptr %P release, align 4
br label %bb1
bb1:
%res.0 = phi i32 [ 1, %bb ], [ 0, %entry ]
- %v2 = load atomic i32, i32* %P acquire, align 4
+ %v2 = load atomic i32, ptr %P acquire, align 4
%v3 = icmp sgt i32 %v2, 36
br i1 %v3, label %bb3, label %bb2
@@ -229,7 +226,7 @@ bb3:
ret i32 %res.0
}
-define i32 @test6(i32* %P) {
+define i32 @test6(ptr %P) {
; Negative test
; CHECK-LABEL: @test6(
; CHECK-NEXT: entry:
@@ -237,11 +234,11 @@ define i32 @test6(i32* %P) {
; CHECK-NEXT: [[V1:%.*]] = icmp eq i32 [[V0]], 0
; CHECK-NEXT: br i1 [[V1]], label [[BB1:%.*]], label [[BB:%.*]]
; CHECK: bb:
-; CHECK-NEXT: store i32 42, i32* [[P:%.*]], align 4
+; CHECK-NEXT: store i32 42, ptr [[P:%.*]], align 4
; CHECK-NEXT: br label [[BB1]]
; CHECK: bb1:
; CHECK-NEXT: [[RES_0:%.*]] = phi i32 [ 1, [[BB]] ], [ 0, [[ENTRY:%.*]] ]
-; CHECK-NEXT: [[V2:%.*]] = load atomic i32, i32* [[P]] acquire, align 4
+; CHECK-NEXT: [[V2:%.*]] = load atomic i32, ptr [[P]] acquire, align 4
; CHECK-NEXT: [[V3:%.*]] = icmp sgt i32 [[V2]], 36
; CHECK-NEXT: br i1 [[V3]], label [[BB3:%.*]], label [[BB2:%.*]]
; CHECK: bb2:
@@ -256,13 +253,13 @@ entry:
br i1 %v1, label %bb1, label %bb
bb:
- store i32 42, i32* %P
+ store i32 42, ptr %P
br label %bb1
bb1:
%res.0 = phi i32 [ 1, %bb ], [ 0, %entry ]
- %v2 = load atomic i32, i32* %P acquire, align 4
+ %v2 = load atomic i32, ptr %P acquire, align 4
%v3 = icmp sgt i32 %v2, 36
br i1 %v3, label %bb3, label %bb2
@@ -274,7 +271,7 @@ bb3:
ret i32 %res.0
}
-define i32 @test7(i32* %P) {
+define i32 @test7(ptr %P) {
; Negative test
; CHECK-LABEL: @test7(
; CHECK-NEXT: entry:
@@ -282,11 +279,11 @@ define i32 @test7(i32* %P) {
; CHECK-NEXT: [[V1:%.*]] = icmp eq i32 [[V0]], 0
; CHECK-NEXT: br i1 [[V1]], label [[BB1:%.*]], label [[BB:%.*]]
; CHECK: bb:
-; CHECK-NEXT: [[VAL:%.*]] = load i32, i32* [[P:%.*]], align 4
+; CHECK-NEXT: [[VAL:%.*]] = load i32, ptr [[P:%.*]], align 4
; CHECK-NEXT: br label [[BB1]]
; CHECK: bb1:
; CHECK-NEXT: [[RES_0:%.*]] = phi i32 [ 1, [[BB]] ], [ 0, [[ENTRY:%.*]] ]
-; CHECK-NEXT: [[V2:%.*]] = load atomic i32, i32* [[P]] acquire, align 4
+; CHECK-NEXT: [[V2:%.*]] = load atomic i32, ptr [[P]] acquire, align 4
; CHECK-NEXT: [[V3:%.*]] = icmp sgt i32 [[V2]], 36
; CHECK-NEXT: br i1 [[V3]], label [[BB3:%.*]], label [[BB2:%.*]]
; CHECK: bb2:
@@ -301,13 +298,13 @@ entry:
br i1 %v1, label %bb1, label %bb
bb:
- %val = load i32, i32* %P
+ %val = load i32, ptr %P
br label %bb1
bb1:
%res.0 = phi i32 [ 1, %bb ], [ 0, %entry ]
- %v2 = load atomic i32, i32* %P acquire, align 4
+ %v2 = load atomic i32, ptr %P acquire, align 4
%v3 = icmp sgt i32 %v2, 36
br i1 %v3, label %bb3, label %bb2
@@ -322,17 +319,17 @@ bb3:
; Make sure we merge the aliasing metadata. We keep the range metadata for the
; first load, as it dominates the second load. Hence we can eliminate the
; branch.
-define void @test8(i32*, i32*, i32*) {
+define void @test8(ptr, ptr, ptr) {
; CHECK-LABEL: @test8(
; CHECK-NEXT: ret2:
-; CHECK-NEXT: [[A:%.*]] = load i32, i32* [[TMP0:%.*]], align 4, !range [[RNG4:![0-9]+]]
-; CHECK-NEXT: store i32 [[A]], i32* [[TMP1:%.*]], align 4
+; CHECK-NEXT: [[A:%.*]] = load i32, ptr [[TMP0:%.*]], align 4, !range [[RNG4:![0-9]+]]
+; CHECK-NEXT: store i32 [[A]], ptr [[TMP1:%.*]], align 4
; CHECK-NEXT: [[XXX:%.*]] = tail call i32 (...) @f1() #[[ATTR0]]
; CHECK-NEXT: ret void
;
- %a = load i32, i32* %0, !tbaa !0, !range !4, !alias.scope !9, !noalias !10
- %b = load i32, i32* %0, !range !5
- store i32 %a, i32* %1
+ %a = load i32, ptr %0, !tbaa !0, !range !4, !alias.scope !9, !noalias !10
+ %b = load i32, ptr %0, !range !5
+ store i32 %a, ptr %1
%c = icmp eq i32 %b, 8
br i1 %c, label %ret1, label %ret2
@@ -347,20 +344,20 @@ ret2:
; Make sure we merge/PRE aliasing metadata correctly. That means that
; we need to remove metadata from the existing load, and add appropriate
; metadata to the newly inserted load.
-define void @test9(i32*, i32*, i32*, i1 %c) {
+define void @test9(ptr, ptr, ptr, i1 %c) {
; CHECK-LABEL: @test9(
; CHECK-NEXT: br i1 [[C:%.*]], label [[D1:%.*]], label [[D2:%.*]]
; CHECK: d1:
-; CHECK-NEXT: [[A:%.*]] = load i32, i32* [[TMP0:%.*]], align 4
+; CHECK-NEXT: [[A:%.*]] = load i32, ptr [[TMP0:%.*]], align 4
; CHECK-NEXT: br label [[D3:%.*]]
; CHECK: d2:
; CHECK-NEXT: [[XXXX:%.*]] = tail call i32 (...) @f1() #[[ATTR0]]
-; CHECK-NEXT: [[B_PR:%.*]] = load i32, i32* [[TMP0]], align 4, !tbaa [[TBAA0]]
+; CHECK-NEXT: [[B_PR:%.*]] = load i32, ptr [[TMP0]], align 4, !tbaa [[TBAA0]]
; CHECK-NEXT: br label [[D3]]
; CHECK: d3:
; CHECK-NEXT: [[B:%.*]] = phi i32 [ [[B_PR]], [[D2]] ], [ [[A]], [[D1]] ]
; CHECK-NEXT: [[P:%.*]] = phi i32 [ 1, [[D2]] ], [ [[A]], [[D1]] ]
-; CHECK-NEXT: store i32 [[P]], i32* [[TMP1:%.*]], align 4
+; CHECK-NEXT: store i32 [[P]], ptr [[TMP1:%.*]], align 4
; CHECK-NEXT: [[C2:%.*]] = icmp eq i32 [[B]], 8
; CHECK-NEXT: br i1 [[C2]], label [[RET1:%.*]], label [[RET2:%.*]]
; CHECK: ret1:
@@ -372,7 +369,7 @@ define void @test9(i32*, i32*, i32*, i1 %c) {
br i1 %c, label %d1, label %d2
d1:
- %a = load i32, i32* %0, !range !4, !alias.scope !9, !noalias !10
+ %a = load i32, ptr %0, !range !4, !alias.scope !9, !noalias !10
br label %d3
d2:
@@ -381,8 +378,8 @@ d2:
d3:
%p = phi i32 [ 1, %d2 ], [ %a, %d1 ]
- %b = load i32, i32* %0, !tbaa !0
- store i32 %p, i32* %1
+ %b = load i32, ptr %0, !tbaa !0
+ store i32 %p, ptr %1
%c2 = icmp eq i32 %b, 8
br i1 %c2, label %ret1, label %ret2
@@ -394,20 +391,20 @@ ret2:
ret void
}
-define i32 @fn_noalias(i1 %c2,i64* noalias %P, i64* noalias %P2) {
+define i32 @fn_noalias(i1 %c2,ptr noalias %P, ptr noalias %P2) {
; CHECK-LABEL: @fn_noalias(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[C2:%.*]], label [[COND2:%.*]], label [[COND1:%.*]]
; CHECK: cond1:
-; CHECK-NEXT: [[L1:%.*]] = load i64, i64* [[P:%.*]], align 4
-; CHECK-NEXT: store i64 42, i64* [[P2:%.*]], align 4
+; CHECK-NEXT: [[L1:%.*]] = load i64, ptr [[P:%.*]], align 4
+; CHECK-NEXT: store i64 42, ptr [[P2:%.*]], align 4
; CHECK-NEXT: [[C:%.*]] = icmp eq i64 [[L1]], 0
; CHECK-NEXT: br i1 [[C]], label [[COND2_THREAD:%.*]], label [[END:%.*]]
; CHECK: cond2.thread:
; CHECK-NEXT: call void @fn2(i64 [[L1]])
; CHECK-NEXT: br label [[COND3:%.*]]
; CHECK: cond2:
-; CHECK-NEXT: [[L2_PR:%.*]] = load i64, i64* [[P]], align 4
+; CHECK-NEXT: [[L2_PR:%.*]] = load i64, ptr [[P]], align 4
; CHECK-NEXT: call void @fn2(i64 [[L2_PR]])
; CHECK-NEXT: [[C3:%.*]] = icmp eq i64 [[L2_PR]], 0
; CHECK-NEXT: br i1 [[C3]], label [[COND3]], label [[END]]
@@ -422,13 +419,13 @@ entry:
br i1 %c2, label %cond2, label %cond1
cond1:
- %l1 = load i64, i64* %P
- store i64 42, i64* %P2
+ %l1 = load i64, ptr %P
+ store i64 42, ptr %P2
%c = icmp eq i64 %l1, 0
br i1 %c, label %cond2, label %end
cond2:
- %l2 = load i64, i64* %P
+ %l2 = load i64, ptr %P
call void @fn2(i64 %l2)
%c3 = icmp eq i64 %l2, 0
br i1 %c3, label %cond3, label %end
@@ -445,34 +442,34 @@ end:
; %sw.bb21.i. To make this happen, %l2 should be detected as a partically
; redundant load with %l3 across the store to %phase in %sw.bb21.i.
-%struct.NEXT_MOVE = type { i32, i32, i32* }
+%struct.NEXT_MOVE = type { i32, i32, ptr }
@hash_move = unnamed_addr global [65 x i32] zeroinitializer, align 4
@current_move = internal global [65 x i32] zeroinitializer, align 4
- at last = internal unnamed_addr global [65 x i32*] zeroinitializer, align 8
+ at last = internal unnamed_addr global [65 x ptr] zeroinitializer, align 8
@next_status = internal unnamed_addr global [65 x %struct.NEXT_MOVE] zeroinitializer, align 8
define fastcc i32 @Search(i64 %idxprom.i, i64 %idxprom.i89, i32 %c) {
; CHECK-LABEL: @Search(
; CHECK-NEXT: cond.true282:
-; CHECK-NEXT: [[ARRAYIDX185:%.*]] = getelementptr inbounds [65 x i32], [65 x i32]* @hash_move, i64 0, i64 [[IDXPROM_I:%.*]]
-; CHECK-NEXT: [[ARRAYIDX307:%.*]] = getelementptr inbounds [65 x i32], [65 x i32]* @current_move, i64 0, i64 [[IDXPROM_I]]
-; CHECK-NEXT: [[ARRAYIDX89:%.*]] = getelementptr inbounds [65 x i32*], [65 x i32*]* @last, i64 0, i64 [[IDXPROM_I]]
-; CHECK-NEXT: [[PHASE:%.*]] = getelementptr inbounds [65 x %struct.NEXT_MOVE], [65 x %struct.NEXT_MOVE]* @next_status, i64 0, i64 [[IDXPROM_I]], i32 0
+; CHECK-NEXT: [[ARRAYIDX185:%.*]] = getelementptr inbounds [65 x i32], ptr @hash_move, i64 0, i64 [[IDXPROM_I:%.*]]
+; CHECK-NEXT: [[ARRAYIDX307:%.*]] = getelementptr inbounds [65 x i32], ptr @current_move, i64 0, i64 [[IDXPROM_I]]
+; CHECK-NEXT: [[ARRAYIDX89:%.*]] = getelementptr inbounds [65 x ptr], ptr @last, i64 0, i64 [[IDXPROM_I]]
+; CHECK-NEXT: [[PHASE:%.*]] = getelementptr inbounds [65 x %struct.NEXT_MOVE], ptr @next_status, i64 0, i64 [[IDXPROM_I]], i32 0
; CHECK-NEXT: switch i32 [[C:%.*]], label [[CLEANUP:%.*]] [
; CHECK-NEXT: i32 1, label [[SW_BB_I:%.*]]
; CHECK-NEXT: i32 0, label [[SW_BB21_I:%.*]]
; CHECK-NEXT: ]
; CHECK: sw.bb.i:
-; CHECK-NEXT: [[CALL_I62:%.*]] = call fastcc i32* @GenerateCheckEvasions()
-; CHECK-NEXT: store i32* [[CALL_I62]], i32** [[ARRAYIDX89]], align 8
-; CHECK-NEXT: [[L2:%.*]] = load i32, i32* [[ARRAYIDX185]], align 4
+; CHECK-NEXT: [[CALL_I62:%.*]] = call fastcc ptr @GenerateCheckEvasions()
+; CHECK-NEXT: store ptr [[CALL_I62]], ptr [[ARRAYIDX89]], align 8
+; CHECK-NEXT: [[L2:%.*]] = load i32, ptr [[ARRAYIDX185]], align 4
; CHECK-NEXT: [[TOBOOL_I63:%.*]] = icmp eq i32 [[L2]], 0
; CHECK-NEXT: br i1 [[TOBOOL_I63]], label [[SW_BB21_I_THREAD:%.*]], label [[IF_THEN_I64:%.*]]
; CHECK: sw.bb21.i.thread:
-; CHECK-NEXT: store i32 10, i32* [[PHASE]], align 8
+; CHECK-NEXT: store i32 10, ptr [[PHASE]], align 8
; CHECK-NEXT: br label [[DO_BODY_PREHEADER_I67:%.*]]
; CHECK: if.then.i64:
-; CHECK-NEXT: store i32 7, i32* [[PHASE]], align 8
-; CHECK-NEXT: store i32 [[L2]], i32* [[ARRAYIDX307]], align 4
+; CHECK-NEXT: store i32 7, ptr [[PHASE]], align 8
+; CHECK-NEXT: store i32 [[L2]], ptr [[ARRAYIDX307]], align 4
; CHECK-NEXT: [[CALL16_I:%.*]] = call fastcc i32 @ValidMove(i32 [[L2]])
; CHECK-NEXT: [[TOBOOL17_I:%.*]] = icmp eq i32 [[CALL16_I]], 0
; CHECK-NEXT: br i1 [[TOBOOL17_I]], label [[IF_ELSE_I65:%.*]], label [[CLEANUP]]
@@ -480,8 +477,8 @@ define fastcc i32 @Search(i64 %idxprom.i, i64 %idxprom.i89, i32 %c) {
; CHECK-NEXT: call void @f65()
; CHECK-NEXT: br label [[SW_BB21_I]]
; CHECK: sw.bb21.i:
-; CHECK-NEXT: [[L3_PR:%.*]] = load i32, i32* [[ARRAYIDX185]], align 4
-; CHECK-NEXT: store i32 10, i32* [[PHASE]], align 8
+; CHECK-NEXT: [[L3_PR:%.*]] = load i32, ptr [[ARRAYIDX185]], align 4
+; CHECK-NEXT: store i32 10, ptr [[PHASE]], align 8
; CHECK-NEXT: [[TOBOOL27_I:%.*]] = icmp eq i32 [[L3_PR]], 0
; CHECK-NEXT: br i1 [[TOBOOL27_I]], label [[DO_BODY_PREHEADER_I67]], label [[CLEANUP]]
; CHECK: do.body.preheader.i67:
@@ -492,10 +489,10 @@ define fastcc i32 @Search(i64 %idxprom.i, i64 %idxprom.i89, i32 %c) {
; CHECK-NEXT: ret i32 0
;
entry:
- %arrayidx185 = getelementptr inbounds [65 x i32], [65 x i32]* @hash_move, i64 0, i64 %idxprom.i
- %arrayidx307 = getelementptr inbounds [65 x i32], [65 x i32]* @current_move, i64 0, i64 %idxprom.i
- %arrayidx89 = getelementptr inbounds [65 x i32*], [65 x i32*]* @last, i64 0, i64 %idxprom.i
- %phase = getelementptr inbounds [65 x %struct.NEXT_MOVE], [65 x %struct.NEXT_MOVE]* @next_status, i64 0, i64 %idxprom.i, i32 0
+ %arrayidx185 = getelementptr inbounds [65 x i32], ptr @hash_move, i64 0, i64 %idxprom.i
+ %arrayidx307 = getelementptr inbounds [65 x i32], ptr @current_move, i64 0, i64 %idxprom.i
+ %arrayidx89 = getelementptr inbounds [65 x ptr], ptr @last, i64 0, i64 %idxprom.i
+ %phase = getelementptr inbounds [65 x %struct.NEXT_MOVE], ptr @next_status, i64 0, i64 %idxprom.i, i32 0
br label %cond.true282
cond.true282:
@@ -508,15 +505,15 @@ sw.default.i:
br label %cleanup
sw.bb.i:
- %call.i62 = call fastcc i32* @GenerateCheckEvasions()
- store i32* %call.i62, i32** %arrayidx89, align 8
- %l2 = load i32, i32* %arrayidx185, align 4
+ %call.i62 = call fastcc ptr @GenerateCheckEvasions()
+ store ptr %call.i62, ptr %arrayidx89, align 8
+ %l2 = load i32, ptr %arrayidx185, align 4
%tobool.i63 = icmp eq i32 %l2, 0
br i1 %tobool.i63, label %sw.bb21.i, label %if.then.i64
if.then.i64: ; preds = %sw.bb.i
- store i32 7, i32* %phase, align 8
- store i32 %l2, i32* %arrayidx307, align 4
+ store i32 7, ptr %phase, align 8
+ store i32 %l2, ptr %arrayidx307, align 4
%call16.i = call fastcc i32 @ValidMove(i32 %l2)
%tobool17.i = icmp eq i32 %call16.i, 0
br i1 %tobool17.i, label %if.else.i65, label %cleanup
@@ -526,8 +523,8 @@ if.else.i65:
br label %sw.bb21.i
sw.bb21.i:
- store i32 10, i32* %phase, align 8
- %l3= load i32, i32* %arrayidx185, align 4
+ store i32 10, ptr %phase, align 8
+ %l3= load i32, ptr %arrayidx185, align 4
%tobool27.i = icmp eq i32 %l3, 0
br i1 %tobool27.i, label %do.body.preheader.i67, label %cleanup
@@ -540,16 +537,16 @@ cleanup:
ret i32 0
}
-declare fastcc i32* @GenerateCheckEvasions()
+declare fastcc ptr @GenerateCheckEvasions()
declare fastcc i32 @ValidMove(i32 %move)
declare void @f67()
declare void @Cleanup()
declare void @f65()
-define i32 @fn_SinglePred(i1 %c2,i64* %P) {
+define i32 @fn_SinglePred(i1 %c2,ptr %P) {
; CHECK-LABEL: @fn_SinglePred(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[L1:%.*]] = load i64, i64* [[P:%.*]], align 4
+; CHECK-NEXT: [[L1:%.*]] = load i64, ptr [[P:%.*]], align 4
; CHECK-NEXT: [[C:%.*]] = icmp eq i64 [[L1]], 0
; CHECK-NEXT: br i1 [[C]], label [[COND3:%.*]], label [[COND1:%.*]]
; CHECK: cond1:
@@ -567,7 +564,7 @@ define i32 @fn_SinglePred(i1 %c2,i64* %P) {
;
entry:
- %l1 = load i64, i64* %P
+ %l1 = load i64, ptr %P
%c = icmp eq i64 %l1, 0
br i1 %c, label %cond2, label %cond1
@@ -575,7 +572,7 @@ cond1:
br i1 %c2, label %cond2, label %end
cond2:
- %l2 = load i64, i64* %P
+ %l2 = load i64, ptr %P
call void @fn2(i64 %l2)
%c3 = icmp eq i64 %l2, 0
br i1 %c3, label %cond3, label %end
@@ -588,10 +585,10 @@ end:
ret i32 0
}
-define i32 @fn_SinglePredMultihop(i1 %c1, i1 %c2,i64* %P) {
+define i32 @fn_SinglePredMultihop(i1 %c1, i1 %c2,ptr %P) {
; CHECK-LABEL: @fn_SinglePredMultihop(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[L1:%.*]] = load i64, i64* [[P:%.*]], align 4
+; CHECK-NEXT: [[L1:%.*]] = load i64, ptr [[P:%.*]], align 4
; CHECK-NEXT: [[C0:%.*]] = icmp eq i64 [[L1]], 0
; CHECK-NEXT: br i1 [[C0]], label [[COND3:%.*]], label [[COND0:%.*]]
; CHECK: cond0:
@@ -611,7 +608,7 @@ define i32 @fn_SinglePredMultihop(i1 %c1, i1 %c2,i64* %P) {
;
entry:
- %l1 = load i64, i64* %P
+ %l1 = load i64, ptr %P
%c0 = icmp eq i64 %l1, 0
br i1 %c0, label %cond2, label %cond0
@@ -622,7 +619,7 @@ cond1:
br i1 %c2, label %cond2, label %end
cond2:
- %l2 = load i64, i64* %P
+ %l2 = load i64, ptr %P
call void @fn2(i64 %l2)
%c3 = icmp eq i64 %l2, 0
br i1 %c3, label %cond3, label %end
@@ -643,15 +640,15 @@ declare void @fn3(i64)
; merge fully redudant and then we can jump-thread the block with the
; store.
;
-define i32 @phi_translate_partial_redundant_loads(i32, i32*, i32*) {
+define i32 @phi_translate_partial_redundant_loads(i32, ptr, ptr) {
; CHECK-LABEL: @phi_translate_partial_redundant_loads(
; CHECK-NEXT: [[CMP0:%.*]] = icmp ne i32 [[TMP0:%.*]], 0
; CHECK-NEXT: br i1 [[CMP0]], label [[MERGE_THREAD:%.*]], label [[MERGE:%.*]]
; CHECK: merge.thread:
-; CHECK-NEXT: store i32 1, i32* [[TMP1:%.*]], align 4
+; CHECK-NEXT: store i32 1, ptr [[TMP1:%.*]], align 4
; CHECK-NEXT: br label [[LEFT_X:%.*]]
; CHECK: merge:
-; CHECK-NEXT: [[NEWLOAD_PR:%.*]] = load i32, i32* [[TMP2:%.*]], align 4
+; CHECK-NEXT: [[NEWLOAD_PR:%.*]] = load i32, ptr [[TMP2:%.*]], align 4
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[NEWLOAD_PR]], 5
; CHECK-NEXT: br i1 [[CMP1]], label [[LEFT_X]], label [[RIGHT_X:%.*]]
; CHECK: left_x:
@@ -663,15 +660,15 @@ define i32 @phi_translate_partial_redundant_loads(i32, i32*, i32*) {
br i1 %cmp0, label %left, label %right
left:
- store i32 1, i32* %1, align 4
+ store i32 1, ptr %1, align 4
br label %merge
right:
br label %merge
merge:
- %phiptr = phi i32* [ %1, %left ], [ %2, %right ]
- %newload = load i32, i32* %phiptr, align 4
+ %phiptr = phi ptr [ %1, %left ], [ %2, %right ]
+ %newload = load i32, ptr %phiptr, align 4
%cmp1 = icmp slt i32 %newload, 5
br i1 %cmp1, label %left_x, label %right_x
diff --git a/llvm/test/Transforms/JumpThreading/thread-two-bbs-msvc.ll b/llvm/test/Transforms/JumpThreading/thread-two-bbs-msvc.ll
index 50d5d42afd770..0b037ad443e53 100644
--- a/llvm/test/Transforms/JumpThreading/thread-two-bbs-msvc.ll
+++ b/llvm/test/Transforms/JumpThreading/thread-two-bbs-msvc.ll
@@ -6,7 +6,7 @@ target triple = "x86_64-pc-windows-msvc19.16.27026"
; Verify that we do *not* thread any edge. On Windows, we used to
; improperly duplicate EH pads like bb_cleanup below, resulting in an
; assertion failure later down the pass pipeline.
-define void @foo([2 x i8]* %0) personality i8* bitcast (i32 ()* @baz to i8*) {
+define void @foo(ptr %0) personality ptr @baz {
; CHECK-LABEL: @foo
; CHECK-NOT: bb_{{[^ ]*}}.thread:
entry:
diff --git a/llvm/test/Transforms/JumpThreading/thread-two-bbs-threshold.ll b/llvm/test/Transforms/JumpThreading/thread-two-bbs-threshold.ll
index 9b8273db18834..3e3799e902ed7 100644
--- a/llvm/test/Transforms/JumpThreading/thread-two-bbs-threshold.ll
+++ b/llvm/test/Transforms/JumpThreading/thread-two-bbs-threshold.ll
@@ -30,7 +30,7 @@ define void @foo(i32 %cond1, i32 %cond2) {
; CHECK-NEXT: call void @f3()
; CHECK-NEXT: br label [[EXIT]]
; CHECK: bb.f4:
-; CHECK-NEXT: [[PTR5:%.*]] = phi i32* [ null, [[BB_COND2]] ]
+; CHECK-NEXT: [[PTR5:%.*]] = phi ptr [ null, [[BB_COND2]] ]
; CHECK-NEXT: call void @f4()
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
@@ -45,7 +45,7 @@ bb.f1:
br label %bb.cond2
bb.cond2:
- %ptr = phi i32* [ null, %bb.f1 ], [ @a, %entry ]
+ %ptr = phi ptr [ null, %bb.f1 ], [ @a, %entry ]
%cond2.fr = freeze i32 %cond2
%x = add i32 %cond2.fr, 1
%tobool1 = icmp eq i32 %x, 0
@@ -56,7 +56,7 @@ bb.f2:
br label %exit
bb.file:
- %cmp = icmp eq i32* %ptr, null
+ %cmp = icmp eq ptr %ptr, null
br i1 %cmp, label %bb.f4, label %bb.f3
bb.f3:
diff --git a/llvm/test/Transforms/JumpThreading/thread-two-bbs.ll b/llvm/test/Transforms/JumpThreading/thread-two-bbs.ll
index 80848b86bd3bb..7bbd7c0e18160 100644
--- a/llvm/test/Transforms/JumpThreading/thread-two-bbs.ll
+++ b/llvm/test/Transforms/JumpThreading/thread-two-bbs.ll
@@ -28,7 +28,7 @@ define void @foo(i32 %cond1, i32 %cond2) {
; CHECK-NEXT: call void @f3()
; CHECK-NEXT: br label [[EXIT]]
; CHECK: bb.f4:
-; CHECK-NEXT: [[PTR3:%.*]] = phi i32* [ null, [[BB_COND2]] ]
+; CHECK-NEXT: [[PTR3:%.*]] = phi ptr [ null, [[BB_COND2]] ]
; CHECK-NEXT: call void @f4()
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
@@ -43,7 +43,7 @@ bb.f1:
br label %bb.cond2
bb.cond2:
- %ptr = phi i32* [ null, %bb.f1 ], [ @a, %entry ]
+ %ptr = phi ptr [ null, %bb.f1 ], [ @a, %entry ]
%tobool1 = icmp eq i32 %cond2, 0
br i1 %tobool1, label %bb.file, label %bb.f2
@@ -52,7 +52,7 @@ bb.f2:
br label %exit
bb.file:
- %cmp = icmp eq i32* %ptr, null
+ %cmp = icmp eq ptr %ptr, null
br i1 %cmp, label %bb.f4, label %bb.f3
bb.f3:
@@ -133,26 +133,26 @@ exit:
; Verify that we do *not* thread any edge. We used to evaluate
; constant expressions like:
;
-; icmp ugt i8* null, inttoptr (i64 4 to i8*)
+; icmp ugt ptr null, inttoptr (i64 4 to ptr)
;
; as "true", causing jump threading to a wrong destination.
-define void @icmp_ult_null_constexpr(i8* %arg1, i8* %arg2) {
+define void @icmp_ult_null_constexpr(ptr %arg1, ptr %arg2) {
; CHECK-LABEL: @icmp_ult_null_constexpr(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8* [[ARG1:%.*]], null
+; CHECK-NEXT: [[CMP1:%.*]] = icmp eq ptr [[ARG1:%.*]], null
; CHECK-NEXT: br i1 [[CMP1]], label [[BB_BAR1:%.*]], label [[BB_END:%.*]]
; CHECK: bb_bar1:
; CHECK-NEXT: call void @bar(i32 1)
; CHECK-NEXT: br label [[BB_END]]
; CHECK: bb_end:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8* [[ARG2:%.*]], null
+; CHECK-NEXT: [[CMP2:%.*]] = icmp ne ptr [[ARG2:%.*]], null
; CHECK-NEXT: br i1 [[CMP2]], label [[BB_CONT:%.*]], label [[BB_BAR2:%.*]]
; CHECK: bb_bar2:
; CHECK-NEXT: call void @bar(i32 2)
; CHECK-NEXT: br label [[BB_EXIT:%.*]]
; CHECK: bb_cont:
-; CHECK-NEXT: [[CMP3:%.*]] = icmp ult i8* [[ARG1]], inttoptr (i64 4 to i8*)
+; CHECK-NEXT: [[CMP3:%.*]] = icmp ult ptr [[ARG1]], inttoptr (i64 4 to ptr)
; CHECK-NEXT: br i1 [[CMP3]], label [[BB_EXIT]], label [[BB_BAR3:%.*]]
; CHECK: bb_bar3:
; CHECK-NEXT: call void @bar(i32 3)
@@ -161,7 +161,7 @@ define void @icmp_ult_null_constexpr(i8* %arg1, i8* %arg2) {
; CHECK-NEXT: ret void
;
entry:
- %cmp1 = icmp eq i8* %arg1, null
+ %cmp1 = icmp eq ptr %arg1, null
br i1 %cmp1, label %bb_bar1, label %bb_end
bb_bar1:
@@ -169,7 +169,7 @@ bb_bar1:
br label %bb_end
bb_end:
- %cmp2 = icmp ne i8* %arg2, null
+ %cmp2 = icmp ne ptr %arg2, null
br i1 %cmp2, label %bb_cont, label %bb_bar2
bb_bar2:
@@ -177,7 +177,7 @@ bb_bar2:
br label %bb_exit
bb_cont:
- %cmp3 = icmp ult i8* %arg1, inttoptr (i64 4 to i8*)
+ %cmp3 = icmp ult ptr %arg1, inttoptr (i64 4 to ptr)
br i1 %cmp3, label %bb_exit, label %bb_bar3
bb_bar3:
@@ -191,23 +191,23 @@ bb_exit:
; This is a special-case of the above pattern:
; Null is guaranteed to be unsigned <= all values.
-define void @icmp_ule_null_constexpr(i8* %arg1, i8* %arg2) {
+define void @icmp_ule_null_constexpr(ptr %arg1, ptr %arg2) {
; CHECK-LABEL: @icmp_ule_null_constexpr(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i8* [[ARG1:%.*]], null
+; CHECK-NEXT: [[CMP1:%.*]] = icmp eq ptr [[ARG1:%.*]], null
; CHECK-NEXT: br i1 [[CMP1]], label [[BB_END_THREAD:%.*]], label [[BB_END:%.*]]
; CHECK: bb_end:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i8* [[ARG2:%.*]], null
+; CHECK-NEXT: [[CMP2:%.*]] = icmp ne ptr [[ARG2:%.*]], null
; CHECK-NEXT: br i1 [[CMP2]], label [[BB_CONT:%.*]], label [[BB_BAR2:%.*]]
; CHECK: bb_end.thread:
; CHECK-NEXT: call void @bar(i32 1)
-; CHECK-NEXT: [[CMP21:%.*]] = icmp ne i8* [[ARG2]], null
+; CHECK-NEXT: [[CMP21:%.*]] = icmp ne ptr [[ARG2]], null
; CHECK-NEXT: br i1 [[CMP21]], label [[BB_EXIT:%.*]], label [[BB_BAR2]]
; CHECK: bb_bar2:
; CHECK-NEXT: call void @bar(i32 2)
; CHECK-NEXT: br label [[BB_EXIT]]
; CHECK: bb_cont:
-; CHECK-NEXT: [[CMP3:%.*]] = icmp ule i8* [[ARG1]], inttoptr (i64 4 to i8*)
+; CHECK-NEXT: [[CMP3:%.*]] = icmp ule ptr [[ARG1]], inttoptr (i64 4 to ptr)
; CHECK-NEXT: br i1 [[CMP3]], label [[BB_EXIT]], label [[BB_BAR3:%.*]]
; CHECK: bb_bar3:
; CHECK-NEXT: call void @bar(i32 3)
@@ -216,7 +216,7 @@ define void @icmp_ule_null_constexpr(i8* %arg1, i8* %arg2) {
; CHECK-NEXT: ret void
;
entry:
- %cmp1 = icmp eq i8* %arg1, null
+ %cmp1 = icmp eq ptr %arg1, null
br i1 %cmp1, label %bb_bar1, label %bb_end
bb_bar1:
@@ -224,7 +224,7 @@ bb_bar1:
br label %bb_end
bb_end:
- %cmp2 = icmp ne i8* %arg2, null
+ %cmp2 = icmp ne ptr %arg2, null
br i1 %cmp2, label %bb_cont, label %bb_bar2
bb_bar2:
@@ -232,7 +232,7 @@ bb_bar2:
br label %bb_exit
bb_cont:
- %cmp3 = icmp ule i8* %arg1, inttoptr (i64 4 to i8*)
+ %cmp3 = icmp ule ptr %arg1, inttoptr (i64 4 to ptr)
br i1 %cmp3, label %bb_exit, label %bb_bar3
bb_bar3:
@@ -249,26 +249,26 @@ declare void @bar(i32)
;; Test that we skip unconditional PredBB when threading jumps through two
;; successive basic blocks.
-define i32 @foo4(i32* %0) {
+define i32 @foo4(ptr %0) {
; CHECK-LABEL: @foo4(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SIZE:%.*]] = call i64 @get_size(i32* [[TMP0:%.*]])
+; CHECK-NEXT: [[SIZE:%.*]] = call i64 @get_size(ptr [[TMP0:%.*]])
; CHECK-NEXT: [[GOOD:%.*]] = icmp ugt i64 [[SIZE]], 3
; CHECK-NEXT: br i1 [[GOOD]], label [[PRED_BB:%.*]], label [[PRED_PRED_BB:%.*]]
; CHECK: pred.pred.bb:
; CHECK-NEXT: call void @effect()
; CHECK-NEXT: br label [[PRED_BB]]
; CHECK: pred.bb:
-; CHECK-NEXT: [[V:%.*]] = load i32, i32* [[TMP0]], align 4
+; CHECK-NEXT: [[V:%.*]] = load i32, ptr [[TMP0]], align 4
; CHECK-NEXT: br label [[BB:%.*]]
; CHECK: bb:
-; CHECK-NEXT: call void @effect1(i8* blockaddress(@foo4, [[BB]]))
+; CHECK-NEXT: call void @effect1(ptr blockaddress(@foo4, [[BB]]))
; CHECK-NEXT: br i1 [[GOOD]], label [[EXIT:%.*]], label [[EXIT]]
; CHECK: exit:
; CHECK-NEXT: ret i32 [[V]]
;
entry:
- %size = call i64 @get_size(i32* %0)
+ %size = call i64 @get_size(ptr %0)
%good = icmp ugt i64 %size, 3
br i1 %good, label %pred.bb, label %pred.pred.bb
@@ -276,11 +276,11 @@ pred.pred.bb: ; preds = %entry
call void @effect()
br label %pred.bb
pred.bb: ; preds = %pred.pred.bb, %entry
- %v = load i32, i32* %0
+ %v = load i32, ptr %0
br label %bb
bb: ; preds = %pred.bb
- call void @effect1(i8* blockaddress(@foo4, %bb))
+ call void @effect1(ptr blockaddress(@foo4, %bb))
br i1 %good, label %cont2, label %cont1
cont1: ; preds = %bb
@@ -291,6 +291,6 @@ exit: ; preds = %cont1, %cont2
ret i32 %v
}
-declare i64 @get_size(i32*)
+declare i64 @get_size(ptr)
declare void @effect()
-declare void @effect1(i8*)
+declare void @effect1(ptr)
diff --git a/llvm/test/Transforms/JumpThreading/threading_prof1.ll b/llvm/test/Transforms/JumpThreading/threading_prof1.ll
index 1bfd4509714e4..9be8ff94cecbe 100644
--- a/llvm/test/Transforms/JumpThreading/threading_prof1.ll
+++ b/llvm/test/Transforms/JumpThreading/threading_prof1.ll
@@ -35,24 +35,24 @@ bb:
br i1 %tmp1, label %bb5_1, label %bb2
; CHECK: br i1 %tmp1,{{.*}} !prof ![[PROF1:[0-9]+]]
-bb5_1:
+bb5_1:
br label %bb5;
-bb2:
+bb2:
%tmp3 = call i32 @b()
%tmp4 = icmp ne i32 %tmp3, 1
br label %bb5
; CHECK: br i1 %tmp4, {{.*}} !prof ![[PROF2:[0-9]+]]
-bb5:
+bb5:
%tmp6 = phi i1 [ false, %bb5_1 ], [ %tmp4, %bb2 ]
br i1 %tmp6, label %bb8, label %bb7, !prof !0
-bb7:
+bb7:
call void @bar()
br label %bb8
-bb8:
+bb8:
ret void
}
@@ -64,27 +64,27 @@ bb:
br i1 %tmp1, label %bb5_1, label %bb2
; CHECK: br i1 %tmp1,{{.*}} !prof ![[PROF1:[0-9]+]]
-bb5_1:
+bb5_1:
br label %bb5_2;
-bb5_2:
+bb5_2:
br label %bb5;
-bb2:
+bb2:
%tmp3 = call i32 @b()
%tmp4 = icmp ne i32 %tmp3, 1
br label %bb5
; CHECK: br i1 %tmp4, {{.*}} !prof ![[PROF2:[0-9]+]]
-bb5:
+bb5:
%tmp6 = phi i1 [ false, %bb5_2 ], [ %tmp4, %bb2 ]
br i1 %tmp6, label %bb8, label %bb7, !prof !0
-bb7:
+bb7:
call void @bar()
br label %bb8
-bb8:
+bb8:
ret void
}
diff --git a/llvm/test/Transforms/JumpThreading/threading_prof2.ll b/llvm/test/Transforms/JumpThreading/threading_prof2.ll
index b14b996f24eaa..93cdc2274bc4b 100644
--- a/llvm/test/Transforms/JumpThreading/threading_prof2.ll
+++ b/llvm/test/Transforms/JumpThreading/threading_prof2.ll
@@ -7,25 +7,25 @@ bb:
br i1 %tmp1, label %bb5, label %bb2
; CHECK: br i1 %tmp1,{{.*}} !prof ![[PROF1:[0-9]+]]
-bb2:
+bb2:
%tmp3 = call i32 @b()
%tmp4 = icmp ne i32 %tmp3, 1
br label %bb5
; CHECK: br i1 %tmp4, {{.*}} !prof ![[PROF2:[0-9]+]]
-bb5:
+bb5:
%tmp6 = phi i1 [ false, %bb ], [ %tmp4, %bb2 ]
br i1 %tmp6, label %bb8, label %bb7, !prof !0
-bb7:
+bb7:
call void @bar()
br label %bb9
-bb8:
+bb8:
call void @foo()
br label %bb9
-bb9:
+bb9:
ret void
}
diff --git a/llvm/test/Transforms/JumpThreading/unreachable-loops.ll b/llvm/test/Transforms/JumpThreading/unreachable-loops.ll
index cd5c62915dbd4..9c83fd7d485c0 100644
--- a/llvm/test/Transforms/JumpThreading/unreachable-loops.ll
+++ b/llvm/test/Transforms/JumpThreading/unreachable-loops.ll
@@ -101,7 +101,7 @@ define void @PR48362() {
; CHECK-NEXT: cleanup.cont1500:
; CHECK-NEXT: unreachable
; CHECK: if.end1733:
-; CHECK-NEXT: [[I82:%.*]] = load i32, i32* undef, align 1
+; CHECK-NEXT: [[I82:%.*]] = load i32, ptr undef, align 1
; CHECK-NEXT: [[TOBOOL1731_NOT:%.*]] = icmp eq i32 [[I82]], 0
; CHECK-NEXT: br label [[IF_END1733:%.*]]
;
@@ -120,7 +120,7 @@ lbl_555.loopexit: ; preds = %cleanup1491
for.body1509: ; preds = %for.inc2340, %lbl_555.loopexit
%l_580.sroa.0.0 = phi <4 x i32> [ <i32 1684658741, i32 1684658741, i32 1684658741, i32 1684658741>, %lbl_555.loopexit ], [ %l_580.sroa.0.2, %for.inc2340 ]
%p_55.addr.10 = phi i16 [ 0, %lbl_555.loopexit ], [ %p_55.addr.11, %for.inc2340 ]
- %i82 = load i32, i32* undef, align 1
+ %i82 = load i32, ptr undef, align 1
%tobool1731.not = icmp eq i32 %i82, 0
br i1 %tobool1731.not, label %if.end1733, label %if.then1732
More information about the llvm-commits
mailing list