[llvm] 436576a - [Attributor] Convert some tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 11 05:59:15 PST 2023
Author: Nikita Popov
Date: 2023-01-11T14:59:06+01:00
New Revision: 436576a95f8d57a7cd8ed5bce780b5bd9600ae08
URL: https://github.com/llvm/llvm-project/commit/436576a95f8d57a7cd8ed5bce780b5bd9600ae08
DIFF: https://github.com/llvm/llvm-project/commit/436576a95f8d57a7cd8ed5bce780b5bd9600ae08.diff
LOG: [Attributor] Convert some tests to opaque pointers (NFC)
Check lines were regenerated for these.
The alignment changes in byval-2. look suspicious at first glance,
but actually only propagate pre-existing UB.
Added:
Modified:
llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll
llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll
llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll
llvm/test/Transforms/Attributor/chain.ll
llvm/test/Transforms/Attributor/misc.ll
llvm/test/Transforms/Attributor/noalias.ll
llvm/test/Transforms/Attributor/returned.ll
llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
index c45c8dd69429e..945f12adf41dd 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
@@ -6,118 +6,112 @@
target triple = "x86_64-unknown-linux-gnu"
-define internal fastcc void @no_promote_avx2(<4 x i64>* %arg, <4 x i64>* readonly %arg1) #0 {
+define internal fastcc void @no_promote_avx2(ptr %arg, ptr readonly %arg1) #0 {
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@no_promote_avx2
-; CHECK-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[ARG1:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[ARG1:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1]], align 32
-; CHECK-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32
+; CHECK-NEXT: [[TMP:%.*]] = load <4 x i64>, ptr [[ARG1]], align 32
+; CHECK-NEXT: store <4 x i64> [[TMP]], ptr [[ARG]], align 32
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <4 x i64>, <4 x i64>* %arg1
- store <4 x i64> %tmp, <4 x i64>* %arg
+ %tmp = load <4 x i64>, ptr %arg1
+ store <4 x i64> %tmp, ptr %arg
ret void
}
-define void @no_promote(<4 x i64>* %arg) #1 {
+define void @no_promote(ptr %arg) #1 {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@no_promote
-; TUNIT-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]]
-; TUNIT-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32
-; TUNIT-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]]
+; TUNIT-NEXT: call fastcc void @no_promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32
+; TUNIT-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@no_promote
-; CGSCC-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]]
-; CGSCC-NEXT: call fastcc void @no_promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64>* noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32
-; CGSCC-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]]
+; CGSCC-NEXT: call fastcc void @no_promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32
+; CGSCC-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <4 x i64>, align 32
%tmp2 = alloca <4 x i64>, align 32
- %tmp3 = bitcast <4 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @no_promote_avx2(<4 x i64>* %tmp2, <4 x i64>* %tmp)
- %tmp4 = load <4 x i64>, <4 x i64>* %tmp2, align 32
- store <4 x i64> %tmp4, <4 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @no_promote_avx2(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <4 x i64>, ptr %tmp2, align 32
+ store <4 x i64> %tmp4, ptr %arg, align 2
ret void
}
-define internal fastcc void @promote_avx2(<4 x i64>* %arg, <4 x i64>* readonly %arg1) #0 {
+define internal fastcc void @promote_avx2(ptr %arg, ptr readonly %arg1) #0 {
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@promote_avx2
-; CHECK-SAME: (<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64> [[TMP0:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[ARG:%.*]], <4 x i64> [[TMP0:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <4 x i64>, align 32
-; CHECK-NEXT: store <4 x i64> [[TMP0]], <4 x i64>* [[ARG1_PRIV]], align 32
-; CHECK-NEXT: [[TMP:%.*]] = load <4 x i64>, <4 x i64>* [[ARG1_PRIV]], align 32
-; CHECK-NEXT: store <4 x i64> [[TMP]], <4 x i64>* [[ARG]], align 32
+; CHECK-NEXT: store <4 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 32
+; CHECK-NEXT: [[TMP:%.*]] = load <4 x i64>, ptr [[ARG1_PRIV]], align 32
+; CHECK-NEXT: store <4 x i64> [[TMP]], ptr [[ARG]], align 32
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <4 x i64>, <4 x i64>* %arg1
- store <4 x i64> %tmp, <4 x i64>* %arg
+ %tmp = load <4 x i64>, ptr %arg1
+ store <4 x i64> %tmp, ptr %arg
ret void
}
-define void @promote(<4 x i64>* %arg) #0 {
+define void @promote(ptr %arg) #0 {
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@promote
-; TUNIT-SAME: (<4 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]]
-; TUNIT-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32
-; TUNIT-NEXT: call fastcc void @promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32
-; TUNIT-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load <4 x i64>, ptr [[TMP]], align 32
+; TUNIT-NEXT: call fastcc void @promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32
+; TUNIT-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@promote
-; CGSCC-SAME: (<4 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR0]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <4 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]]
-; CGSCC-NEXT: [[TMP0:%.*]] = load <4 x i64>, <4 x i64>* [[TMP]], align 32
-; CGSCC-NEXT: call fastcc void @promote_avx2(<4 x i64>* noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32
-; CGSCC-NEXT: store <4 x i64> [[TMP4]], <4 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load <4 x i64>, ptr [[TMP]], align 32
+; CGSCC-NEXT: call fastcc void @promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32
+; CGSCC-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <4 x i64>, align 32
%tmp2 = alloca <4 x i64>, align 32
- %tmp3 = bitcast <4 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @promote_avx2(<4 x i64>* %tmp2, <4 x i64>* %tmp)
- %tmp4 = load <4 x i64>, <4 x i64>* %tmp2, align 32
- store <4 x i64> %tmp4, <4 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @promote_avx2(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <4 x i64>, ptr %tmp2, align 32
+ store <4 x i64> %tmp4, ptr %arg, align 2
ret void
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1) #2
+declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1) #2
attributes #0 = { inlinehint norecurse nounwind uwtable "target-features"="+avx2" }
attributes #1 = { nounwind uwtable }
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
index 2f2137c62c26b..66c1194a15ba0 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
@@ -7,479 +7,455 @@
target triple = "x86_64-unknown-linux-gnu"
; This should promote
-define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #0 {
+define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr %arg, ptr readonly %arg1) #0 {
;
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512
-; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64
-; CHECK-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <8 x i64>, <8 x i64>* %arg1
- store <8 x i64> %tmp, <8 x i64>* %arg
+ %tmp = load <8 x i64>, ptr %arg1
+ store <8 x i64> %tmp, ptr %arg
ret void
}
-define void @avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* %arg) #0 {
+define void @avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr %arg) #0 {
;
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512
-; TUNIT-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5:[0-9]+]]
-; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6:[0-9]+]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; TUNIT-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5:[0-9]+]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6:[0-9]+]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512
-; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5:[0-9]+]]
-; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6:[0-9]+]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5:[0-9]+]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6:[0-9]+]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <8 x i64>, align 32
%tmp2 = alloca <8 x i64>, align 32
- %tmp3 = bitcast <8 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(<8 x i64>* %tmp2, <8 x i64>* %tmp)
- %tmp4 = load <8 x i64>, <8 x i64>* %tmp2, align 32
- store <8 x i64> %tmp4, <8 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <8 x i64>, ptr %tmp2, align 32
+ store <8 x i64> %tmp4, ptr %arg, align 2
ret void
}
; This should promote
-define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 {
+define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr %arg, ptr readonly %arg1) #1 {
;
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256
-; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64
-; CHECK-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <8 x i64>, <8 x i64>* %arg1
- store <8 x i64> %tmp, <8 x i64>* %arg
+ %tmp = load <8 x i64>, ptr %arg1
+ store <8 x i64> %tmp, ptr %arg
ret void
}
-define void @avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg) #1 {
+define void @avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr %arg) #1 {
;
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256
-; TUNIT-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; TUNIT-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256
-; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <8 x i64>, align 32
%tmp2 = alloca <8 x i64>, align 32
- %tmp3 = bitcast <8 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %tmp2, <8 x i64>* %tmp)
- %tmp4 = load <8 x i64>, <8 x i64>* %tmp2, align 32
- store <8 x i64> %tmp4, <8 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <8 x i64>, ptr %tmp2, align 32
+ store <8 x i64> %tmp4, ptr %arg, align 2
ret void
}
; This should promote
-define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 {
+define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr %arg, ptr readonly %arg1) #1 {
;
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256
-; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64
-; CHECK-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <8 x i64>, <8 x i64>* %arg1
- store <8 x i64> %tmp, <8 x i64>* %arg
+ %tmp = load <8 x i64>, ptr %arg1
+ store <8 x i64> %tmp, ptr %arg
ret void
}
-define void @avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* %arg) #0 {
+define void @avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr %arg) #0 {
;
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256
-; TUNIT-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; TUNIT-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256
-; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <8 x i64>, align 32
%tmp2 = alloca <8 x i64>, align 32
- %tmp3 = bitcast <8 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(<8 x i64>* %tmp2, <8 x i64>* %tmp)
- %tmp4 = load <8 x i64>, <8 x i64>* %tmp2, align 32
- store <8 x i64> %tmp4, <8 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <8 x i64>, ptr %tmp2, align 32
+ store <8 x i64> %tmp4, ptr %arg, align 2
ret void
}
; This should promote
-define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #0 {
+define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr %arg, ptr readonly %arg1) #0 {
;
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512
-; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64
-; CHECK-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <8 x i64>, <8 x i64>* %arg1
- store <8 x i64> %tmp, <8 x i64>* %arg
+ %tmp = load <8 x i64>, ptr %arg1
+ store <8 x i64> %tmp, ptr %arg
ret void
}
-define void @avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* %arg) #1 {
+define void @avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr %arg) #1 {
;
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512
-; TUNIT-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; TUNIT-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512
-; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <8 x i64>, align 32
%tmp2 = alloca <8 x i64>, align 32
- %tmp3 = bitcast <8 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(<8 x i64>* %tmp2, <8 x i64>* %tmp)
- %tmp4 = load <8 x i64>, <8 x i64>* %tmp2, align 32
- store <8 x i64> %tmp4, <8 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <8 x i64>, ptr %tmp2, align 32
+ store <8 x i64> %tmp4, ptr %arg, align 2
ret void
}
; This should not promote
-define internal fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #1 {
+define internal fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr %arg, ptr readonly %arg1) #1 {
;
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256
-; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64
-; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64
+; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <8 x i64>, <8 x i64>* %arg1
- store <8 x i64> %tmp, <8 x i64>* %arg
+ %tmp = load <8 x i64>, ptr %arg1
+ store <8 x i64> %tmp, ptr %arg
ret void
}
-define void @avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %arg) #2 {
+define void @avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr %arg) #2 {
;
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256
-; TUNIT-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; TUNIT-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; TUNIT-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; TUNIT-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256
-; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; CGSCC-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; CGSCC-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <8 x i64>, align 32
%tmp2 = alloca <8 x i64>, align 32
- %tmp3 = bitcast <8 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(<8 x i64>* %tmp2, <8 x i64>* %tmp)
- %tmp4 = load <8 x i64>, <8 x i64>* %tmp2, align 32
- store <8 x i64> %tmp4, <8 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <8 x i64>, ptr %tmp2, align 32
+ store <8 x i64> %tmp4, ptr %arg, align 2
ret void
}
; This should not promote
-define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #2 {
+define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr %arg, ptr readonly %arg1) #2 {
;
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256
-; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2:[0-9]+]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2:[0-9]+]] {
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1]], align 64
-; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64
+; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <8 x i64>, <8 x i64>* %arg1
- store <8 x i64> %tmp, <8 x i64>* %arg
+ %tmp = load <8 x i64>, ptr %arg1
+ store <8 x i64> %tmp, ptr %arg
ret void
}
-define void @avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* %arg) #1 {
+define void @avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr %arg) #1 {
;
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256
-; TUNIT-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; TUNIT-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256
-; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64>* noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <8 x i64>, align 32
%tmp2 = alloca <8 x i64>, align 32
- %tmp3 = bitcast <8 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(<8 x i64>* %tmp2, <8 x i64>* %tmp)
- %tmp4 = load <8 x i64>, <8 x i64>* %tmp2, align 32
- store <8 x i64> %tmp4, <8 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <8 x i64>, ptr %tmp2, align 32
+ store <8 x i64> %tmp4, ptr %arg, align 2
ret void
}
; This should promote
-define internal fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #3 {
+define internal fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr %arg, ptr readonly %arg1) #3 {
;
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256
-; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64
-; CHECK-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <8 x i64>, <8 x i64>* %arg1
- store <8 x i64> %tmp, <8 x i64>* %arg
+ %tmp = load <8 x i64>, ptr %arg1
+ store <8 x i64> %tmp, ptr %arg
ret void
}
-define void @avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* %arg) #4 {
+define void @avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr %arg) #4 {
;
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256
-; TUNIT-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; TUNIT-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; TUNIT-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; TUNIT-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256
-; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; CGSCC-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; CGSCC-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <8 x i64>, align 32
%tmp2 = alloca <8 x i64>, align 32
- %tmp3 = bitcast <8 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(<8 x i64>* %tmp2, <8 x i64>* %tmp)
- %tmp4 = load <8 x i64>, <8 x i64>* %tmp2, align 32
- store <8 x i64> %tmp4, <8 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <8 x i64>, ptr %tmp2, align 32
+ store <8 x i64> %tmp4, ptr %arg, align 2
ret void
}
; This should promote
-define internal fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* %arg, <8 x i64>* readonly %arg1) #4 {
+define internal fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr %arg, ptr readonly %arg1) #4 {
;
; CHECK: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CHECK-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256
-; CHECK-SAME: (<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3]] {
+; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3]] {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64
-; CHECK-NEXT: store <8 x i64> [[TMP0]], <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, <8 x i64>* [[ARG1_PRIV]], align 64
-; CHECK-NEXT: store <8 x i64> [[TMP]], <8 x i64>* [[ARG]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1_PRIV]], align 64
+; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64
; CHECK-NEXT: ret void
;
bb:
- %tmp = load <8 x i64>, <8 x i64>* %arg1
- store <8 x i64> %tmp, <8 x i64>* %arg
+ %tmp = load <8 x i64>, ptr %arg1
+ store <8 x i64> %tmp, ptr %arg
ret void
}
-define void @avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* %arg) #3 {
+define void @avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr %arg) #3 {
;
; TUNIT: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; TUNIT-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256
-; TUNIT-SAME: (<8 x i64>* nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] {
; TUNIT-NEXT: bb:
; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; TUNIT-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; TUNIT-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; TUNIT-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; TUNIT-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; TUNIT-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: inlinehint nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
; CGSCC-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256
-; CGSCC-SAME: (<8 x i64>* nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] {
; CGSCC-NEXT: bb:
; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32
; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
-; CGSCC-NEXT: [[TMP3:%.*]] = bitcast <8 x i64>* [[TMP]] to i8*
-; CGSCC-NEXT: call void @llvm.memset.p0i8.i64(i8* nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP3]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
-; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, <8 x i64>* [[TMP]], align 64
-; CGSCC-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
-; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, <8 x i64>* [[TMP2]], align 64
-; CGSCC-NEXT: store <8 x i64> [[TMP4]], <8 x i64>* [[ARG]], align 2
+; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64
+; CGSCC-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]]
+; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64
+; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
; CGSCC-NEXT: ret void
;
bb:
%tmp = alloca <8 x i64>, align 32
%tmp2 = alloca <8 x i64>, align 32
- %tmp3 = bitcast <8 x i64>* %tmp to i8*
- call void @llvm.memset.p0i8.i64(i8* align 32 %tmp3, i8 0, i64 32, i1 false)
- call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(<8 x i64>* %tmp2, <8 x i64>* %tmp)
- %tmp4 = load <8 x i64>, <8 x i64>* %tmp2, align 32
- store <8 x i64> %tmp4, <8 x i64>* %arg, align 2
+ call void @llvm.memset.p0.i64(ptr align 32 %tmp, i8 0, i64 32, i1 false)
+ call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr %tmp2, ptr %tmp)
+ %tmp4 = load <8 x i64>, ptr %tmp2, align 32
+ store <8 x i64> %tmp4, ptr %arg, align 2
ret void
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1) #5
+declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1) #5
attributes #0 = { inlinehint norecurse nounwind uwtable "target-features"="+avx512vl" "min-legal-vector-width"="512" "prefer-vector-width"="512" }
attributes #1 = { inlinehint norecurse nounwind uwtable "target-features"="+avx512vl" "min-legal-vector-width"="512" "prefer-vector-width"="256" }
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
index ce4fe37dbb0b9..19202a0e4ea06 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll
@@ -12,55 +12,51 @@ target triple = "i386-pc-windows-msvc19.11.0"
%struct.a = type { i8 }
-define internal x86_thiscallcc void @internalfun(%struct.a* %this, <{ %struct.a }>* inalloca(<{ %struct.a }>)) {
+define internal x86_thiscallcc void @internalfun(ptr %this, ptr inalloca(<{ %struct.a }>)) {
; CHECK-LABEL: define {{[^@]+}}@internalfun
-; CHECK-SAME: (%struct.a* noalias nocapture nofree readnone [[THIS:%.*]], <{ [[STRUCT_A:%.*]] }>* noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[TMP0:%.*]]) {
+; CHECK-SAME: (ptr noalias nocapture nofree readnone [[THIS:%.*]], ptr noundef nonnull inalloca(<{ [[STRUCT_A:%.*]] }>) align 4 dereferenceable(1) [[TMP0:%.*]]) {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[A:%.*]] = getelementptr inbounds <{ [[STRUCT_A]] }>, <{ [[STRUCT_A]] }>* [[TMP0]], i32 0, i32 0
; CHECK-NEXT: [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A]] }>, align 4
-; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds <{ [[STRUCT_A]] }>, <{ [[STRUCT_A]] }>* [[ARGMEM]], i32 0, i32 0
-; CHECK-NEXT: [[CALL:%.*]] = call x86_thiscallcc %struct.a* @copy_ctor(%struct.a* noundef nonnull align 4 dereferenceable(1) [[TMP1]], %struct.a* noundef nonnull dereferenceable(1) [[A]])
-; CHECK-NEXT: call void @ext(<{ [[STRUCT_A]] }>* noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
+; CHECK-NEXT: [[CALL:%.*]] = call x86_thiscallcc ptr @copy_ctor(ptr noundef nonnull align 4 dereferenceable(1) [[ARGMEM]], ptr noundef nonnull align 4 dereferenceable(1) [[TMP0]])
+; CHECK-NEXT: call void @ext(ptr noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
; CHECK-NEXT: ret void
;
entry:
- %a = getelementptr inbounds <{ %struct.a }>, <{ %struct.a }>* %0, i32 0, i32 0
%argmem = alloca inalloca <{ %struct.a }>, align 4
- %1 = getelementptr inbounds <{ %struct.a }>, <{ %struct.a }>* %argmem, i32 0, i32 0
- %call = call x86_thiscallcc %struct.a* @copy_ctor(%struct.a* %1, %struct.a* dereferenceable(1) %a)
- call void @ext(<{ %struct.a }>* inalloca(<{ %struct.a }>) %argmem)
+ %call = call x86_thiscallcc ptr @copy_ctor(ptr %argmem, ptr dereferenceable(1) %0)
+ call void @ext(ptr inalloca(<{ %struct.a }>) %argmem)
ret void
}
; This is here to ensure @internalfun is live.
-define void @exportedfun(%struct.a* %a) {
+define void @exportedfun(ptr %a) {
; TUNIT-LABEL: define {{[^@]+}}@exportedfun
-; TUNIT-SAME: (%struct.a* nocapture nofree readnone [[A:%.*]]) {
-; TUNIT-NEXT: [[INALLOCA_SAVE:%.*]] = tail call i8* @llvm.stacksave() #[[ATTR1:[0-9]+]]
+; TUNIT-SAME: (ptr nocapture nofree readnone [[A:%.*]]) {
+; TUNIT-NEXT: [[INALLOCA_SAVE:%.*]] = tail call ptr @llvm.stacksave() #[[ATTR1:[0-9]+]]
; TUNIT-NEXT: [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A:%.*]] }>, align 4
-; TUNIT-NEXT: call x86_thiscallcc void @internalfun(%struct.a* noalias nocapture nofree readnone undef, <{ [[STRUCT_A]] }>* noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
-; TUNIT-NEXT: call void @llvm.stackrestore(i8* nofree [[INALLOCA_SAVE]])
+; TUNIT-NEXT: call x86_thiscallcc void @internalfun(ptr noalias nocapture nofree readnone undef, ptr noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
+; TUNIT-NEXT: call void @llvm.stackrestore(ptr nofree [[INALLOCA_SAVE]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@exportedfun
-; CGSCC-SAME: (%struct.a* nocapture nofree readnone [[A:%.*]]) {
-; CGSCC-NEXT: [[INALLOCA_SAVE:%.*]] = tail call i8* @llvm.stacksave() #[[ATTR1:[0-9]+]]
+; CGSCC-SAME: (ptr nocapture nofree readnone [[A:%.*]]) {
+; CGSCC-NEXT: [[INALLOCA_SAVE:%.*]] = tail call ptr @llvm.stacksave() #[[ATTR1:[0-9]+]]
; CGSCC-NEXT: [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A:%.*]] }>, align 4
-; CGSCC-NEXT: call x86_thiscallcc void @internalfun(%struct.a* noalias nocapture nofree readnone [[A]], <{ [[STRUCT_A]] }>* noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
-; CGSCC-NEXT: call void @llvm.stackrestore(i8* nofree [[INALLOCA_SAVE]])
+; CGSCC-NEXT: call x86_thiscallcc void @internalfun(ptr noalias nocapture nofree readnone [[A]], ptr noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
+; CGSCC-NEXT: call void @llvm.stackrestore(ptr nofree [[INALLOCA_SAVE]])
; CGSCC-NEXT: ret void
;
- %inalloca.save = tail call i8* @llvm.stacksave()
+ %inalloca.save = tail call ptr @llvm.stacksave()
%argmem = alloca inalloca <{ %struct.a }>, align 4
- call x86_thiscallcc void @internalfun(%struct.a* %a, <{ %struct.a }>* inalloca(<{ %struct.a }>) %argmem)
- call void @llvm.stackrestore(i8* %inalloca.save)
+ call x86_thiscallcc void @internalfun(ptr %a, ptr inalloca(<{ %struct.a }>) %argmem)
+ call void @llvm.stackrestore(ptr %inalloca.save)
ret void
}
-declare x86_thiscallcc %struct.a* @copy_ctor(%struct.a* returned, %struct.a* dereferenceable(1))
-declare void @ext(<{ %struct.a }>* inalloca(<{ %struct.a }>))
-declare i8* @llvm.stacksave()
-declare void @llvm.stackrestore(i8*)
+declare x86_thiscallcc ptr @copy_ctor(ptr returned, ptr dereferenceable(1))
+declare void @ext(ptr inalloca(<{ %struct.a }>))
+declare ptr @llvm.stacksave()
+declare void @llvm.stackrestore(ptr)
;.
; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
; CHECK: attributes #[[ATTR1:[0-9]+]] = { willreturn }
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
index 13c4ecba9cc66..b3b67757f9cdb 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
@@ -5,79 +5,72 @@
%struct.ss = type { i32, i64 }
; Don't drop 'byval' on %X here.
-define internal i32 @f(%struct.ss* byval(%struct.ss) %b, i32* byval(i32) %X, i32 %i) nounwind {
+define internal i32 @f(ptr byval(%struct.ss) %b, ptr byval(i32) %X, i32 %i) nounwind {
;
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CHECK-LABEL: define {{[^@]+}}@f
; CHECK-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4
-; CHECK-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4
+; CHECK-NEXT: store i32 [[TMP2]], ptr [[X_PRIV]], align 4
; CHECK-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
-; CHECK-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32*
-; CHECK-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4
-; CHECK-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i64 0, i32 1
-; CHECK-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 4
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[B_PRIV]], align 4
+; CHECK-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], ptr [[B_PRIV]], i64 0, i32 1
+; CHECK-NEXT: store i64 [[TMP1]], ptr [[B_PRIV_0_1]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B_PRIV]], align 8
; CHECK-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1
-; CHECK-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 4
-; CHECK-NEXT: store i32 0, i32* [[X_PRIV]], align 4
-; CHECK-NEXT: [[L:%.*]] = load i32, i32* [[X_PRIV]], align 4
+; CHECK-NEXT: store i32 [[TMP2]], ptr [[B_PRIV]], align 8
+; CHECK-NEXT: store i32 0, ptr [[X_PRIV]], align 4
+; CHECK-NEXT: [[L:%.*]] = load i32, ptr [[X_PRIV]], align 4
; CHECK-NEXT: [[A:%.*]] = add i32 [[L]], [[TMP2]]
; CHECK-NEXT: ret i32 [[A]]
;
entry:
- %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0
- %tmp1 = load i32, i32* %tmp, align 4
+ %tmp1 = load i32, ptr %b, align 4
%tmp2 = add i32 %tmp1, 1
- store i32 %tmp2, i32* %tmp, align 4
+ store i32 %tmp2, ptr %b, align 4
- store i32 %i, i32* %X
- %l = load i32, i32* %X
+ store i32 %i, ptr %X
+ %l = load i32, ptr %X
%a = add i32 %l, %tmp2
ret i32 %a
}
; Also make sure we don't drop the call zeroext attribute.
-define i32 @test(i32* %X) {
+define i32 @test(ptr %X) {
;
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@test
-; TUNIT-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] {
+; TUNIT-SAME: (ptr nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
-; TUNIT-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0
-; TUNIT-NEXT: store i32 1, i32* [[TMP1]], align 8
-; TUNIT-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
-; TUNIT-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32*
-; TUNIT-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8
-; TUNIT-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i64 0, i32 1
-; TUNIT-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8
-; TUNIT-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4
+; TUNIT-NEXT: store i32 1, ptr [[S]], align 8
+; TUNIT-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 1
+; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[S]], align 8
+; TUNIT-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i64 0, i32 1
+; TUNIT-NEXT: [[TMP1:%.*]] = load i64, ptr [[S_0_1]], align 8
+; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr [[X]], align 4
; TUNIT-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]]
; TUNIT-NEXT: ret i32 [[C]]
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@test
-; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
-; CGSCC-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0
-; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
-; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4
+; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 1
+; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4
; CGSCC-NEXT: [[C:%.*]] = call i32 @f(i32 noundef 1, i64 noundef 2, i32 [[TMP0]]) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i32 [[C]]
;
entry:
%S = alloca %struct.ss
- %tmp1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0
- store i32 1, i32* %tmp1, align 8
- %tmp4 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1
- store i64 2, i64* %tmp4, align 4
+ store i32 1, ptr %S, align 8
+ %tmp4 = getelementptr %struct.ss, ptr %S, i32 0, i32 1
+ store i64 2, ptr %tmp4, align 4
- %c = call i32 @f(%struct.ss* byval(%struct.ss) %S, i32* byval(i32) %X, i32 zeroext 0)
+ %c = call i32 @f(ptr byval(%struct.ss) %S, ptr byval(i32) %X, i32 zeroext 0)
ret i32 %c
}
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
index e6b145c5f3902..4788fff263837 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
@@ -4,71 +4,64 @@
%struct.ss = type { i32, i64 }
-define internal void @f(%struct.ss* byval(%struct.ss) %b, i32* byval(i32) %X) nounwind {
+define internal void @f(ptr byval(%struct.ss) %b, ptr byval(i32) %X) nounwind {
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CHECK-LABEL: define {{[^@]+}}@f
; CHECK-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[X_PRIV:%.*]] = alloca i32, align 4
-; CHECK-NEXT: store i32 [[TMP2]], i32* [[X_PRIV]], align 4
+; CHECK-NEXT: store i32 [[TMP2]], ptr [[X_PRIV]], align 4
; CHECK-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
-; CHECK-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32*
-; CHECK-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4
-; CHECK-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i64 0, i32 1
-; CHECK-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 4
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[B_PRIV]], align 4
+; CHECK-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], ptr [[B_PRIV]], i64 0, i32 1
+; CHECK-NEXT: store i64 [[TMP1]], ptr [[B_PRIV_0_1]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B_PRIV]], align 8
; CHECK-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1
-; CHECK-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 4
-; CHECK-NEXT: store i32 0, i32* [[X_PRIV]], align 4
+; CHECK-NEXT: store i32 [[TMP2]], ptr [[B_PRIV]], align 8
+; CHECK-NEXT: store i32 0, ptr [[X_PRIV]], align 4
; CHECK-NEXT: ret void
;
entry:
- %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0
- %tmp1 = load i32, i32* %tmp, align 4
+ %tmp1 = load i32, ptr %b, align 4
%tmp2 = add i32 %tmp1, 1
- store i32 %tmp2, i32* %tmp, align 4
+ store i32 %tmp2, ptr %b, align 4
- store i32 0, i32* %X
+ store i32 0, ptr %X
ret void
}
-define i32 @test(i32* %X) {
+define i32 @test(ptr %X) {
;
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@test
-; TUNIT-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] {
+; TUNIT-SAME: (ptr nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
-; TUNIT-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0
-; TUNIT-NEXT: store i32 1, i32* [[TMP1]], align 8
-; TUNIT-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
-; TUNIT-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32*
-; TUNIT-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8
-; TUNIT-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i64 0, i32 1
-; TUNIT-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8
-; TUNIT-NEXT: [[TMP2:%.*]] = load i32, i32* [[X]], align 4
+; TUNIT-NEXT: store i32 1, ptr [[S]], align 8
+; TUNIT-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 1
+; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[S]], align 8
+; TUNIT-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i64 0, i32 1
+; TUNIT-NEXT: [[TMP1:%.*]] = load i64, ptr [[S_0_1]], align 8
+; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr [[X]], align 4
; TUNIT-NEXT: call void @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]]
; TUNIT-NEXT: ret i32 0
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@test
-; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] {
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
-; CGSCC-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0
-; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
-; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[X]], align 4
+; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 1
+; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4
; CGSCC-NEXT: call void @f(i32 noundef 1, i64 noundef 2, i32 [[TMP0]]) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i32 0
;
entry:
%S = alloca %struct.ss
- %tmp1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0
- store i32 1, i32* %tmp1, align 8
- %tmp4 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1
- store i64 2, i64* %tmp4, align 4
- call void @f(%struct.ss* byval(%struct.ss) %S, i32* byval(i32) %X)
+ store i32 1, ptr %S, align 8
+ %tmp4 = getelementptr %struct.ss, ptr %S, i32 0, i32 1
+ store i64 2, ptr %tmp4, align 4
+ call void @f(ptr byval(%struct.ss) %S, ptr byval(i32) %X)
ret i32 0
}
;.
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
index e27904ebd3113..7f588e644655c 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
@@ -6,52 +6,46 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1
%struct.ss = type { i32, i64 }
-define internal i32 @f(%struct.ss* byval(%struct.ss) %b) nounwind {
+define internal i32 @f(ptr byval(%struct.ss) %b) nounwind {
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CHECK-LABEL: define {{[^@]+}}@f
; CHECK-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
-; CHECK-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32*
-; CHECK-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4
-; CHECK-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i64 0, i32 1
-; CHECK-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 4
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[B_PRIV]], align 4
+; CHECK-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], ptr [[B_PRIV]], i64 0, i32 1
+; CHECK-NEXT: store i64 [[TMP1]], ptr [[B_PRIV_0_1]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B_PRIV]], align 8
; CHECK-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1
-; CHECK-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 4
+; CHECK-NEXT: store i32 [[TMP2]], ptr [[B_PRIV]], align 8
; CHECK-NEXT: ret i32 [[TMP1]]
;
entry:
- %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0
- %tmp1 = load i32, i32* %tmp, align 4
+ %tmp1 = load i32, ptr %b, align 4
%tmp2 = add i32 %tmp1, 1
- store i32 %tmp2, i32* %tmp, align 4
+ store i32 %tmp2, ptr %b, align 4
ret i32 %tmp1
}
-define internal i32 @g(%struct.ss* byval(%struct.ss) align 32 %b) nounwind {
+define internal i32 @g(ptr byval(%struct.ss) align 32 %b) nounwind {
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CHECK-LABEL: define {{[^@]+}}@g
; CHECK-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[B_PRIV:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
-; CHECK-NEXT: [[B_PRIV_CAST:%.*]] = bitcast %struct.ss* [[B_PRIV]] to i32*
-; CHECK-NEXT: store i32 [[TMP0]], i32* [[B_PRIV_CAST]], align 4
-; CHECK-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i64 0, i32 1
-; CHECK-NEXT: store i64 [[TMP1]], i64* [[B_PRIV_0_1]], align 4
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[B_PRIV]], i32 0, i32 0
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 32
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[B_PRIV]], align 4
+; CHECK-NEXT: [[B_PRIV_0_1:%.*]] = getelementptr [[STRUCT_SS]], ptr [[B_PRIV]], i64 0, i32 1
+; CHECK-NEXT: store i64 [[TMP1]], ptr [[B_PRIV_0_1]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B_PRIV]], align 32
; CHECK-NEXT: [[TMP2:%.*]] = add i32 [[TMP1]], 1
-; CHECK-NEXT: store i32 [[TMP2]], i32* [[TMP]], align 32
+; CHECK-NEXT: store i32 [[TMP2]], ptr [[B_PRIV]], align 32
; CHECK-NEXT: ret i32 [[TMP2]]
;
entry:
- %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0
- %tmp1 = load i32, i32* %tmp, align 4
+ %tmp1 = load i32, ptr %b, align 4
%tmp2 = add i32 %tmp1, 1
- store i32 %tmp2, i32* %tmp, align 4
+ store i32 %tmp2, ptr %b, align 4
ret i32 %tmp2
}
@@ -62,18 +56,15 @@ define i32 @main() nounwind {
; TUNIT-SAME: () #[[ATTR1:[0-9]+]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
-; TUNIT-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0
-; TUNIT-NEXT: store i32 1, i32* [[TMP1]], align 8
-; TUNIT-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
-; TUNIT-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32*
-; TUNIT-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8
-; TUNIT-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i64 0, i32 1
-; TUNIT-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8
+; TUNIT-NEXT: store i32 1, ptr [[S]], align 32
+; TUNIT-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 1
+; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[S]], align 8
+; TUNIT-NEXT: [[S_0_11:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i64 0, i32 1
+; TUNIT-NEXT: [[TMP1:%.*]] = load i64, ptr [[S_0_11]], align 8
; TUNIT-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR2:[0-9]+]]
-; TUNIT-NEXT: [[S_CAST1:%.*]] = bitcast %struct.ss* [[S]] to i32*
-; TUNIT-NEXT: [[TMP2:%.*]] = load i32, i32* [[S_CAST1]], align 32
-; TUNIT-NEXT: [[S_0_12:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i64 0, i32 1
-; TUNIT-NEXT: [[TMP3:%.*]] = load i64, i64* [[S_0_12]], align 32
+; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr [[S]], align 32
+; TUNIT-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i64 0, i32 1
+; TUNIT-NEXT: [[TMP3:%.*]] = load i64, ptr [[S_0_1]], align 32
; TUNIT-NEXT: [[C1:%.*]] = call i32 @g(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR2]]
; TUNIT-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]]
; TUNIT-NEXT: ret i32 [[A]]
@@ -83,8 +74,7 @@ define i32 @main() nounwind {
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
-; CGSCC-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0
-; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1
+; CGSCC-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], ptr [[S]], i32 0, i32 1
; CGSCC-NEXT: [[C0:%.*]] = call i32 @f(i32 noundef 1, i64 noundef 2) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: [[C1:%.*]] = call i32 @g(i32 noundef 1, i64 noundef 2) #[[ATTR2]]
; CGSCC-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]]
@@ -92,12 +82,11 @@ define i32 @main() nounwind {
;
entry:
%S = alloca %struct.ss
- %tmp1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0
- store i32 1, i32* %tmp1, align 8
- %tmp4 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1
- store i64 2, i64* %tmp4, align 4
- %c0 = call i32 @f(%struct.ss* byval(%struct.ss) %S) nounwind
- %c1 = call i32 @g(%struct.ss* byval(%struct.ss) %S) nounwind
+ store i32 1, ptr %S, align 8
+ %tmp4 = getelementptr %struct.ss, ptr %S, i32 0, i32 1
+ store i64 2, ptr %tmp4, align 4
+ %c0 = call i32 @f(ptr byval(%struct.ss) %S) nounwind
+ %c1 = call i32 @g(ptr byval(%struct.ss) %S) nounwind
%a = add i32 %c0, %c1
ret i32 %a
}
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll
index 2efae797ab8c3..d77635bb8650f 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll
@@ -5,31 +5,30 @@
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"
-define internal void @add({i32, i32}* %this, i32* sret(i32) %r) {
+define internal void @add(ptr %this, ptr sret(i32) %r) {
;
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: write)
; TUNIT-LABEL: define {{[^@]+}}@add
-; TUNIT-SAME: ({ i32, i32 }* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[THIS:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] {
-; TUNIT-NEXT: store i32 undef, i32* [[R]], align 4
+; TUNIT-SAME: (ptr noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] {
+; TUNIT-NEXT: store i32 undef, ptr [[R]], align 4
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@add
-; CGSCC-SAME: ({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] {
-; CGSCC-NEXT: [[AP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 0
-; CGSCC-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[THIS]], i32 0, i32 1
-; CGSCC-NEXT: [[A:%.*]] = load i32, i32* [[AP]], align 4
-; CGSCC-NEXT: [[B:%.*]] = load i32, i32* [[BP]], align 4
+; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] {
+; CGSCC-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, ptr [[THIS]], i32 0, i32 1
+; CGSCC-NEXT: [[A:%.*]] = load i32, ptr [[THIS]], align 8
+; CGSCC-NEXT: [[B:%.*]] = load i32, ptr [[BP]], align 4
; CGSCC-NEXT: [[AB:%.*]] = add i32 [[A]], [[B]]
-; CGSCC-NEXT: store i32 [[AB]], i32* [[R]], align 4
+; CGSCC-NEXT: store i32 [[AB]], ptr [[R]], align 4
; CGSCC-NEXT: ret void
;
- %ap = getelementptr {i32, i32}, {i32, i32}* %this, i32 0, i32 0
- %bp = getelementptr {i32, i32}, {i32, i32}* %this, i32 0, i32 1
- %a = load i32, i32* %ap
- %b = load i32, i32* %bp
+ %ap = getelementptr {i32, i32}, ptr %this, i32 0, i32 0
+ %bp = getelementptr {i32, i32}, ptr %this, i32 0, i32 1
+ %a = load i32, ptr %ap
+ %b = load i32, ptr %bp
%ab = add i32 %a, %b
- store i32 %ab, i32* %r
+ store i32 %ab, ptr %r
ret void
}
@@ -38,7 +37,7 @@ define void @f() {
; TUNIT-LABEL: define {{[^@]+}}@f
; TUNIT-SAME: () #[[ATTR1:[0-9]+]] {
; TUNIT-NEXT: [[R:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: call void @add({ i32, i32 }* noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) undef, i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]]
+; TUNIT-NEXT: call void @add(ptr noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) undef, ptr noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none)
@@ -46,13 +45,13 @@ define void @f() {
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: [[R:%.*]] = alloca i32, align 4
; CGSCC-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8
-; CGSCC-NEXT: call void @add({ i32, i32 }* noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], i32* noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]]
+; CGSCC-NEXT: call void @add(ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], ptr noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret void
;
%r = alloca i32
%pair = alloca {i32, i32}
- call void @add({i32, i32}* %pair, i32* sret(i32) %r)
+ call void @add(ptr %pair, ptr sret(i32) %r)
ret void
}
;.
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll
index 095527a7242c2..854d84ab488a4 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll
@@ -7,42 +7,39 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
%pair = type { i32, i32 }
-declare i8* @foo(%pair*)
+declare ptr @foo(ptr)
-define internal void @bar(%pair* byval(%pair) %Data) {
+define internal void @bar(ptr byval(%pair) %Data) {
; CHECK-LABEL: define {{[^@]+}}@bar
; CHECK-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) {
; CHECK-NEXT: [[DATA_PRIV:%.*]] = alloca [[PAIR:%.*]], align 8
-; CHECK-NEXT: [[DATA_PRIV_CAST:%.*]] = bitcast %pair* [[DATA_PRIV]] to i32*
-; CHECK-NEXT: store i32 [[TMP0]], i32* [[DATA_PRIV_CAST]], align 4
-; CHECK-NEXT: [[DATA_PRIV_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA_PRIV]], i64 0, i32 1
-; CHECK-NEXT: store i32 [[TMP1]], i32* [[DATA_PRIV_0_1]], align 4
-; CHECK-NEXT: [[TMP3:%.*]] = call i8* @foo(%pair* nonnull dereferenceable(8) [[DATA_PRIV]])
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[DATA_PRIV]], align 4
+; CHECK-NEXT: [[DATA_PRIV_0_1:%.*]] = getelementptr [[PAIR]], ptr [[DATA_PRIV]], i64 0, i32 1
+; CHECK-NEXT: store i32 [[TMP1]], ptr [[DATA_PRIV_0_1]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = call ptr @foo(ptr nonnull dereferenceable(8) [[DATA_PRIV]])
; CHECK-NEXT: ret void
;
- tail call i8* @foo(%pair* %Data)
+ tail call ptr @foo(ptr %Data)
ret void
}
-define void @zed(%pair* byval(%pair) %Data) {
+define void @zed(ptr byval(%pair) %Data) {
; TUNIT-LABEL: define {{[^@]+}}@zed
-; TUNIT-SAME: (%pair* noalias nocapture nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) {
-; TUNIT-NEXT: [[DATA_CAST:%.*]] = bitcast %pair* [[DATA]] to i32*
-; TUNIT-NEXT: [[TMP1:%.*]] = load i32, i32* [[DATA_CAST]], align 1
-; TUNIT-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA]], i64 0, i32 1
-; TUNIT-NEXT: [[TMP2:%.*]] = load i32, i32* [[DATA_0_1]], align 1
+; TUNIT-SAME: (ptr noalias nocapture nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) {
+; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr [[DATA]], align 1
+; TUNIT-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], ptr [[DATA]], i64 0, i32 1
+; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr [[DATA_0_1]], align 1
; TUNIT-NEXT: call void @bar(i32 [[TMP1]], i32 [[TMP2]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@zed
-; CGSCC-SAME: (%pair* noalias nocapture nofree nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) {
-; CGSCC-NEXT: [[DATA_CAST:%.*]] = bitcast %pair* [[DATA]] to i32*
-; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[DATA_CAST]], align 1
-; CGSCC-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], %pair* [[DATA]], i64 0, i32 1
-; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[DATA_0_1]], align 1
+; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) {
+; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr [[DATA]], align 1
+; CGSCC-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], ptr [[DATA]], i64 0, i32 1
+; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr [[DATA_0_1]], align 1
; CGSCC-NEXT: call void @bar(i32 [[TMP1]], i32 [[TMP2]])
; CGSCC-NEXT: ret void
;
- call void @bar(%pair* byval(%pair) %Data)
+ call void @bar(ptr byval(%pair) %Data)
ret void
}
diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
index f3fcff5eba40a..d8c55ab418120 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
@@ -5,38 +5,36 @@
; Don't constant-propagate byval pointers, since they are not pointers!
; PR5038
%struct.MYstr = type { i8, i32 }
- at mystr = internal global %struct.MYstr zeroinitializer ; <%struct.MYstr*> [#uses=3]
+ at mystr = internal global %struct.MYstr zeroinitializer ; <ptr> [#uses=3]
declare void @use(i8)
;.
; CHECK: @[[MYSTR:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_MYSTR:%.*]] zeroinitializer
;.
-define internal void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind {
+define internal void @vfu1(ptr byval(%struct.MYstr) align 4 %u) nounwind {
; CHECK: Function Attrs: nounwind
; CHECK-LABEL: define {{[^@]+}}@vfu1
; CHECK-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8
-; CHECK-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8*
-; CHECK-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1
-; CHECK-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i64 0, i32 1
-; CHECK-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
-; CHECK-NEXT: store i32 99, i32* [[TMP2]], align 4
-; CHECK-NEXT: [[TMP3:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0
-; CHECK-NEXT: store i8 97, i8* [[TMP3]], align 4
-; CHECK-NEXT: [[L:%.*]] = load i8, i8* [[TMP3]], align 4
+; CHECK-NEXT: store i8 [[TMP0]], ptr [[U_PRIV]], align 1
+; CHECK-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr [[U_PRIV]], i64 0, i32 1
+; CHECK-NEXT: store i32 [[TMP1]], ptr [[U_PRIV_0_1]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr [[U_PRIV]], i32 0, i32 1
+; CHECK-NEXT: store i32 99, ptr [[TMP2]], align 4
+; CHECK-NEXT: store i8 97, ptr [[U_PRIV]], align 8
+; CHECK-NEXT: [[L:%.*]] = load i8, ptr [[U_PRIV]], align 8
; CHECK-NEXT: call void @use(i8 [[L]])
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: return:
; CHECK-NEXT: ret void
;
entry:
- %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 99, i32* %0, align 4
- %1 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
- store i8 97, i8* %1, align 4
- %l = load i8, i8* %1
+ %0 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 1 ; <ptr> [#uses=1]
+ store i32 99, ptr %0, align 4
+ %1 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 0 ; <ptr> [#uses=1]
+ store i8 97, ptr %1, align 4
+ %l = load i8, ptr %1
call void @use(i8 %l)
br label %return
@@ -44,98 +42,78 @@ return: ; preds = %entry
ret void
}
-define internal i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly {
+define internal i32 @vfu2(ptr byval(%struct.MYstr) align 4 %u) nounwind readonly {
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: read)
; CHECK-LABEL: define {{[^@]+}}@vfu2
; CHECK-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1:[0-9]+]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8
-; CHECK-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8*
-; CHECK-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1
-; CHECK-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i64 0, i32 1
-; CHECK-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
-; CHECK-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0
-; CHECK-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 4
-; CHECK-NEXT: [[TMP6:%.*]] = zext i8 [[TMP5]] to i32
-; CHECK-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]]
-; CHECK-NEXT: ret i32 [[TMP7]]
+; CHECK-NEXT: store i8 [[TMP0]], ptr [[U_PRIV]], align 1
+; CHECK-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr [[U_PRIV]], i64 0, i32 1
+; CHECK-NEXT: store i32 [[TMP1]], ptr [[U_PRIV_0_1]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr [[U_PRIV]], i32 0, i32 1
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
+; CHECK-NEXT: [[TMP4:%.*]] = load i8, ptr [[U_PRIV]], align 8
+; CHECK-NEXT: [[TMP5:%.*]] = zext i8 [[TMP4]] to i32
+; CHECK-NEXT: [[TMP6:%.*]] = add i32 [[TMP5]], [[TMP3]]
+; CHECK-NEXT: ret i32 [[TMP6]]
;
entry:
- %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
- %1 = load i32, i32* %0
- %2 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
- %3 = load i8, i8* %2
+ %0 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 1 ; <ptr> [#uses=1]
+ %1 = load i32, ptr %0
+ %2 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 0 ; <ptr> [#uses=1]
+ %3 = load i8, ptr %2
%4 = zext i8 %3 to i32
%5 = add i32 %4, %1
ret i32 %5
}
define i32 @unions() nounwind {
-; TUNIT: Function Attrs: nounwind
-; TUNIT-LABEL: define {{[^@]+}}@unions
-; TUNIT-SAME: () #[[ATTR0]] {
-; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8*
-; TUNIT-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8
-; TUNIT-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i64 0, i32 1
-; TUNIT-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8
-; TUNIT-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]]
-; TUNIT-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8*
-; TUNIT-NEXT: [[TMP2:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8
-; TUNIT-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i64 0, i32 1
-; TUNIT-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8
-; TUNIT-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR0]]
-; TUNIT-NEXT: ret i32 [[RESULT]]
-;
-; CGSCC: Function Attrs: nounwind
-; CGSCC-LABEL: define {{[^@]+}}@unions
-; CGSCC-SAME: () #[[ATTR0]] {
-; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[TMP0:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 0), align 8
-; CGSCC-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i64 0, i32 1
-; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8
-; CGSCC-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]]
-; CGSCC-NEXT: [[TMP2:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 8
-; CGSCC-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i64 0, i32 1
-; CGSCC-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8
-; CGSCC-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR0]]
-; CGSCC-NEXT: ret i32 [[RESULT]]
+; CHECK: Function Attrs: nounwind
+; CHECK-LABEL: define {{[^@]+}}@unions
+; CHECK-SAME: () #[[ATTR0]] {
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr @mystr, align 8
+; CHECK-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], ptr @mystr, i64 0, i32 1
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[MYSTR_0_1]], align 8
+; CHECK-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]]
+; CHECK-NEXT: [[TMP2:%.*]] = load i8, ptr @mystr, align 8
+; CHECK-NEXT: [[MYSTR_0_11:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr @mystr, i64 0, i32 1
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[MYSTR_0_11]], align 8
+; CHECK-NEXT: [[RESULT:%.*]] = call i32 @vfu2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR0]]
+; CHECK-NEXT: ret i32 [[RESULT]]
;
entry:
- call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
- %result = call i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
+ call void @vfu1(ptr byval(%struct.MYstr) align 4 @mystr) nounwind
+ %result = call i32 @vfu2(ptr byval(%struct.MYstr) align 4 @mystr) nounwind
ret i32 %result
}
-define internal i32 @vfu2_v2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly {
+define internal i32 @vfu2_v2(ptr byval(%struct.MYstr) align 4 %u) nounwind readonly {
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: read)
; CHECK-LABEL: define {{[^@]+}}@vfu2_v2
; CHECK-SAME: (i8 [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[U_PRIV:%.*]] = alloca [[STRUCT_MYSTR:%.*]], align 8
-; CHECK-NEXT: [[U_PRIV_CAST:%.*]] = bitcast %struct.MYstr* [[U_PRIV]] to i8*
-; CHECK-NEXT: store i8 [[TMP0]], i8* [[U_PRIV_CAST]], align 1
-; CHECK-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i64 0, i32 1
-; CHECK-NEXT: store i32 [[TMP1]], i32* [[U_PRIV_0_1]], align 4
-; CHECK-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
-; CHECK-NEXT: store i32 99, i32* [[Z]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 1
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
-; CHECK-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U_PRIV]], i32 0, i32 0
-; CHECK-NEXT: [[TMP5:%.*]] = load i8, i8* [[TMP4]], align 4
-; CHECK-NEXT: [[TMP6:%.*]] = zext i8 [[TMP5]] to i32
-; CHECK-NEXT: [[TMP7:%.*]] = add i32 [[TMP6]], [[TMP3]]
-; CHECK-NEXT: ret i32 [[TMP7]]
+; CHECK-NEXT: store i8 [[TMP0]], ptr [[U_PRIV]], align 1
+; CHECK-NEXT: [[U_PRIV_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr [[U_PRIV]], i64 0, i32 1
+; CHECK-NEXT: store i32 [[TMP1]], ptr [[U_PRIV_0_1]], align 4
+; CHECK-NEXT: [[Z:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr [[U_PRIV]], i32 0, i32 1
+; CHECK-NEXT: store i32 99, ptr [[Z]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr [[U_PRIV]], i32 0, i32 1
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
+; CHECK-NEXT: [[TMP4:%.*]] = load i8, ptr [[U_PRIV]], align 8
+; CHECK-NEXT: [[TMP5:%.*]] = zext i8 [[TMP4]] to i32
+; CHECK-NEXT: [[TMP6:%.*]] = add i32 [[TMP5]], [[TMP3]]
+; CHECK-NEXT: ret i32 [[TMP6]]
;
entry:
- %z = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1
- store i32 99, i32* %z, align 4
- %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
- %1 = load i32, i32* %0
- %2 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
- %3 = load i8, i8* %2
+ %z = getelementptr %struct.MYstr, ptr %u, i32 0, i32 1
+ store i32 99, ptr %z, align 4
+ %0 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 1 ; <ptr> [#uses=1]
+ %1 = load i32, ptr %0
+ %2 = getelementptr %struct.MYstr, ptr %u, i32 0, i32 0 ; <ptr> [#uses=1]
+ %3 = load i8, ptr %2
%4 = zext i8 %3 to i32
%5 = add i32 %4, %1
ret i32 %5
@@ -146,15 +124,13 @@ define i32 @unions_v2() nounwind {
; TUNIT-LABEL: define {{[^@]+}}@unions_v2
; TUNIT-SAME: () #[[ATTR0]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[MYSTR_CAST:%.*]] = bitcast %struct.MYstr* @mystr to i8*
-; TUNIT-NEXT: [[TMP0:%.*]] = load i8, i8* [[MYSTR_CAST]], align 8
-; TUNIT-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i64 0, i32 1
-; TUNIT-NEXT: [[TMP1:%.*]] = load i32, i32* [[MYSTR_0_1]], align 8
+; TUNIT-NEXT: [[TMP0:%.*]] = load i8, ptr @mystr, align 8
+; TUNIT-NEXT: [[MYSTR_0_11:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], ptr @mystr, i64 0, i32 1
+; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr [[MYSTR_0_11]], align 8
; TUNIT-NEXT: call void @vfu1(i8 [[TMP0]], i32 [[TMP1]]) #[[ATTR0]]
-; TUNIT-NEXT: [[MYSTR_CAST1:%.*]] = bitcast %struct.MYstr* @mystr to i8*
-; TUNIT-NEXT: [[TMP2:%.*]] = load i8, i8* [[MYSTR_CAST1]], align 8
-; TUNIT-NEXT: [[MYSTR_0_12:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* @mystr, i64 0, i32 1
-; TUNIT-NEXT: [[TMP3:%.*]] = load i32, i32* [[MYSTR_0_12]], align 8
+; TUNIT-NEXT: [[TMP2:%.*]] = load i8, ptr @mystr, align 8
+; TUNIT-NEXT: [[MYSTR_0_1:%.*]] = getelementptr [[STRUCT_MYSTR]], ptr @mystr, i64 0, i32 1
+; TUNIT-NEXT: [[TMP3:%.*]] = load i32, ptr [[MYSTR_0_1]], align 8
; TUNIT-NEXT: [[RESULT:%.*]] = call i32 @vfu2_v2(i8 [[TMP2]], i32 [[TMP3]]) #[[ATTR0]]
; TUNIT-NEXT: ret i32 [[RESULT]]
;
@@ -167,8 +143,8 @@ define i32 @unions_v2() nounwind {
; CGSCC-NEXT: ret i32 [[RESULT]]
;
entry:
- call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
- %result = call i32 @vfu2_v2(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
+ call void @vfu1(ptr byval(%struct.MYstr) align 4 @mystr) nounwind
+ %result = call i32 @vfu2_v2(ptr byval(%struct.MYstr) align 4 @mystr) nounwind
ret i32 %result
}
;.
diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll
index 7b89d2cccf6b2..fb3a87a7d59ff 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll
@@ -9,24 +9,28 @@ define dso_local i16 @foo(i16 %a) {
; TUNIT: Function Attrs: norecurse
; TUNIT-LABEL: define {{[^@]+}}@foo
; TUNIT-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
-; TUNIT-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7)
+; TUNIT-NEXT: [[CALL:%.*]] = call i16 @bar(i16 [[A]], i32 7)
; TUNIT-NEXT: ret i16 [[CALL]]
;
-; CGSCC: Function Attrs: nofree nosync nounwind
+; CGSCC: Function Attrs: nofree nosync nounwind memory(none)
; CGSCC-LABEL: define {{[^@]+}}@foo
; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
-; CGSCC-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7)
+; CGSCC-NEXT: [[CALL:%.*]] = call i16 @bar(i16 [[A]], i32 7)
; CGSCC-NEXT: ret i16 [[CALL]]
;
- %call = call i16 bitcast (i16 (i16, i16) * @bar to i16 (i16, i32) *)(i16 %a, i32 7)
+ %call = call i16 @bar(i16 %a, i32 7)
ret i16 %call
}
define internal i16 @bar(i16 %p1, i16 %p2) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
-; CHECK-LABEL: define {{[^@]+}}@bar
-; CHECK-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT: ret i16 [[P2]]
+; TUNIT-LABEL: define {{[^@]+}}@bar
+; TUNIT-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) {
+; TUNIT-NEXT: ret i16 [[P2]]
+;
+; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
+; CGSCC-LABEL: define {{[^@]+}}@bar
+; CGSCC-SAME: (i16 [[P1:%.*]], i16 returned [[P2:%.*]]) #[[ATTR1:[0-9]+]] {
+; CGSCC-NEXT: ret i16 [[P2]]
;
ret i16 %p2
}
@@ -34,8 +38,9 @@ define internal i16 @bar(i16 %p1, i16 %p2) {
;.
; TUNIT: attributes #[[ATTR0]] = { norecurse }
-; TUNIT: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn memory(none) }
;.
-; CGSCC: attributes #[[ATTR0]] = { nofree nosync nounwind }
+; CGSCC: attributes #[[ATTR0]] = { nofree nosync nounwind memory(none) }
; CGSCC: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind willreturn memory(none) }
;.
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; CHECK: {{.*}}
diff --git a/llvm/test/Transforms/Attributor/chain.ll b/llvm/test/Transforms/Attributor/chain.ll
index a1186f6db89a0..197cf091a26ad 100644
--- a/llvm/test/Transforms/Attributor/chain.ll
+++ b/llvm/test/Transforms/Attributor/chain.ll
@@ -2,29 +2,26 @@
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_1
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -attributor-max-initialization-chain-length=1024 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK_5
-declare void @foo(i8* dereferenceable(8) %arg)
+declare void @foo(ptr dereferenceable(8) %arg)
-define dso_local i32 @bar(i32* %arg) {
+define dso_local i32 @bar(ptr %arg) {
; CHECK_1-LABEL: define {{[^@]+}}@bar
-; CHECK_1-SAME: (i32* dereferenceable_or_null(8) [[ARG:%.*]]) {
+; CHECK_1-SAME: (ptr noundef dereferenceable_or_null(8) [[ARG:%.*]]) {
; CHECK_1-NEXT: entry:
-; CHECK_1-NEXT: [[BC1:%.*]] = bitcast i32* [[ARG]] to i8*
-; CHECK_1-NEXT: call void @foo(i8* noundef dereferenceable_or_null(8) [[BC1]])
-; CHECK_1-NEXT: [[LD:%.*]] = load i32, i32* [[ARG]], align 4
+; CHECK_1-NEXT: call void @foo(ptr noundef dereferenceable_or_null(8) [[ARG]])
+; CHECK_1-NEXT: [[LD:%.*]] = load i32, ptr [[ARG]], align 4
; CHECK_1-NEXT: ret i32 [[LD]]
;
; CHECK_5-LABEL: define {{[^@]+}}@bar
-; CHECK_5-SAME: (i32* nonnull dereferenceable(8) [[ARG:%.*]]) {
+; CHECK_5-SAME: (ptr noundef nonnull dereferenceable(8) [[ARG:%.*]]) {
; CHECK_5-NEXT: entry:
-; CHECK_5-NEXT: [[BC1:%.*]] = bitcast i32* [[ARG]] to i8*
-; CHECK_5-NEXT: call void @foo(i8* noundef nonnull dereferenceable(8) [[BC1]])
-; CHECK_5-NEXT: [[LD:%.*]] = load i32, i32* [[ARG]], align 4
+; CHECK_5-NEXT: call void @foo(ptr noundef nonnull dereferenceable(8) [[ARG]])
+; CHECK_5-NEXT: [[LD:%.*]] = load i32, ptr [[ARG]], align 4
; CHECK_5-NEXT: ret i32 [[LD]]
;
entry:
- %bc1 = bitcast i32* %arg to i8*
- call void @foo(i8* %bc1)
- %ld = load i32, i32* %arg
+ call void @foo(ptr %arg)
+ %ld = load i32, ptr %arg
ret i32 %ld
}
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
diff --git a/llvm/test/Transforms/Attributor/misc.ll b/llvm/test/Transforms/Attributor/misc.ll
index 5a5165e9d144c..0c410e1d20e66 100644
--- a/llvm/test/Transforms/Attributor/misc.ll
+++ b/llvm/test/Transforms/Attributor/misc.ll
@@ -4,109 +4,101 @@
;
; Mostly check we do not crash on these uses
-define internal void @internal(void (i8*)* %fp) {
+define internal void @internal(ptr %fp) {
;
;
; TUNIT-LABEL: define {{[^@]+}}@internal
-; TUNIT-SAME: (void (i8*)* nonnull [[FP:%.*]]) {
+; TUNIT-SAME: (ptr nonnull [[FP:%.*]]) {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: call void @foo(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]]
-; TUNIT-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*))
-; TUNIT-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo)
-; TUNIT-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*))
-; TUNIT-NEXT: call void @callback2(void (i8*)* nonnull [[FP]])
-; TUNIT-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8*
-; TUNIT-NEXT: call void [[FP]](i8* [[TMP1]])
+; TUNIT-NEXT: call void @foo(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]]
+; TUNIT-NEXT: call void [[FP]](ptr @foo)
+; TUNIT-NEXT: call void @callback1(ptr noundef nonnull @foo)
+; TUNIT-NEXT: call void @callback2(ptr noundef @foo)
+; TUNIT-NEXT: call void @callback2(ptr nonnull [[FP]])
+; TUNIT-NEXT: call void [[FP]](ptr [[A]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@internal
-; CGSCC-SAME: (void (i8*)* noundef nonnull [[FP:%.*]]) {
+; CGSCC-SAME: (ptr noundef nonnull [[FP:%.*]]) {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4
-; CGSCC-NEXT: call void @foo(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]]
-; CGSCC-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*))
-; CGSCC-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo)
-; CGSCC-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*))
-; CGSCC-NEXT: call void @callback2(void (i8*)* noundef nonnull [[FP]])
-; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8*
-; CGSCC-NEXT: call void [[FP]](i8* [[TMP1]])
+; CGSCC-NEXT: call void @foo(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]]
+; CGSCC-NEXT: call void [[FP]](ptr @foo)
+; CGSCC-NEXT: call void @callback1(ptr noundef nonnull @foo)
+; CGSCC-NEXT: call void @callback2(ptr noundef @foo)
+; CGSCC-NEXT: call void @callback2(ptr noundef nonnull [[FP]])
+; CGSCC-NEXT: call void [[FP]](ptr [[A]])
; CGSCC-NEXT: ret void
;
entry:
%a = alloca i32, align 4
- %tmp = bitcast i32* %a to i8*
- call void @foo(i32* nonnull %a)
- call void %fp(i8* bitcast (void (i32*)* @foo to i8*))
- call void @callback1(void (i32*)* nonnull @foo)
- call void @callback2(void (i8*)* bitcast (void (i32*)* @foo to void (i8*)*))
- call void @callback2(void (i8*)* %fp)
- %tmp1 = bitcast i32* %a to i8*
- call void %fp(i8* %tmp1)
+ call void @foo(ptr nonnull %a)
+ call void %fp(ptr @foo)
+ call void @callback1(ptr nonnull @foo)
+ call void @callback2(ptr @foo)
+ call void @callback2(ptr %fp)
+ call void %fp(ptr %a)
ret void
}
-define void @external(void (i8*)* %fp) {
+define void @external(ptr %fp) {
;
;
; TUNIT-LABEL: define {{[^@]+}}@external
-; TUNIT-SAME: (void (i8*)* [[FP:%.*]]) {
+; TUNIT-SAME: (ptr [[FP:%.*]]) {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: call void @foo(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]]
-; TUNIT-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo)
-; TUNIT-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*))
-; TUNIT-NEXT: call void @callback2(void (i8*)* [[FP]])
-; TUNIT-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*))
-; TUNIT-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8*
-; TUNIT-NEXT: call void [[FP]](i8* [[TMP1]])
-; TUNIT-NEXT: call void @internal(void (i8*)* nonnull [[FP]])
+; TUNIT-NEXT: call void @foo(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]]
+; TUNIT-NEXT: call void @callback1(ptr noundef nonnull @foo)
+; TUNIT-NEXT: call void @callback2(ptr noundef @foo)
+; TUNIT-NEXT: call void @callback2(ptr [[FP]])
+; TUNIT-NEXT: call void [[FP]](ptr @foo)
+; TUNIT-NEXT: call void [[FP]](ptr [[A]])
+; TUNIT-NEXT: call void @internal(ptr nonnull [[FP]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@external
-; CGSCC-SAME: (void (i8*)* [[FP:%.*]]) {
+; CGSCC-SAME: (ptr [[FP:%.*]]) {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4
-; CGSCC-NEXT: call void @foo(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]]
-; CGSCC-NEXT: call void @callback1(void (i32*)* noundef nonnull @foo)
-; CGSCC-NEXT: call void @callback2(void (i8*)* noundef bitcast (void (i32*)* @foo to void (i8*)*))
-; CGSCC-NEXT: call void @callback2(void (i8*)* [[FP]])
-; CGSCC-NEXT: call void [[FP]](i8* bitcast (void (i32*)* @foo to i8*))
-; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[A]] to i8*
-; CGSCC-NEXT: call void [[FP]](i8* [[TMP1]])
-; CGSCC-NEXT: call void @internal(void (i8*)* noundef nonnull [[FP]])
+; CGSCC-NEXT: call void @foo(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]]
+; CGSCC-NEXT: call void @callback1(ptr noundef nonnull @foo)
+; CGSCC-NEXT: call void @callback2(ptr noundef @foo)
+; CGSCC-NEXT: call void @callback2(ptr [[FP]])
+; CGSCC-NEXT: call void [[FP]](ptr @foo)
+; CGSCC-NEXT: call void [[FP]](ptr [[A]])
+; CGSCC-NEXT: call void @internal(ptr noundef nonnull [[FP]])
; CGSCC-NEXT: ret void
;
entry:
%a = alloca i32, align 4
- %tmp = bitcast i32* %a to i8*
- call void @foo(i32* nonnull %a)
- call void @callback1(void (i32*)* nonnull @foo)
- call void @callback2(void (i8*)* bitcast (void (i32*)* @foo to void (i8*)*))
- call void @callback2(void (i8*)* %fp)
- call void %fp(i8* bitcast (void (i32*)* @foo to i8*))
- %tmp1 = bitcast i32* %a to i8*
- call void %fp(i8* %tmp1)
- call void @internal(void (i8*)* %fp)
+ call void @foo(ptr nonnull %a)
+ call void @callback1(ptr nonnull @foo)
+ call void @callback2(ptr @foo)
+ call void @callback2(ptr %fp)
+ call void %fp(ptr @foo)
+ call void %fp(ptr %a)
+ call void @internal(ptr %fp)
ret void
}
-define internal void @foo(i32* %a) {
+define internal void @foo(ptr %a) {
;
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: write)
; CHECK-LABEL: define {{[^@]+}}@foo
-; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: store i32 0, i32* [[A]], align 4
+; CHECK-NEXT: store i32 0, ptr [[A]], align 4
; CHECK-NEXT: ret void
;
entry:
- store i32 0, i32* %a
+ store i32 0, ptr %a
ret void
}
-declare void @callback1(void (i32*)*)
-declare void @callback2(void (i8*)*)
+declare void @callback1(ptr)
+declare void @callback2(ptr)
;.
; TUNIT: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn memory(argmem: write) }
; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn }
diff --git a/llvm/test/Transforms/Attributor/noalias.ll b/llvm/test/Transforms/Attributor/noalias.ll
index 571038e5d76ce..2b80348bc2995 100644
--- a/llvm/test/Transforms/Attributor/noalias.ll
+++ b/llvm/test/Transforms/Attributor/noalias.ll
@@ -11,77 +11,75 @@
; return V;
; }
- at G = external global i8*
+ at G = external global ptr
;.
-; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external global i8*
-; CHECK: @[[ALIAS_OF_P:[a-zA-Z0-9_$"\\.-]+]] = external global i32*
+; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external global ptr
+; CHECK: @[[ALIAS_OF_P:[a-zA-Z0-9_$"\\.-]+]] = external global ptr
;.
-define i8* @foo() {
+define ptr @foo() {
; CHECK-LABEL: define {{[^@]+}}@foo() {
-; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: store i8* [[TMP1]], i8** @G, align 8
-; CHECK-NEXT: ret i8* [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: store ptr [[TMP1]], ptr @G, align 8
+; CHECK-NEXT: ret ptr [[TMP1]]
;
- %1 = tail call noalias i8* @malloc(i64 4)
- store i8* %1, i8** @G, align 8
- ret i8* %1
+ %1 = tail call noalias ptr @malloc(i64 4)
+ store ptr %1, ptr @G, align 8
+ ret ptr %1
}
-declare noalias i8* @malloc(i64)
+declare noalias ptr @malloc(i64)
; TEST 2
; call noalias function in return instruction.
-define i8* @return_noalias(){
+define ptr @return_noalias(){
; CHECK-LABEL: define {{[^@]+}}@return_noalias() {
-; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: ret i8* [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: ret ptr [[TMP1]]
;
- %1 = tail call noalias i8* @malloc(i64 4)
- ret i8* %1
+ %1 = tail call noalias ptr @malloc(i64 4)
+ ret ptr %1
}
-define void @nocapture(i8* %a){
+define void @nocapture(ptr %a){
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define {{[^@]+}}@nocapture
-; CHECK-SAME: (i8* nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (ptr nocapture nofree readnone [[A:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: ret void
;
ret void
}
-define i8* @return_noalias_looks_like_capture(){
+define ptr @return_noalias_looks_like_capture(){
; CHECK-LABEL: define {{[^@]+}}@return_noalias_looks_like_capture() {
-; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: ret i8* [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: ret ptr [[TMP1]]
;
- %1 = tail call noalias i8* @malloc(i64 4)
- call void @nocapture(i8* %1)
- ret i8* %1
+ %1 = tail call noalias ptr @malloc(i64 4)
+ call void @nocapture(ptr %1)
+ ret ptr %1
}
-define i16* @return_noalias_casted(){
+define ptr @return_noalias_casted(){
; CHECK-LABEL: define {{[^@]+}}@return_noalias_casted() {
-; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: [[C:%.*]] = bitcast i8* [[TMP1]] to i16*
-; CHECK-NEXT: ret i16* [[C]]
+; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: ret ptr [[TMP1]]
;
- %1 = tail call noalias i8* @malloc(i64 4)
- %c = bitcast i8* %1 to i16*
- ret i16* %c
+ %1 = tail call noalias ptr @malloc(i64 4)
+ ret ptr %1
}
-declare i8* @alias()
+declare ptr @alias()
; TEST 3
-define i8* @call_alias(){
+define ptr @call_alias(){
; CHECK-LABEL: define {{[^@]+}}@call_alias() {
-; CHECK-NEXT: [[TMP1:%.*]] = tail call i8* @alias()
-; CHECK-NEXT: ret i8* [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = tail call ptr @alias()
+; CHECK-NEXT: ret ptr [[TMP1]]
;
- %1 = tail call i8* @alias()
- ret i8* %1
+ %1 = tail call ptr @alias()
+ ret ptr %1
}
; TEST 4
@@ -99,35 +97,35 @@ define i8* @call_alias(){
; return malloc(4);
; }
-define i8* @bar() nounwind uwtable {
+define ptr @bar() nounwind uwtable {
; TUNIT: Function Attrs: nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@bar
; TUNIT-SAME: () #[[ATTR1:[0-9]+]] {
-; TUNIT-NEXT: [[TMP1:%.*]] = tail call i8* (...) @baz() #[[ATTR2:[0-9]+]]
-; TUNIT-NEXT: ret i8* [[TMP1]]
+; TUNIT-NEXT: [[TMP1:%.*]] = tail call ptr (...) @baz() #[[ATTR2:[0-9]+]]
+; TUNIT-NEXT: ret ptr [[TMP1]]
;
; CGSCC: Function Attrs: nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@bar
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
-; CGSCC-NEXT: [[TMP1:%.*]] = tail call i8* (...) @baz() #[[ATTR3:[0-9]+]]
-; CGSCC-NEXT: ret i8* [[TMP1]]
+; CGSCC-NEXT: [[TMP1:%.*]] = tail call ptr (...) @baz() #[[ATTR3:[0-9]+]]
+; CGSCC-NEXT: ret ptr [[TMP1]]
;
- %1 = tail call i8* (...) @baz()
- ret i8* %1
+ %1 = tail call ptr (...) @baz()
+ ret ptr %1
}
-define i8* @foo1(i32 %0) nounwind uwtable {
+define ptr @foo1(i32 %0) nounwind uwtable {
; TUNIT: Function Attrs: nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@foo1
; TUNIT-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0
; TUNIT-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]]
; TUNIT: 3:
-; TUNIT-NEXT: [[TMP4:%.*]] = tail call i8* (...) @baz() #[[ATTR2]]
+; TUNIT-NEXT: [[TMP4:%.*]] = tail call ptr (...) @baz() #[[ATTR2]]
; TUNIT-NEXT: br label [[TMP5]]
; TUNIT: 5:
-; TUNIT-NEXT: [[TMP6:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; TUNIT-NEXT: ret i8* [[TMP6]]
+; TUNIT-NEXT: [[TMP6:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; TUNIT-NEXT: ret ptr [[TMP6]]
;
; CGSCC: Function Attrs: nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@foo1
@@ -135,215 +133,212 @@ define i8* @foo1(i32 %0) nounwind uwtable {
; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0
; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]]
; CGSCC: 3:
-; CGSCC-NEXT: [[TMP4:%.*]] = tail call i8* (...) @baz() #[[ATTR3]]
+; CGSCC-NEXT: [[TMP4:%.*]] = tail call ptr (...) @baz() #[[ATTR3]]
; CGSCC-NEXT: br label [[TMP5]]
; CGSCC: 5:
-; CGSCC-NEXT: [[TMP6:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CGSCC-NEXT: ret i8* [[TMP6]]
+; CGSCC-NEXT: [[TMP6:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CGSCC-NEXT: ret ptr [[TMP6]]
;
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
- %4 = tail call i8* (...) @baz()
+ %4 = tail call ptr (...) @baz()
br label %5
5: ; preds = %1, %3
- %6 = tail call noalias i8* @malloc(i64 4)
- ret i8* %6
+ %6 = tail call noalias ptr @malloc(i64 4)
+ ret ptr %6
}
-declare i8* @baz(...) nounwind uwtable
+declare ptr @baz(...) nounwind uwtable
; TEST 5
; Returning global pointer. Should not be noalias.
-define i8** @getter() {
+define ptr @getter() {
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define {{[^@]+}}@getter
; CHECK-SAME: () #[[ATTR0]] {
-; CHECK-NEXT: ret i8** @G
+; CHECK-NEXT: ret ptr @G
;
- ret i8** @G
+ ret ptr @G
}
; Returning global pointer. Should not be noalias.
-define i8** @calle1(){
+define ptr @calle1(){
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
; TUNIT-LABEL: define {{[^@]+}}@calle1
; TUNIT-SAME: () #[[ATTR0]] {
-; TUNIT-NEXT: ret i8** @G
+; TUNIT-NEXT: ret ptr @G
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@calle1
; CGSCC-SAME: () #[[ATTR2:[0-9]+]] {
-; CGSCC-NEXT: [[TMP1:%.*]] = call noundef nonnull align 8 dereferenceable(8) i8** @getter() #[[ATTR11:[0-9]+]]
-; CGSCC-NEXT: ret i8** [[TMP1]]
+; CGSCC-NEXT: [[TMP1:%.*]] = call noundef nonnull align 8 dereferenceable(8) ptr @getter() #[[ATTR11:[0-9]+]]
+; CGSCC-NEXT: ret ptr [[TMP1]]
;
- %1 = call i8** @getter()
- ret i8** %1
+ %1 = call ptr @getter()
+ ret ptr %1
}
; TEST 6
-declare noalias i8* @strdup(i8* nocapture) nounwind
+declare noalias ptr @strdup(ptr nocapture) nounwind
-define i8* @test6() nounwind uwtable ssp {
+define ptr @test6() nounwind uwtable ssp {
; TUNIT: Function Attrs: nounwind ssp uwtable
; TUNIT-LABEL: define {{[^@]+}}@test6
; TUNIT-SAME: () #[[ATTR3:[0-9]+]] {
; TUNIT-NEXT: [[X:%.*]] = alloca [2 x i8], align 1
-; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 0
-; TUNIT-NEXT: store i8 97, i8* [[ARRAYIDX]], align 1
-; TUNIT-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 1
-; TUNIT-NEXT: store i8 0, i8* [[ARRAYIDX1]], align 1
-; TUNIT-NEXT: [[CALL:%.*]] = call noalias i8* @strdup(i8* nocapture noundef nonnull dereferenceable(2) [[ARRAYIDX]]) #[[ATTR2]]
-; TUNIT-NEXT: ret i8* [[CALL]]
+; TUNIT-NEXT: store i8 97, ptr [[X]], align 1
+; TUNIT-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x i8], ptr [[X]], i64 0, i64 1
+; TUNIT-NEXT: store i8 0, ptr [[ARRAYIDX1]], align 1
+; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @strdup(ptr noalias nocapture noundef nonnull dereferenceable(2) [[X]]) #[[ATTR2]]
+; TUNIT-NEXT: ret ptr [[CALL]]
;
; CGSCC: Function Attrs: nounwind ssp uwtable
; CGSCC-LABEL: define {{[^@]+}}@test6
; CGSCC-SAME: () #[[ATTR4:[0-9]+]] {
; CGSCC-NEXT: [[X:%.*]] = alloca [2 x i8], align 1
-; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 0
-; CGSCC-NEXT: store i8 97, i8* [[ARRAYIDX]], align 1
-; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 1
-; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX1]], align 1
-; CGSCC-NEXT: [[CALL:%.*]] = call noalias i8* @strdup(i8* nocapture noundef nonnull dereferenceable(2) [[ARRAYIDX]]) #[[ATTR3]]
-; CGSCC-NEXT: ret i8* [[CALL]]
+; CGSCC-NEXT: store i8 97, ptr [[X]], align 1
+; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x i8], ptr [[X]], i64 0, i64 1
+; CGSCC-NEXT: store i8 0, ptr [[ARRAYIDX1]], align 1
+; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @strdup(ptr noalias nocapture noundef nonnull dereferenceable(2) [[X]]) #[[ATTR3]]
+; CGSCC-NEXT: ret ptr [[CALL]]
;
%x = alloca [2 x i8], align 1
- %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 0
- store i8 97, i8* %arrayidx, align 1
- %arrayidx1 = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 1
- store i8 0, i8* %arrayidx1, align 1
- %call = call noalias i8* @strdup(i8* %arrayidx) nounwind
- ret i8* %call
+ store i8 97, ptr %x, align 1
+ %arrayidx1 = getelementptr inbounds [2 x i8], ptr %x, i64 0, i64 1
+ store i8 0, ptr %arrayidx1, align 1
+ %call = call noalias ptr @strdup(ptr %x) nounwind
+ ret ptr %call
}
; TEST 7
-define i8* @test7() nounwind {
+define ptr @test7() nounwind {
; TUNIT: Function Attrs: nounwind
; TUNIT-LABEL: define {{[^@]+}}@test7
; TUNIT-SAME: () #[[ATTR2]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[A:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR2]]
-; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i8* [[A]], null
+; TUNIT-NEXT: [[A:%.*]] = call noalias ptr @malloc(i64 noundef 4) #[[ATTR2]]
+; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq ptr [[A]], null
; TUNIT-NEXT: br i1 [[TOBOOL]], label [[RETURN:%.*]], label [[IF_END:%.*]]
; TUNIT: if.end:
-; TUNIT-NEXT: store i8 7, i8* [[A]], align 1
+; TUNIT-NEXT: store i8 7, ptr [[A]], align 1
; TUNIT-NEXT: br label [[RETURN]]
; TUNIT: return:
-; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi i8* [ [[A]], [[IF_END]] ], [ null, [[ENTRY:%.*]] ]
-; TUNIT-NEXT: ret i8* [[RETVAL_0]]
+; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[A]], [[IF_END]] ], [ null, [[ENTRY:%.*]] ]
+; TUNIT-NEXT: ret ptr [[RETVAL_0]]
;
; CGSCC: Function Attrs: nounwind
; CGSCC-LABEL: define {{[^@]+}}@test7
; CGSCC-SAME: () #[[ATTR3]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[A:%.*]] = call noalias i8* @malloc(i64 noundef 4) #[[ATTR3]]
-; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i8* [[A]], null
+; CGSCC-NEXT: [[A:%.*]] = call noalias ptr @malloc(i64 noundef 4) #[[ATTR3]]
+; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq ptr [[A]], null
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[RETURN:%.*]], label [[IF_END:%.*]]
; CGSCC: if.end:
-; CGSCC-NEXT: store i8 7, i8* [[A]], align 1
+; CGSCC-NEXT: store i8 7, ptr [[A]], align 1
; CGSCC-NEXT: br label [[RETURN]]
; CGSCC: return:
-; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi i8* [ [[A]], [[IF_END]] ], [ null, [[ENTRY:%.*]] ]
-; CGSCC-NEXT: ret i8* [[RETVAL_0]]
+; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[A]], [[IF_END]] ], [ null, [[ENTRY:%.*]] ]
+; CGSCC-NEXT: ret ptr [[RETVAL_0]]
;
entry:
- %A = call noalias i8* @malloc(i64 4) nounwind
- %tobool = icmp eq i8* %A, null
+ %A = call noalias ptr @malloc(i64 4) nounwind
+ %tobool = icmp eq ptr %A, null
br i1 %tobool, label %return, label %if.end
if.end:
- store i8 7, i8* %A
+ store i8 7, ptr %A
br label %return
return:
- %retval.0 = phi i8* [ %A, %if.end ], [ null, %entry ]
- ret i8* %retval.0
+ %retval.0 = phi ptr [ %A, %if.end ], [ null, %entry ]
+ ret ptr %retval.0
}
; TEST 8
-define i8* @test8(i32* %0) nounwind uwtable {
+define ptr @test8(ptr %0) nounwind uwtable {
; CHECK: Function Attrs: nounwind uwtable
; CHECK-LABEL: define {{[^@]+}}@test8
-; CHECK-SAME: (i32* [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT: [[TMP2:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32* [[TMP0]], null
+; CHECK-SAME: (ptr [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] {
+; CHECK-NEXT: [[TMP2:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: [[TMP3:%.*]] = icmp ne ptr [[TMP0]], null
; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]]
; CHECK: 4:
-; CHECK-NEXT: store i8 10, i8* [[TMP2]], align 1
+; CHECK-NEXT: store i8 10, ptr [[TMP2]], align 1
; CHECK-NEXT: br label [[TMP5]]
; CHECK: 5:
-; CHECK-NEXT: ret i8* [[TMP2]]
+; CHECK-NEXT: ret ptr [[TMP2]]
;
- %2 = tail call noalias i8* @malloc(i64 4)
- %3 = icmp ne i32* %0, null
+ %2 = tail call noalias ptr @malloc(i64 4)
+ %3 = icmp ne ptr %0, null
br i1 %3, label %4, label %5
4: ; preds = %1
- store i8 10, i8* %2
+ store i8 10, ptr %2
br label %5
5: ; preds = %1, %4
- ret i8* %2
+ ret ptr %2
}
; TEST 9
; Simple Argument Test
-declare void @use_i8(i8* nocapture)
-define internal void @test9a(i8* %a, i8* %b) {
+declare void @use_i8(ptr nocapture)
+define internal void @test9a(ptr %a, ptr %b) {
; CHECK-LABEL: define {{[^@]+}}@test9a() {
-; CHECK-NEXT: call void @use_i8(i8* noalias nocapture noundef align 4294967296 null)
+; CHECK-NEXT: call void @use_i8(ptr noalias nocapture noundef align 4294967296 null)
; CHECK-NEXT: ret void
;
- call void @use_i8(i8* null)
+ call void @use_i8(ptr null)
ret void
}
-define internal void @test9b(i8* %a, i8* %b) {
+define internal void @test9b(ptr %a, ptr %b) {
; FIXME: %b should be noalias
; CHECK-LABEL: define {{[^@]+}}@test9b
-; CHECK-SAME: (i8* noalias nocapture [[A:%.*]], i8* nocapture [[B:%.*]]) {
-; CHECK-NEXT: call void @use_i8(i8* noalias nocapture [[A]])
-; CHECK-NEXT: call void @use_i8(i8* nocapture [[B]])
+; CHECK-SAME: (ptr noalias nocapture [[A:%.*]], ptr nocapture [[B:%.*]]) {
+; CHECK-NEXT: call void @use_i8(ptr noalias nocapture [[A]])
+; CHECK-NEXT: call void @use_i8(ptr nocapture [[B]])
; CHECK-NEXT: ret void
;
- call void @use_i8(i8* %a)
- call void @use_i8(i8* %b)
+ call void @use_i8(ptr %a)
+ call void @use_i8(ptr %b)
ret void
}
-define internal void @test9c(i8* %a, i8* %b, i8* %c) {
+define internal void @test9c(ptr %a, ptr %b, ptr %c) {
; CHECK-LABEL: define {{[^@]+}}@test9c
-; CHECK-SAME: (i8* noalias nocapture [[A:%.*]], i8* nocapture [[B:%.*]], i8* nocapture [[C:%.*]]) {
-; CHECK-NEXT: call void @use_i8(i8* noalias nocapture [[A]])
-; CHECK-NEXT: call void @use_i8(i8* nocapture [[B]])
-; CHECK-NEXT: call void @use_i8(i8* nocapture [[C]])
+; CHECK-SAME: (ptr noalias nocapture [[A:%.*]], ptr nocapture [[B:%.*]], ptr nocapture [[C:%.*]]) {
+; CHECK-NEXT: call void @use_i8(ptr noalias nocapture [[A]])
+; CHECK-NEXT: call void @use_i8(ptr nocapture [[B]])
+; CHECK-NEXT: call void @use_i8(ptr nocapture [[C]])
; CHECK-NEXT: ret void
;
- call void @use_i8(i8* %a)
- call void @use_i8(i8* %b)
- call void @use_i8(i8* %c)
+ call void @use_i8(ptr %a)
+ call void @use_i8(ptr %b)
+ call void @use_i8(ptr %c)
ret void
}
-define void @test9_helper(i8* %a, i8* %b) {
+define void @test9_helper(ptr %a, ptr %b) {
; CHECK-LABEL: define {{[^@]+}}@test9_helper
-; CHECK-SAME: (i8* nocapture [[A:%.*]], i8* nocapture [[B:%.*]]) {
+; CHECK-SAME: (ptr nocapture [[A:%.*]], ptr nocapture [[B:%.*]]) {
; CHECK-NEXT: tail call void @test9a()
; CHECK-NEXT: tail call void @test9a()
-; CHECK-NEXT: tail call void @test9b(i8* noalias nocapture [[A]], i8* nocapture [[B]])
-; CHECK-NEXT: tail call void @test9b(i8* noalias nocapture [[B]], i8* noalias nocapture [[A]])
-; CHECK-NEXT: tail call void @test9c(i8* noalias nocapture [[A]], i8* nocapture [[B]], i8* nocapture [[B]])
-; CHECK-NEXT: tail call void @test9c(i8* noalias nocapture [[B]], i8* noalias nocapture [[A]], i8* noalias nocapture [[A]])
+; CHECK-NEXT: tail call void @test9b(ptr noalias nocapture [[A]], ptr nocapture [[B]])
+; CHECK-NEXT: tail call void @test9b(ptr noalias nocapture [[B]], ptr noalias nocapture [[A]])
+; CHECK-NEXT: tail call void @test9c(ptr noalias nocapture [[A]], ptr nocapture [[B]], ptr nocapture [[B]])
+; CHECK-NEXT: tail call void @test9c(ptr noalias nocapture [[B]], ptr noalias nocapture [[A]], ptr noalias nocapture [[A]])
; CHECK-NEXT: ret void
;
- tail call void @test9a(i8* noalias %a, i8* %b)
- tail call void @test9a(i8* noalias %b, i8* noalias %a)
- tail call void @test9b(i8* noalias %a, i8* %b)
- tail call void @test9b(i8* noalias %b, i8* noalias %a)
- tail call void @test9c(i8* noalias %a, i8* %b, i8* %b)
- tail call void @test9c(i8* noalias %b, i8* noalias %a, i8* noalias %a)
+ tail call void @test9a(ptr noalias %a, ptr %b)
+ tail call void @test9a(ptr noalias %b, ptr noalias %a)
+ tail call void @test9b(ptr noalias %a, ptr %b)
+ tail call void @test9b(ptr noalias %b, ptr noalias %a)
+ tail call void @test9c(ptr noalias %a, ptr %b, ptr %b)
+ tail call void @test9c(ptr noalias %b, ptr noalias %a, ptr noalias %a)
ret void
}
@@ -351,224 +346,212 @@ define void @test9_helper(i8* %a, i8* %b) {
; TEST 10
; Simple CallSite Test
-declare void @test10_helper_1(i8* %a)
-define void @test10_helper_2(i8* noalias %a) {
+declare void @test10_helper_1(ptr %a)
+define void @test10_helper_2(ptr noalias %a) {
; CHECK-LABEL: define {{[^@]+}}@test10_helper_2
-; CHECK-SAME: (i8* noalias [[A:%.*]]) {
-; CHECK-NEXT: tail call void @test10_helper_1(i8* [[A]])
+; CHECK-SAME: (ptr noalias [[A:%.*]]) {
+; CHECK-NEXT: tail call void @test10_helper_1(ptr [[A]])
; CHECK-NEXT: ret void
;
- tail call void @test10_helper_1(i8* %a)
+ tail call void @test10_helper_1(ptr %a)
ret void
}
-define void @test10(i8* noalias %a) {
+define void @test10(ptr noalias %a) {
; CHECK-LABEL: define {{[^@]+}}@test10
-; CHECK-SAME: (i8* noalias [[A:%.*]]) {
-; CHECK-NEXT: tail call void @test10_helper_1(i8* [[A]])
-; CHECK-NEXT: tail call void @test10_helper_2(i8* noalias [[A]])
+; CHECK-SAME: (ptr noalias [[A:%.*]]) {
+; CHECK-NEXT: tail call void @test10_helper_1(ptr [[A]])
+; CHECK-NEXT: tail call void @test10_helper_2(ptr noalias [[A]])
; CHECK-NEXT: ret void
;
; FIXME: missing noalias
- tail call void @test10_helper_1(i8* %a)
+ tail call void @test10_helper_1(ptr %a)
- tail call void @test10_helper_2(i8* %a)
+ tail call void @test10_helper_2(ptr %a)
ret void
}
; TEST 11
; CallSite Test
-declare void @test11_helper(i8* %a, i8 *%b)
-define void @test11(i8* noalias %a) {
+declare void @test11_helper(ptr %a, ptr %b)
+define void @test11(ptr noalias %a) {
; CHECK-LABEL: define {{[^@]+}}@test11
-; CHECK-SAME: (i8* noalias [[A:%.*]]) {
-; CHECK-NEXT: tail call void @test11_helper(i8* [[A]], i8* [[A]])
+; CHECK-SAME: (ptr noalias [[A:%.*]]) {
+; CHECK-NEXT: tail call void @test11_helper(ptr [[A]], ptr [[A]])
; CHECK-NEXT: ret void
;
- tail call void @test11_helper(i8* %a, i8* %a)
+ tail call void @test11_helper(ptr %a, ptr %a)
ret void
}
; TEST 12
; CallSite Argument
-declare void @use_nocapture(i8* nocapture)
-declare void @use(i8*)
+declare void @use_nocapture(ptr nocapture)
+declare void @use(ptr)
define void @test12_1() {
; CHECK-LABEL: define {{[^@]+}}@test12_1() {
; CHECK-NEXT: [[A:%.*]] = alloca i8, align 4
-; CHECK-NEXT: [[B:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: tail call void @use_nocapture(i8* noalias nocapture noundef nonnull align 4 dereferenceable(1) [[A]])
-; CHECK-NEXT: tail call void @use_nocapture(i8* noalias nocapture noundef nonnull align 4 dereferenceable(1) [[A]])
-; CHECK-NEXT: tail call void @use_nocapture(i8* noalias nocapture [[B]])
-; CHECK-NEXT: tail call void @use_nocapture(i8* noalias nocapture [[B]])
+; CHECK-NEXT: [[B:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: tail call void @use_nocapture(ptr noalias nocapture noundef nonnull align 4 dereferenceable(1) [[A]])
+; CHECK-NEXT: tail call void @use_nocapture(ptr noalias nocapture noundef nonnull align 4 dereferenceable(1) [[A]])
+; CHECK-NEXT: tail call void @use_nocapture(ptr noalias nocapture [[B]])
+; CHECK-NEXT: tail call void @use_nocapture(ptr noalias nocapture [[B]])
; CHECK-NEXT: ret void
;
%A = alloca i8, align 4
- %B = tail call noalias i8* @malloc(i64 4)
- tail call void @use_nocapture(i8* %A)
- tail call void @use_nocapture(i8* %A)
- tail call void @use_nocapture(i8* %B)
- tail call void @use_nocapture(i8* %B)
+ %B = tail call noalias ptr @malloc(i64 4)
+ tail call void @use_nocapture(ptr %A)
+ tail call void @use_nocapture(ptr %A)
+ tail call void @use_nocapture(ptr %B)
+ tail call void @use_nocapture(ptr %B)
ret void
}
define void @test12_2(){
; CHECK-LABEL: define {{[^@]+}}@test12_2() {
-; CHECK-NEXT: [[A:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: tail call void @use_nocapture(i8* nocapture [[A]])
-; CHECK-NEXT: tail call void @use_nocapture(i8* nocapture [[A]])
-; CHECK-NEXT: tail call void @use(i8* [[A]])
-; CHECK-NEXT: tail call void @use_nocapture(i8* nocapture [[A]])
+; CHECK-NEXT: [[A:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: tail call void @use_nocapture(ptr nocapture [[A]])
+; CHECK-NEXT: tail call void @use_nocapture(ptr nocapture [[A]])
+; CHECK-NEXT: tail call void @use(ptr [[A]])
+; CHECK-NEXT: tail call void @use_nocapture(ptr nocapture [[A]])
; CHECK-NEXT: ret void
;
-; FIXME: This should be @use_nocapture(i8* noalias [[A]])
-; FIXME: This should be @use_nocapture(i8* noalias nocapture [[A]])
- %A = tail call noalias i8* @malloc(i64 4)
- tail call void @use_nocapture(i8* %A)
- tail call void @use_nocapture(i8* %A)
- tail call void @use(i8* %A)
- tail call void @use_nocapture(i8* %A)
+; FIXME: This should be @use_nocapture(ptr noalias [[A]])
+; FIXME: This should be @use_nocapture(ptr noalias nocapture [[A]])
+ %A = tail call noalias ptr @malloc(i64 4)
+ tail call void @use_nocapture(ptr %A)
+ tail call void @use_nocapture(ptr %A)
+ tail call void @use(ptr %A)
+ tail call void @use_nocapture(ptr %A)
ret void
}
-declare void @two_args(i8* nocapture , i8* nocapture)
+declare void @two_args(ptr nocapture , ptr nocapture)
define void @test12_3(){
; CHECK-LABEL: define {{[^@]+}}@test12_3() {
-; CHECK-NEXT: [[A:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A]])
+; CHECK-NEXT: [[A:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: tail call void @two_args(ptr nocapture [[A]], ptr nocapture [[A]])
; CHECK-NEXT: ret void
;
- %A = tail call noalias i8* @malloc(i64 4)
- tail call void @two_args(i8* %A, i8* %A)
+ %A = tail call noalias ptr @malloc(i64 4)
+ tail call void @two_args(ptr %A, ptr %A)
ret void
}
define void @test12_4(){
; CHECK-LABEL: define {{[^@]+}}@test12_4() {
-; CHECK-NEXT: [[A:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: [[B:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: [[A_1:%.*]] = getelementptr i8, i8* [[A]], i64 1
-; CHECK-NEXT: tail call void @two_args(i8* noalias nocapture [[A]], i8* noalias nocapture [[B]])
-; CHECK-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A]])
-; CHECK-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[A_1]])
-; CHECK-NEXT: tail call void @two_args(i8* nocapture [[A]], i8* nocapture [[B]])
+; CHECK-NEXT: [[A:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: [[B:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: [[A_1:%.*]] = getelementptr i8, ptr [[A]], i64 1
+; CHECK-NEXT: tail call void @two_args(ptr noalias nocapture [[A]], ptr noalias nocapture [[B]])
+; CHECK-NEXT: tail call void @two_args(ptr nocapture [[A]], ptr nocapture [[A]])
+; CHECK-NEXT: tail call void @two_args(ptr nocapture [[A]], ptr nocapture [[A_1]])
+; CHECK-NEXT: tail call void @two_args(ptr noalias nocapture [[A]], ptr noalias nocapture [[B]])
; CHECK-NEXT: ret void
;
- %A = tail call noalias i8* @malloc(i64 4)
- %B = tail call noalias i8* @malloc(i64 4)
- %A_0 = getelementptr i8, i8* %A, i64 0
- %A_1 = getelementptr i8, i8* %A, i64 1
- %B_0 = getelementptr i8, i8* %B, i64 0
+ %A = tail call noalias ptr @malloc(i64 4)
+ %B = tail call noalias ptr @malloc(i64 4)
+ %A_1 = getelementptr i8, ptr %A, i64 1
- tail call void @two_args(i8* %A, i8* %B)
+ tail call void @two_args(ptr %A, ptr %B)
- tail call void @two_args(i8* %A, i8* %A_0)
+ tail call void @two_args(ptr %A, ptr %A)
- tail call void @two_args(i8* %A, i8* %A_1)
+ tail call void @two_args(ptr %A, ptr %A_1)
-; FIXME: This should be @two_args(i8* noalias nocapture %A_0, i8* noalias nocapture %B_0)
- tail call void @two_args(i8* %A_0, i8* %B_0)
+; FIXME: This should be @two_args(ptr noalias nocapture %A, ptr noalias nocapture %B)
+ tail call void @two_args(ptr %A, ptr %B)
ret void
}
; TEST 13
-define void @use_i8_internal(i8* %a) {
+define void @use_i8_internal(ptr %a) {
; CHECK-LABEL: define {{[^@]+}}@use_i8_internal
-; CHECK-SAME: (i8* nocapture [[A:%.*]]) {
-; CHECK-NEXT: call void @use_i8(i8* nocapture [[A]])
+; CHECK-SAME: (ptr nocapture [[A:%.*]]) {
+; CHECK-NEXT: call void @use_i8(ptr nocapture [[A]])
; CHECK-NEXT: ret void
;
- call void @use_i8(i8* %a)
+ call void @use_i8(ptr %a)
ret void
}
define void @test13_use_noalias(){
; CHECK-LABEL: define {{[^@]+}}@test13_use_noalias() {
-; CHECK-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: call void @use_i8_internal(i8* noalias nocapture [[M1]])
+; CHECK-NEXT: [[M1:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: call void @use_i8_internal(ptr noalias nocapture [[M1]])
; CHECK-NEXT: ret void
;
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13_use_noalias()
-; IS__CGSCC_OPM-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 4)
-; IS__CGSCC_OPM-NEXT: [[C1:%.*]] = bitcast i8* [[M1]] to i16*
-; IS__CGSCC_OPM-NEXT: [[C2:%.*]] = bitcast i16* [[C1]] to i8*
-; IS__CGSCC_OPM-NEXT: call void @use_i8_internal(i8* noalias [[C2]])
+; IS__CGSCC_OPM-NEXT: [[M1:%.*]] = tail call noalias ptr @malloc(i64 4)
+; IS__CGSCC_OPM-NEXT: call void @use_i8_internal(ptr noalias [[M1]])
; IS__CGSCC_OPM-NEXT: ret void
- %m1 = tail call noalias i8* @malloc(i64 4)
- %c1 = bitcast i8* %m1 to i16*
- %c2 = bitcast i16* %c1 to i8*
- call void @use_i8_internal(i8* %c2)
+ %m1 = tail call noalias ptr @malloc(i64 4)
+ call void @use_i8_internal(ptr %m1)
ret void
}
define void @test13_use_alias(){
; CHECK-LABEL: define {{[^@]+}}@test13_use_alias() {
-; CHECK-NEXT: [[M1:%.*]] = tail call noalias i8* @malloc(i64 noundef 4)
-; CHECK-NEXT: call void @use_i8_internal(i8* nocapture [[M1]])
-; CHECK-NEXT: call void @use_i8_internal(i8* nocapture [[M1]])
+; CHECK-NEXT: [[M1:%.*]] = tail call noalias ptr @malloc(i64 noundef 4)
+; CHECK-NEXT: call void @use_i8_internal(ptr noalias nocapture [[M1]])
+; CHECK-NEXT: call void @use_i8_internal(ptr noalias nocapture [[M1]])
; CHECK-NEXT: ret void
;
- %m1 = tail call noalias i8* @malloc(i64 4)
- %c1 = bitcast i8* %m1 to i16*
- %c2a = bitcast i16* %c1 to i8*
- %c2b = bitcast i16* %c1 to i8*
- call void @use_i8_internal(i8* %c2a)
- call void @use_i8_internal(i8* %c2b)
+ %m1 = tail call noalias ptr @malloc(i64 4)
+ call void @use_i8_internal(ptr %m1)
+ call void @use_i8_internal(ptr %m1)
ret void
}
; TEST 14 i2p casts
-define internal i32 @p2i(i32* %arg) {
+define internal i32 @p2i(ptr %arg) {
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define {{[^@]+}}@p2i
-; CHECK-SAME: (i32* noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] {
-; CHECK-NEXT: [[P2I:%.*]] = ptrtoint i32* [[ARG]] to i32
+; CHECK-SAME: (ptr noalias nofree readnone [[ARG:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT: [[P2I:%.*]] = ptrtoint ptr [[ARG]] to i32
; CHECK-NEXT: ret i32 [[P2I]]
;
- %p2i = ptrtoint i32* %arg to i32
+ %p2i = ptrtoint ptr %arg to i32
ret i32 %p2i
}
-define i32 @i2p(i32* %arg) {
+define i32 @i2p(ptr %arg) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(read)
; TUNIT-LABEL: define {{[^@]+}}@i2p
-; TUNIT-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] {
-; TUNIT-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR10:[0-9]+]]
-; TUNIT-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to i8*
-; TUNIT-NEXT: [[BC:%.*]] = bitcast i8* [[I2P]] to i32*
-; TUNIT-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree readonly align 4 [[BC]]) #[[ATTR10]]
+; TUNIT-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] {
+; TUNIT-NEXT: [[C:%.*]] = call i32 @p2i(ptr noalias nofree readnone [[ARG]]) #[[ATTR10:[0-9]+]]
+; TUNIT-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to ptr
+; TUNIT-NEXT: [[CALL:%.*]] = call i32 @ret(ptr nocapture nofree readonly align 4 [[I2P]]) #[[ATTR10]]
; TUNIT-NEXT: ret i32 [[CALL]]
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(read)
; CGSCC-LABEL: define {{[^@]+}}@i2p
-; CGSCC-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
-; CGSCC-NEXT: [[C:%.*]] = call i32 @p2i(i32* noalias nofree readnone [[ARG]]) #[[ATTR11]]
-; CGSCC-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to i8*
-; CGSCC-NEXT: [[BC:%.*]] = bitcast i8* [[I2P]] to i32*
-; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret(i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[BC]]) #[[ATTR11]]
+; CGSCC-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
+; CGSCC-NEXT: [[C:%.*]] = call i32 @p2i(ptr noalias nofree readnone [[ARG]]) #[[ATTR11]]
+; CGSCC-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to ptr
+; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[I2P]]) #[[ATTR11]]
; CGSCC-NEXT: ret i32 [[CALL]]
;
- %c = call i32 @p2i(i32* %arg)
- %i2p = inttoptr i32 %c to i8*
- %bc = bitcast i8* %i2p to i32*
- %call = call i32 @ret(i32* %bc)
+ %c = call i32 @p2i(ptr %arg)
+ %i2p = inttoptr i32 %c to ptr
+ %call = call i32 @ret(ptr %i2p)
ret i32 %call
}
-define internal i32 @ret(i32* %arg) {
+define internal i32 @ret(ptr %arg) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: read)
; TUNIT-LABEL: define {{[^@]+}}@ret
-; TUNIT-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
-; TUNIT-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4
+; TUNIT-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
+; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[ARG]], align 4
; TUNIT-NEXT: ret i32 [[L]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: read)
; CGSCC-LABEL: define {{[^@]+}}@ret
-; CGSCC-SAME: (i32* nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR6:[0-9]+]] {
-; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[ARG]], align 4
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR6:[0-9]+]] {
+; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[ARG]], align 4
; CGSCC-NEXT: ret i32 [[L]]
;
- %l = load i32, i32* %arg
+ %l = load i32, ptr %arg
ret i32 %l
}
@@ -576,138 +559,135 @@ define internal i32 @ret(i32* %arg) {
; uses possibly executed before this callsite.
; IR referred from musl/src/strtod.c file
-%struct._IO_FILE = type { i32, i8*, i8*, i32 (%struct._IO_FILE*)*, i8*, i8*, i8*, i8*, i32 (%struct._IO_FILE*, i8*, i32)*, i32 (%struct._IO_FILE*, i8*, i32)*, i64 (%struct._IO_FILE*, i64, i32)*, i8*, i32, %struct._IO_FILE*, %struct._IO_FILE*, i32, i32, i32, i16, i8, i8, i32, i32, i8*, i64, i8*, i8*, i8*, [4 x i8], i64, i64, %struct._IO_FILE*, %struct._IO_FILE*, %struct.__locale_struct*, [4 x i8] }
-%struct.__locale_struct = type { [6 x %struct.__locale_map*] }
+%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, i16, i8, i8, i32, i32, ptr, i64, ptr, ptr, ptr, [4 x i8], i64, i64, ptr, ptr, ptr, [4 x i8] }
+%struct.__locale_struct = type { [6 x ptr] }
%struct.__locale_map = type opaque
; Function Attrs: nounwind optsize
-define internal fastcc double @strtox(i8* %s, i8** %p, i32 %prec) unnamed_addr {
+define internal fastcc double @strtox(ptr %s, ptr %p, i32 %prec) unnamed_addr {
; TUNIT-LABEL: define {{[^@]+}}@strtox
-; TUNIT-SAME: (i8* [[S:%.*]]) unnamed_addr {
+; TUNIT-SAME: (ptr [[S:%.*]]) unnamed_addr {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8
-; TUNIT-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR11:[0-9]+]]
-; TUNIT-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]])
-; TUNIT-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0)
-; TUNIT-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1)
-; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]])
+; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR11:[0-9]+]]
+; TUNIT-NEXT: [[CALL:%.*]] = call i32 @sh_fromstring(ptr nonnull align 8 dereferenceable(240) [[F]], ptr [[S]])
+; TUNIT-NEXT: call void @__shlim(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0)
+; TUNIT-NEXT: [[CALL1:%.*]] = call double @__floatscan(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1)
+; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]])
; TUNIT-NEXT: ret double [[CALL1]]
;
; CGSCC-LABEL: define {{[^@]+}}@strtox
-; CGSCC-SAME: (i8* [[S:%.*]]) unnamed_addr {
+; CGSCC-SAME: (ptr [[S:%.*]]) unnamed_addr {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8
-; CGSCC-NEXT: [[TMP0:%.*]] = bitcast %struct._IO_FILE* [[F]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]]) #[[ATTR12:[0-9]+]]
-; CGSCC-NEXT: [[CALL:%.*]] = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull align 8 dereferenceable(240) [[F]], i8* [[S]])
-; CGSCC-NEXT: call void @__shlim(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0)
-; CGSCC-NEXT: [[CALL1:%.*]] = call double @__floatscan(%struct._IO_FILE* noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1)
-; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 144, i8* nocapture nofree noundef nonnull align 8 dereferenceable(240) [[TMP0]])
+; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR12:[0-9]+]]
+; CGSCC-NEXT: [[CALL:%.*]] = call i32 @sh_fromstring(ptr nonnull align 8 dereferenceable(240) [[F]], ptr [[S]])
+; CGSCC-NEXT: call void @__shlim(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0)
+; CGSCC-NEXT: [[CALL1:%.*]] = call double @__floatscan(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1)
+; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]])
; CGSCC-NEXT: ret double [[CALL1]]
;
entry:
%f = alloca %struct._IO_FILE, align 8
- %0 = bitcast %struct._IO_FILE* %f to i8*
- call void @llvm.lifetime.start.p0i8(i64 144, i8* nonnull %0)
- %call = call i32 bitcast (i32 (...)* @sh_fromstring to i32 (%struct._IO_FILE*, i8*)*)(%struct._IO_FILE* nonnull %f, i8* %s)
- call void @__shlim(%struct._IO_FILE* nonnull %f, i64 0)
- %call1 = call double @__floatscan(%struct._IO_FILE* nonnull %f, i32 %prec, i32 1)
- call void @llvm.lifetime.end.p0i8(i64 144, i8* nonnull %0)
+ call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %f)
+ %call = call i32 @sh_fromstring(ptr nonnull %f, ptr %s)
+ call void @__shlim(ptr nonnull %f, i64 0)
+ %call1 = call double @__floatscan(ptr nonnull %f, i32 %prec, i32 1)
+ call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %f)
ret double %call1
}
; Function Attrs: nounwind optsize
-define dso_local double @strtod(i8* noalias %s, i8** noalias %p) {
+define dso_local double @strtod(ptr noalias %s, ptr noalias %p) {
; CHECK-LABEL: define {{[^@]+}}@strtod
-; CHECK-SAME: (i8* noalias [[S:%.*]], i8** noalias nocapture nofree readnone [[P:%.*]]) {
+; CHECK-SAME: (ptr noalias [[S:%.*]], ptr noalias nocapture nofree readnone [[P:%.*]]) {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[CALL:%.*]] = tail call fastcc double @strtox(i8* [[S]])
+; CHECK-NEXT: [[CALL:%.*]] = tail call fastcc double @strtox(ptr [[S]])
; CHECK-NEXT: ret double [[CALL]]
;
entry:
- %call = tail call fastcc double @strtox(i8* %s, i8** %p, i32 1)
+ %call = tail call fastcc double @strtox(ptr %s, ptr %p, i32 1)
ret double %call
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
; Function Attrs: optsize
declare dso_local i32 @sh_fromstring(...) local_unnamed_addr
; Function Attrs: optsize
-declare dso_local void @__shlim(%struct._IO_FILE*, i64) local_unnamed_addr
+declare dso_local void @__shlim(ptr, i64) local_unnamed_addr
; Function Attrs: optsize
-declare dso_local double @__floatscan(%struct._IO_FILE*, i32, i32) local_unnamed_addr
+declare dso_local double @__floatscan(ptr, i32, i32) local_unnamed_addr
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
; Test 15
; propagate noalias to some callsite arguments that there is no possibly reachable capture before it
- at alias_of_p = external global i32*
+ at alias_of_p = external global ptr
-define void @make_alias(i32* %p) {
+define void @make_alias(ptr %p) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@make_alias
-; TUNIT-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] {
-; TUNIT-NEXT: store i32* [[P]], i32** @alias_of_p, align 8
+; TUNIT-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] {
+; TUNIT-NEXT: store ptr [[P]], ptr @alias_of_p, align 8
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@make_alias
-; CGSCC-SAME: (i32* nofree writeonly [[P:%.*]]) #[[ATTR8:[0-9]+]] {
-; CGSCC-NEXT: store i32* [[P]], i32** @alias_of_p, align 8
+; CGSCC-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR8:[0-9]+]] {
+; CGSCC-NEXT: store ptr [[P]], ptr @alias_of_p, align 8
; CGSCC-NEXT: ret void
;
- store i32* %p, i32** @alias_of_p
+ store ptr %p, ptr @alias_of_p
ret void
}
-define void @only_store(i32* %p) {
+define void @only_store(ptr %p) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: write)
; TUNIT-LABEL: define {{[^@]+}}@only_store
-; TUNIT-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] {
-; TUNIT-NEXT: store i32 0, i32* [[P]], align 4
+; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] {
+; TUNIT-NEXT: store i32 0, ptr [[P]], align 4
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: write)
; CGSCC-LABEL: define {{[^@]+}}@only_store
-; CGSCC-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] {
-; CGSCC-NEXT: store i32 0, i32* [[P]], align 4
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] {
+; CGSCC-NEXT: store i32 0, ptr [[P]], align 4
; CGSCC-NEXT: ret void
;
- store i32 0, i32* %p
+ store i32 0, ptr %p
ret void
}
-define void @test15_caller(i32* noalias %p, i32 %c) {
+define void @test15_caller(ptr noalias %p, i32 %c) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@test15_caller
-; TUNIT-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] {
+; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] {
; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; TUNIT: if.then:
-; TUNIT-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[IF_END]]
; TUNIT: if.end:
-; TUNIT-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR10]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@test15_caller
-; CGSCC-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10:[0-9]+]] {
+; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10:[0-9]+]] {
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CGSCC: if.then:
-; CGSCC-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]]
+; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]]
; CGSCC-NEXT: br label [[IF_END]]
; CGSCC: if.end:
-; CGSCC-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR13]]
+; CGSCC-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR13]]
; CGSCC-NEXT: ret void
;
%tobool = icmp eq i32 %c, 0
@@ -715,11 +695,11 @@ define void @test15_caller(i32* noalias %p, i32 %c) {
if.then:
- tail call void @only_store(i32* %p)
+ tail call void @only_store(ptr %p)
br label %if.end
if.end:
- tail call void @make_alias(i32* %p)
+ tail call void @make_alias(ptr %p)
ret void
}
@@ -738,43 +718,43 @@ if.end:
; test16_sub(p, c, c);
; }
;
-; FIXME: this should be tail @only_store(i32* noalias %p)
+; FIXME: this should be tail @only_store(ptr noalias %p)
; when test16_caller is called, c1 always equals to c2. (Note that linkage is internal)
; Therefore, only one of the two conditions of if statementes will be fulfilled.
-define internal void @test16_sub(i32* noalias %p, i32 %c1, i32 %c2) {
+define internal void @test16_sub(ptr noalias %p, i32 %c1, i32 %c2) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@test16_sub
-; TUNIT-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] {
+; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] {
; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0
; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; TUNIT: if.then:
-; TUNIT-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
-; TUNIT-NEXT: tail call void @make_alias(i32* nofree writeonly align 4 [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @make_alias(ptr nofree writeonly align 4 [[P]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[IF_END]]
; TUNIT: if.end:
; TUNIT-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0
; TUNIT-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]]
; TUNIT: if.then2:
-; TUNIT-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @only_store(ptr nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[IF_END3]]
; TUNIT: if.end3:
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@test16_sub
-; CGSCC-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR10]] {
+; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR10]] {
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CGSCC: if.then:
-; CGSCC-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14:[0-9]+]]
-; CGSCC-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
+; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14:[0-9]+]]
+; CGSCC-NEXT: tail call void @make_alias(ptr nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: br label [[IF_END]]
; CGSCC: if.end:
; CGSCC-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0
; CGSCC-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]]
; CGSCC: if.then2:
-; CGSCC-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]]
+; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]]
; CGSCC-NEXT: br label [[IF_END3]]
; CGSCC: if.end3:
; CGSCC-NEXT: ret void
@@ -783,8 +763,8 @@ define internal void @test16_sub(i32* noalias %p, i32 %c1, i32 %c2) {
br i1 %tobool, label %if.end, label %if.then
if.then:
- tail call void @only_store(i32* %p)
- tail call void @make_alias(i32* %p)
+ tail call void @only_store(ptr %p)
+ tail call void @make_alias(ptr %p)
br label %if.end
if.end:
@@ -792,27 +772,27 @@ if.end:
br i1 %tobool1, label %if.then2, label %if.end3
if.then2:
- tail call void @only_store(i32* %p)
+ tail call void @only_store(ptr %p)
br label %if.end3
if.end3:
ret void
}
-define void @test16_caller(i32* %p, i32 %c) {
+define void @test16_caller(ptr %p, i32 %c) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@test16_caller
-; TUNIT-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] {
-; TUNIT-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR10]]
+; TUNIT-SAME: (ptr nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] {
+; TUNIT-NEXT: tail call void @test16_sub(ptr noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR10]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@test16_caller
-; CGSCC-SAME: (i32* nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] {
-; CGSCC-NEXT: tail call void @test16_sub(i32* noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]]
+; CGSCC-SAME: (ptr nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] {
+; CGSCC-NEXT: tail call void @test16_sub(ptr noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]]
; CGSCC-NEXT: ret void
;
- tail call void @test16_sub(i32* %p, i32 %c, i32 %c)
+ tail call void @test16_sub(ptr %p, i32 %c, i32 %c)
ret void
}
@@ -835,33 +815,33 @@ define void @test16_caller(i32* %p, i32 %c) {
; return;
; }
-define void @test17_caller(i32* noalias %p, i32 %c) {
+define void @test17_caller(ptr noalias %p, i32 %c) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@test17_caller
-; TUNIT-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] {
+; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; TUNIT-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]]
; TUNIT: l1:
-; TUNIT-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[L3:%.*]]
; TUNIT: l2:
-; TUNIT-NEXT: tail call void @only_store(i32* noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[L3]]
; TUNIT: l3:
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@test17_caller
-; CGSCC-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] {
+; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]]
; CGSCC: l1:
-; CGSCC-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR13]]
+; CGSCC-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR13]]
; CGSCC-NEXT: br label [[L3:%.*]]
; CGSCC: l2:
-; CGSCC-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
+; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: br label [[L3]]
; CGSCC: l3:
; CGSCC-NEXT: ret void
@@ -871,12 +851,12 @@ entry:
br i1 %tobool, label %l1, label %l2
l1:
- tail call void @make_alias(i32* %p)
+ tail call void @make_alias(ptr %p)
%tobool2 = icmp eq i32 0, 0
br i1 %tobool2, label %l3, label %l2
l2:
- tail call void @only_store(i32* %p)
+ tail call void @only_store(ptr %p)
br label %l3
l3:
@@ -908,31 +888,31 @@ define void @noreturn() {
ret void
}
-define void @test18_caller(i32* noalias %p, i32 %c) {
+define void @test18_caller(ptr noalias %p, i32 %c) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@test18_caller
-; TUNIT-SAME: (i32* noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] {
+; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; TUNIT-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]]
; TUNIT: l1:
-; TUNIT-NEXT: tail call void @make_alias(i32* nofree writeonly [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[L2]]
; TUNIT: l2:
-; TUNIT-NEXT: tail call void @only_store(i32* nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
+; TUNIT-NEXT: tail call void @only_store(ptr nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@test18_caller
-; CGSCC-SAME: (i32* noalias nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] {
+; CGSCC-SAME: (ptr noalias nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]]
; CGSCC: l1:
-; CGSCC-NEXT: tail call void @make_alias(i32* nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
+; CGSCC-NEXT: tail call void @make_alias(ptr nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: br label [[L2]]
; CGSCC: l2:
-; CGSCC-NEXT: tail call void @only_store(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
+; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: ret void
;
entry:
@@ -940,12 +920,12 @@ entry:
br i1 %tobool, label %l1, label %l2
l1:
- tail call void @make_alias(i32* %p)
+ tail call void @make_alias(ptr %p)
tail call void @noreturn()
br label %l2
l2:
- tail call void @only_store(i32* %p)
+ tail call void @only_store(ptr %p)
ret void
}
;.
diff --git a/llvm/test/Transforms/Attributor/returned.ll b/llvm/test/Transforms/Attributor/returned.ll
index 8df977c2cea7b..a2e836f404bba 100644
--- a/llvm/test/Transforms/Attributor/returned.ll
+++ b/llvm/test/Transforms/Attributor/returned.ll
@@ -37,8 +37,8 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
;.
; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external global i8
-; CHECK: @[[_ZTI1X:[a-zA-Z0-9_$"\\.-]+]] = external dso_local constant { i8*, i8* }, align 8
-; CHECK: @[[_ZTI1Y:[a-zA-Z0-9_$"\\.-]+]] = external dso_local constant { i8*, i8*, i8* }, align 8
+; CHECK: @[[_ZTI1X:[a-zA-Z0-9_$"\\.-]+]] = external dso_local constant { ptr, ptr }, align 8
+; CHECK: @[[_ZTI1Y:[a-zA-Z0-9_$"\\.-]+]] = external dso_local constant { ptr, ptr, ptr }, align 8
;.
define i32 @sink_r0(i32 %r) #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
@@ -324,151 +324,151 @@ return: ; preds = %cond.end, %if.then3
; return ptr_scc_r1(ptr_sink_r0(b), ptr_scc_r2(ptr_scc_r1(a, b, r), ptr_scc_r1(a, ptr_scc_r2(r, r, r), r), ptr_scc_r2(a, b, r)), ptr_scc_r1(a, b, r));
; return a == b ? r : ptr_scc_r2(a, b, r);
; }
-define double* @ptr_sink_r0(double* %r) #0 {
+define ptr @ptr_sink_r0(ptr %r) #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; CHECK-LABEL: define {{[^@]+}}@ptr_sink_r0
-; CHECK-SAME: (double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: ret double* [[R]]
+; CHECK-NEXT: ret ptr [[R]]
;
entry:
- ret double* %r
+ ret ptr %r
}
-define double* @ptr_scc_r1(double* %a, double* %r, double* %b) #0 {
+define ptr @ptr_scc_r1(ptr %a, ptr %r, ptr %b) #0 {
; TUNIT: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@ptr_scc_r1
-; TUNIT-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], ptr nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
-; TUNIT-NEXT: ret double* [[R]]
+; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
+; TUNIT-NEXT: ret ptr [[R]]
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@ptr_scc_r1
-; CGSCC-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nofree readnone returned [[R:%.*]], double* nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned [[R:%.*]], ptr nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone [[R]]) #[[ATTR7]]
-; CGSCC-NEXT: ret double* [[R]]
+; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]]) #[[ATTR7]]
+; CGSCC-NEXT: ret ptr [[R]]
;
entry:
- %call = call double* @ptr_sink_r0(double* %r)
- %call1 = call double* @ptr_scc_r2(double* %r, double* %a, double* %call)
- ret double* %call1
+ %call = call ptr @ptr_sink_r0(ptr %r)
+ %call1 = call ptr @ptr_scc_r2(ptr %r, ptr %a, ptr %call)
+ ret ptr %call1
}
-define double* @ptr_scc_r2(double* %a, double* %b, double* %r) #0 {
+define ptr @ptr_scc_r2(ptr %a, ptr %b, ptr %r) #0 {
; TUNIT: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@ptr_scc_r2
-; TUNIT-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nocapture nofree readnone [[B:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]]
+; TUNIT-NEXT: [[CMP:%.*]] = icmp ugt ptr [[A]], [[B]]
; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; TUNIT: if.then:
-; TUNIT-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[RETURN:%.*]]
; TUNIT: if.end:
-; TUNIT-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]]
+; TUNIT-NEXT: [[CMP2:%.*]] = icmp ult ptr [[A]], [[B]]
; TUNIT-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]]
; TUNIT: if.then3:
-; TUNIT-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR10]]
-; TUNIT-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
-; TUNIT-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR10]]
-; TUNIT-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
-; TUNIT-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
-; TUNIT-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL5:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]], ptr noalias nocapture nofree readnone undef) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL6:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL7:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL8:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL9:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL11:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR10]]
; TUNIT-NEXT: br label [[RETURN]]
; TUNIT: if.end12:
-; TUNIT-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]]
+; TUNIT-NEXT: [[CMP13:%.*]] = icmp eq ptr [[A]], [[B]]
; TUNIT-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
; TUNIT: cond.true:
; TUNIT-NEXT: br label [[COND_END:%.*]]
; TUNIT: cond.false:
-; TUNIT-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL14:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[COND_END]]
; TUNIT: cond.end:
-; TUNIT-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ]
+; TUNIT-NEXT: [[COND:%.*]] = phi ptr [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ]
; TUNIT-NEXT: br label [[RETURN]]
; TUNIT: return:
-; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[R]], [[COND_END]] ]
-; TUNIT-NEXT: ret double* [[R]]
+; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[R]], [[COND_END]] ]
+; TUNIT-NEXT: ret ptr [[R]]
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@ptr_scc_r2
-; CGSCC-SAME: (double* nocapture nofree readnone [[A:%.*]], double* nocapture nofree readnone [[B:%.*]], double* nofree readnone returned [[R:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nocapture nofree readnone [[B:%.*]], ptr nofree readnone returned [[R:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CMP:%.*]] = icmp ugt double* [[A]], [[B]]
+; CGSCC-NEXT: [[CMP:%.*]] = icmp ugt ptr [[A]], [[B]]
; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CGSCC: if.then:
-; CGSCC-NEXT: [[CALL1:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone [[R]]) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]]) #[[ATTR7]]
; CGSCC-NEXT: br label [[RETURN:%.*]]
; CGSCC: if.end:
-; CGSCC-NEXT: [[CMP2:%.*]] = icmp ult double* [[A]], [[B]]
+; CGSCC-NEXT: [[CMP2:%.*]] = icmp ult ptr [[A]], [[B]]
; CGSCC-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]]
; CGSCC: if.then3:
-; CGSCC-NEXT: [[CALL5:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone [[B]], double* noalias nocapture nofree readnone undef) #[[ATTR7]]
-; CGSCC-NEXT: [[CALL6:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[R]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone [[R]]) #[[ATTR7]]
-; CGSCC-NEXT: [[CALL7:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[A]], double* noalias nofree readnone [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR7]]
-; CGSCC-NEXT: [[CALL8:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone [[R]]) #[[ATTR7]]
-; CGSCC-NEXT: [[CALL9:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[B]], double* noalias nocapture nofree readnone [[R]], double* noalias nofree readnone [[R]]) #[[ATTR7]]
-; CGSCC-NEXT: [[CALL11:%.*]] = call double* @ptr_scc_r1(double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone [[R]], double* noalias nocapture nofree readnone undef) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL5:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[B]], ptr noalias nocapture nofree readnone undef) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL6:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone [[R]]) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL7:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL8:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]]) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL9:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone [[R]]) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL11:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR7]]
; CGSCC-NEXT: br label [[RETURN]]
; CGSCC: if.end12:
-; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq double* [[A]], [[B]]
+; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq ptr [[A]], [[B]]
; CGSCC-NEXT: br i1 [[CMP13]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
; CGSCC: cond.true:
; CGSCC-NEXT: br label [[COND_END:%.*]]
; CGSCC: cond.false:
-; CGSCC-NEXT: [[CALL14:%.*]] = call double* @ptr_scc_r2(double* noalias nocapture nofree readnone [[A]], double* noalias nocapture nofree readnone [[B]], double* noalias nofree readnone [[R]]) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL14:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]]) #[[ATTR7]]
; CGSCC-NEXT: br label [[COND_END]]
; CGSCC: cond.end:
-; CGSCC-NEXT: [[COND:%.*]] = phi double* [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ]
+; CGSCC-NEXT: [[COND:%.*]] = phi ptr [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ]
; CGSCC-NEXT: br label [[RETURN]]
; CGSCC: return:
-; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi double* [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[R]], [[COND_END]] ]
-; CGSCC-NEXT: ret double* [[R]]
+; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[R]], [[IF_THEN]] ], [ [[R]], [[IF_THEN3]] ], [ [[R]], [[COND_END]] ]
+; CGSCC-NEXT: ret ptr [[R]]
;
entry:
- %cmp = icmp ugt double* %a, %b
+ %cmp = icmp ugt ptr %a, %b
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- %call = call double* @ptr_sink_r0(double* %r)
- %call1 = call double* @ptr_scc_r2(double* %b, double* %a, double* %call)
+ %call = call ptr @ptr_sink_r0(ptr %r)
+ %call1 = call ptr @ptr_scc_r2(ptr %b, ptr %a, ptr %call)
br label %return
if.end: ; preds = %entry
- %cmp2 = icmp ult double* %a, %b
+ %cmp2 = icmp ult ptr %a, %b
br i1 %cmp2, label %if.then3, label %if.end12
if.then3: ; preds = %if.end
- %call4 = call double* @ptr_sink_r0(double* %b)
- %call5 = call double* @ptr_scc_r1(double* %a, double* %b, double* %r)
- %call6 = call double* @ptr_scc_r2(double* %r, double* %r, double* %r)
- %call7 = call double* @ptr_scc_r1(double* %a, double* %call6, double* %r)
- %call8 = call double* @ptr_scc_r2(double* %a, double* %b, double* %r)
- %call9 = call double* @ptr_scc_r2(double* %call5, double* %call7, double* %call8)
- %call10 = call double* @ptr_scc_r1(double* %a, double* %b, double* %r)
- %call11 = call double* @ptr_scc_r1(double* %call4, double* %call9, double* %call10)
+ %call4 = call ptr @ptr_sink_r0(ptr %b)
+ %call5 = call ptr @ptr_scc_r1(ptr %a, ptr %b, ptr %r)
+ %call6 = call ptr @ptr_scc_r2(ptr %r, ptr %r, ptr %r)
+ %call7 = call ptr @ptr_scc_r1(ptr %a, ptr %call6, ptr %r)
+ %call8 = call ptr @ptr_scc_r2(ptr %a, ptr %b, ptr %r)
+ %call9 = call ptr @ptr_scc_r2(ptr %call5, ptr %call7, ptr %call8)
+ %call10 = call ptr @ptr_scc_r1(ptr %a, ptr %b, ptr %r)
+ %call11 = call ptr @ptr_scc_r1(ptr %call4, ptr %call9, ptr %call10)
br label %return
if.end12: ; preds = %if.end
- %cmp13 = icmp eq double* %a, %b
+ %cmp13 = icmp eq ptr %a, %b
br i1 %cmp13, label %cond.true, label %cond.false
cond.true: ; preds = %if.end12
br label %cond.end
cond.false: ; preds = %if.end12
- %call14 = call double* @ptr_scc_r2(double* %a, double* %b, double* %r)
+ %call14 = call ptr @ptr_scc_r2(ptr %a, ptr %b, ptr %r)
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
- %cond = phi double* [ %r, %cond.true ], [ %call14, %cond.false ]
+ %cond = phi ptr [ %r, %cond.true ], [ %call14, %cond.false ]
br label %return
return: ; preds = %cond.end, %if.then3, %if.then
- %retval.0 = phi double* [ %call1, %if.then ], [ %call11, %if.then3 ], [ %cond, %cond.end ]
- ret double* %retval.0
+ %retval.0 = phi ptr [ %call1, %if.then ], [ %call11, %if.then3 ], [ %cond, %cond.end ]
+ ret ptr %retval.0
}
@@ -478,27 +478,27 @@ return: ; preds = %cond.end, %if.then3
; return *a ? a : rt0(a);
; }
;
-define i32* @rt0(i32* %a) #0 {
+define ptr @rt0(ptr %a) #0 {
; TUNIT: Function Attrs: nofree noinline nosync nounwind memory(argmem: read) uwtable
; TUNIT-LABEL: define {{[^@]+}}@rt0
-; TUNIT-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] {
+; TUNIT-SAME: (ptr nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR10]]
-; TUNIT-NEXT: ret i32* [[A]]
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt0(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR10]]
+; TUNIT-NEXT: ret ptr [[A]]
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(argmem: read) uwtable
; CGSCC-LABEL: define {{[^@]+}}@rt0
-; CGSCC-SAME: (i32* nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] {
+; CGSCC-SAME: (ptr nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt0(i32* nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR7]]
-; CGSCC-NEXT: ret i32* [[A]]
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt0(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR7]]
+; CGSCC-NEXT: ret ptr [[A]]
;
entry:
- %v = load i32, i32* %a, align 4
+ %v = load i32, ptr %a, align 4
%tobool = icmp ne i32 %v, 0
- %call = call i32* @rt0(i32* %a)
- %sel = select i1 %tobool, i32* %a, i32* %call
- ret i32* %sel
+ %call = call ptr @rt0(ptr %a)
+ %sel = select i1 %tobool, ptr %a, ptr %call
+ ret ptr %sel
}
; TEST a no-return singleton SCC
@@ -507,149 +507,149 @@ entry:
; return *a ? undef : rt1(a);
; }
;
-define i32* @rt1(i32* %a) #0 {
+define ptr @rt1(ptr %a) #0 {
; TUNIT: Function Attrs: nofree noinline nosync nounwind willreturn memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@rt1
-; TUNIT-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR4:[0-9]+]] {
+; TUNIT-SAME: (ptr nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR4:[0-9]+]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: ret i32* undef
+; TUNIT-NEXT: ret ptr undef
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind willreturn memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@rt1
-; CGSCC-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] {
+; CGSCC-SAME: (ptr nocapture nofree nonnull readnone align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: ret i32* undef
+; CGSCC-NEXT: ret ptr undef
;
entry:
- %v = load i32, i32* %a, align 4
+ %v = load i32, ptr %a, align 4
%tobool = icmp ne i32 %v, 0
- %call = call i32* @rt1(i32* %a)
- %sel = select i1 %tobool, i32* undef, i32* %call
- ret i32* %sel
+ %call = call ptr @rt1(ptr %a)
+ %sel = select i1 %tobool, ptr undef, ptr %call
+ ret ptr %sel
}
; TEST another SCC test
;
-define i32* @rt2_helper(i32* %a) #0 {
+define ptr @rt2_helper(ptr %a) #0 {
; TUNIT: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@rt2_helper
-; TUNIT-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nofree readnone returned [[A:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR10]]
-; TUNIT-NEXT: ret i32* [[A]]
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt2(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR10]]
+; TUNIT-NEXT: ret ptr [[A]]
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@rt2_helper
-; CGSCC-SAME: (i32* nofree readnone returned [[A:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nofree readnone returned [[A:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt2(i32* noalias nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR7]]
-; CGSCC-NEXT: ret i32* [[A]]
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt2(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR7]]
+; CGSCC-NEXT: ret ptr [[A]]
;
entry:
- %call = call i32* @rt2(i32* %a, i32* %a)
- ret i32* %call
+ %call = call ptr @rt2(ptr %a, ptr %a)
+ ret ptr %call
}
-define i32* @rt2(i32* %a, i32 *%b) #0 {
+define ptr @rt2(ptr %a, ptr %b) #0 {
; TUNIT: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@rt2
-; TUNIT-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null
+; TUNIT-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], null
; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; TUNIT: if.then:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt2_helper(ptr noalias nofree readnone [[A]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[IF_END]]
; TUNIT: if.end:
-; TUNIT-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ]
-; TUNIT-NEXT: ret i32* [[SEL]]
+; TUNIT-NEXT: [[SEL:%.*]] = phi ptr [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ]
+; TUNIT-NEXT: ret ptr [[SEL]]
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@rt2
-; CGSCC-SAME: (i32* nofree readnone [[A:%.*]], i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null
+; CGSCC-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], null
; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CGSCC: if.then:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt2_helper(i32* noalias nofree readnone [[A]]) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt2_helper(ptr noalias nofree readnone [[A]]) #[[ATTR7]]
; CGSCC-NEXT: br label [[IF_END]]
; CGSCC: if.end:
-; CGSCC-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ]
-; CGSCC-NEXT: ret i32* [[SEL]]
+; CGSCC-NEXT: [[SEL:%.*]] = phi ptr [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ]
+; CGSCC-NEXT: ret ptr [[SEL]]
;
entry:
- %cmp = icmp eq i32* %a, null
+ %cmp = icmp eq ptr %a, null
br i1 %cmp, label %if.then, label %if.end
if.then:
- %call = call i32* @rt2_helper(i32* %a)
+ %call = call ptr @rt2_helper(ptr %a)
br label %if.end
if.end:
- %sel = phi i32* [ %b, %entry], [%call, %if.then]
- ret i32* %sel
+ %sel = phi ptr [ %b, %entry], [%call, %if.then]
+ ret ptr %sel
}
; TEST another SCC test
;
-define i32* @rt3_helper(i32* %a, i32* %b) #0 {
+define ptr @rt3_helper(ptr %a, ptr %b) #0 {
; TUNIT: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@rt3_helper
-; TUNIT-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]]
-; TUNIT-NEXT: ret i32* [[B]]
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt3(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]]
+; TUNIT-NEXT: ret ptr [[B]]
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@rt3_helper
-; CGSCC-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt3(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]]
-; CGSCC-NEXT: ret i32* [[B]]
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt3(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]]
+; CGSCC-NEXT: ret ptr [[B]]
;
entry:
- %call = call i32* @rt3(i32* %a, i32* %b)
- ret i32* %call
+ %call = call ptr @rt3(ptr %a, ptr %b)
+ ret ptr %call
}
-define i32* @rt3(i32* %a, i32 *%b) #0 {
+define ptr @rt3(ptr %a, ptr %b) #0 {
; TUNIT: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@rt3
-; TUNIT-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null
+; TUNIT-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], null
; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; TUNIT: if.then:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]]
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt3_helper(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]]
; TUNIT-NEXT: br label [[IF_END]]
; TUNIT: if.end:
-; TUNIT-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ]
-; TUNIT-NEXT: ret i32* [[B]]
+; TUNIT-NEXT: [[SEL:%.*]] = phi ptr [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ]
+; TUNIT-NEXT: ret ptr [[B]]
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@rt3
-; CGSCC-SAME: (i32* nocapture nofree readnone [[A:%.*]], i32* nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[A]], null
+; CGSCC-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], null
; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CGSCC: if.then:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @rt3_helper(i32* noalias nocapture nofree readnone [[A]], i32* noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]]
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt3_helper(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]]
; CGSCC-NEXT: br label [[IF_END]]
; CGSCC: if.end:
-; CGSCC-NEXT: [[SEL:%.*]] = phi i32* [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ]
-; CGSCC-NEXT: ret i32* [[B]]
+; CGSCC-NEXT: [[SEL:%.*]] = phi ptr [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ]
+; CGSCC-NEXT: ret ptr [[B]]
;
entry:
- %cmp = icmp eq i32* %a, null
+ %cmp = icmp eq ptr %a, null
br i1 %cmp, label %if.then, label %if.end
if.then:
- %call = call i32* @rt3_helper(i32* %a, i32* %b)
+ %call = call ptr @rt3_helper(ptr %a, ptr %b)
br label %if.end
if.end:
- %sel = phi i32* [ %b, %entry], [%call, %if.then]
- ret i32* %sel
+ %sel = phi ptr [ %b, %entry], [%call, %if.then]
+ ret ptr %sel
}
; TEST address taken function with call to an external functions
@@ -661,23 +661,23 @@ if.end:
; return r;
; }
;
-declare void @unknown_fn(i32* (i32*)*) #0
+declare void @unknown_fn(ptr) #0
-define i32* @calls_unknown_fn(i32* %r) #0 {
+define ptr @calls_unknown_fn(ptr %r) #0 {
; TUNIT: Function Attrs: noinline nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@calls_unknown_fn
-; TUNIT-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR5:[0-9]+]] {
-; TUNIT-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR11:[0-9]+]]
-; TUNIT-NEXT: ret i32* [[R]]
+; TUNIT-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR5:[0-9]+]] {
+; TUNIT-NEXT: tail call void @unknown_fn(ptr noundef nonnull @calls_unknown_fn) #[[ATTR11:[0-9]+]]
+; TUNIT-NEXT: ret ptr [[R]]
;
; CGSCC: Function Attrs: noinline nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@calls_unknown_fn
-; CGSCC-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] {
-; CGSCC-NEXT: tail call void @unknown_fn(i32* (i32*)* noundef nonnull @calls_unknown_fn) #[[ATTR8]]
-; CGSCC-NEXT: ret i32* [[R]]
+; CGSCC-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] {
+; CGSCC-NEXT: tail call void @unknown_fn(ptr noundef nonnull @calls_unknown_fn) #[[ATTR8]]
+; CGSCC-NEXT: ret ptr [[R]]
;
- tail call void @unknown_fn(i32* (i32*)* nonnull @calls_unknown_fn)
- ret i32* %r
+ tail call void @unknown_fn(ptr nonnull @calls_unknown_fn)
+ ret ptr %r
}
@@ -694,41 +694,41 @@ define i32* @calls_unknown_fn(i32* %r) #0 {
;
; Verify the maybe-redefined function is not annotated:
;
-define linkonce_odr i32* @maybe_redefined_fn(i32* %r) #0 {
+define linkonce_odr ptr @maybe_redefined_fn(ptr %r) #0 {
; TUNIT: Function Attrs: noinline nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@maybe_redefined_fn
-; TUNIT-SAME: (i32* [[R:%.*]]) #[[ATTR5]] {
+; TUNIT-SAME: (ptr [[R:%.*]]) #[[ATTR5]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: ret i32* [[R]]
+; TUNIT-NEXT: ret ptr [[R]]
;
; CGSCC: Function Attrs: noinline nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@maybe_redefined_fn
-; CGSCC-SAME: (i32* [[R:%.*]]) #[[ATTR4]] {
+; CGSCC-SAME: (ptr [[R:%.*]]) #[[ATTR4]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: ret i32* [[R]]
+; CGSCC-NEXT: ret ptr [[R]]
;
entry:
- ret i32* %r
+ ret ptr %r
}
-define i32* @calls_maybe_redefined_fn(i32* %r) #0 {
+define ptr @calls_maybe_redefined_fn(ptr %r) #0 {
; TUNIT: Function Attrs: noinline norecurse nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn
-; TUNIT-SAME: (i32* returned [[R:%.*]]) #[[ATTR6:[0-9]+]] {
+; TUNIT-SAME: (ptr returned [[R:%.*]]) #[[ATTR6:[0-9]+]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR11]]
-; TUNIT-NEXT: ret i32* [[R]]
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn(ptr [[R]]) #[[ATTR11]]
+; TUNIT-NEXT: ret ptr [[R]]
;
; CGSCC: Function Attrs: noinline nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn
-; CGSCC-SAME: (i32* returned [[R:%.*]]) #[[ATTR4]] {
+; CGSCC-SAME: (ptr returned [[R:%.*]]) #[[ATTR4]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn(i32* [[R]]) #[[ATTR8]]
-; CGSCC-NEXT: ret i32* [[R]]
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn(ptr [[R]]) #[[ATTR8]]
+; CGSCC-NEXT: ret ptr [[R]]
;
entry:
- %call = call i32* @maybe_redefined_fn(i32* %r)
- ret i32* %r
+ %call = call ptr @maybe_redefined_fn(ptr %r)
+ ret ptr %r
}
; TEST return call to a function that might be redifined at link time
@@ -743,41 +743,41 @@ entry:
;
; Verify the maybe-redefined function is not annotated:
;
-define linkonce_odr i32* @maybe_redefined_fn2(i32* %r) #0 {
+define linkonce_odr ptr @maybe_redefined_fn2(ptr %r) #0 {
; TUNIT: Function Attrs: noinline nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@maybe_redefined_fn2
-; TUNIT-SAME: (i32* [[R:%.*]]) #[[ATTR5]] {
+; TUNIT-SAME: (ptr [[R:%.*]]) #[[ATTR5]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: ret i32* [[R]]
+; TUNIT-NEXT: ret ptr [[R]]
;
; CGSCC: Function Attrs: noinline nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@maybe_redefined_fn2
-; CGSCC-SAME: (i32* [[R:%.*]]) #[[ATTR4]] {
+; CGSCC-SAME: (ptr [[R:%.*]]) #[[ATTR4]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: ret i32* [[R]]
+; CGSCC-NEXT: ret ptr [[R]]
;
entry:
- ret i32* %r
+ ret ptr %r
}
-define i32* @calls_maybe_redefined_fn2(i32* %r) #0 {
+define ptr @calls_maybe_redefined_fn2(ptr %r) #0 {
; TUNIT: Function Attrs: noinline norecurse nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2
-; TUNIT-SAME: (i32* [[R:%.*]]) #[[ATTR6]] {
+; TUNIT-SAME: (ptr [[R:%.*]]) #[[ATTR6]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR11]]
-; TUNIT-NEXT: ret i32* [[CALL]]
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn2(ptr [[R]]) #[[ATTR11]]
+; TUNIT-NEXT: ret ptr [[CALL]]
;
; CGSCC: Function Attrs: noinline nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2
-; CGSCC-SAME: (i32* [[R:%.*]]) #[[ATTR4]] {
+; CGSCC-SAME: (ptr [[R:%.*]]) #[[ATTR4]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @maybe_redefined_fn2(i32* [[R]]) #[[ATTR8]]
-; CGSCC-NEXT: ret i32* [[CALL]]
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn2(ptr [[R]]) #[[ATTR8]]
+; CGSCC-NEXT: ret ptr [[CALL]]
;
entry:
- %call = call i32* @maybe_redefined_fn2(i32* %r)
- ret i32* %call
+ %call = call ptr @maybe_redefined_fn2(ptr %r)
+ ret ptr %call
}
@@ -879,17 +879,15 @@ if.end: ; preds = %if.then, %entry
; return (double*)b;
; }
;
-define double* @bitcast(i32* %b) #0 {
+define ptr @bitcast(ptr %b) #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; CHECK-LABEL: define {{[^@]+}}@bitcast
-; CHECK-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double*
-; CHECK-NEXT: ret double* [[BC0]]
+; CHECK-NEXT: ret ptr [[B]]
;
entry:
- %bc0 = bitcast i32* %b to double*
- ret double* %bc0
+ ret ptr %b
}
@@ -902,43 +900,31 @@ entry:
; return b != 0 ? b : x;
; }
;
-define double* @bitcasts_select_and_phi(i32* %b) #0 {
+define ptr @bitcasts_select_and_phi(ptr %b) #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; CHECK-LABEL: define {{[^@]+}}@bitcasts_select_and_phi
-; CHECK-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nofree readnone returned [[B:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double*
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[B]], null
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double*
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
-; CHECK-NEXT: [[PHI:%.*]] = phi double* [ [[BC1]], [[IF_THEN]] ], [ [[BC0]], [[ENTRY:%.*]] ]
-; CHECK-NEXT: [[BC2:%.*]] = bitcast double* [[PHI]] to i8*
-; CHECK-NEXT: [[BC3:%.*]] = bitcast i32* [[B]] to i8*
-; CHECK-NEXT: [[CMP2:%.*]] = icmp ne double* [[BC0]], null
-; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i8* [[BC2]], i8* [[BC3]]
-; CHECK-NEXT: [[BC4:%.*]] = bitcast i8* [[SEL]] to double*
-; CHECK-NEXT: ret double* [[BC4]]
+; CHECK-NEXT: [[PHI:%.*]] = phi ptr [ [[B]], [[IF_THEN]] ], [ [[B]], [[ENTRY:%.*]] ]
+; CHECK-NEXT: ret ptr [[B]]
;
entry:
- %bc0 = bitcast i32* %b to double*
- %cmp = icmp eq double* %bc0, null
+ %cmp = icmp eq ptr %b, null
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- %bc1 = bitcast i32* %b to double*
br label %if.end
if.end: ; preds = %if.then, %entry
- %phi = phi double* [ %bc1, %if.then ], [ %bc0, %entry ]
- %bc2 = bitcast double* %phi to i8*
- %bc3 = bitcast i32* %b to i8*
- %cmp2 = icmp ne double* %bc0, null
- %sel = select i1 %cmp2, i8* %bc2, i8* %bc3
- %bc4 = bitcast i8* %sel to double*
- ret double* %bc4
+ %phi = phi ptr [ %b, %if.then ], [ %b, %entry ]
+ %cmp2 = icmp ne ptr %b, null
+ %sel = select i1 %cmp2, ptr %phi, ptr %b
+ ret ptr %sel
}
@@ -952,41 +938,37 @@ if.end: ; preds = %if.then, %entry
; /* return undef */
; }
;
-define double* @ret_arg_arg_undef(i32* %b) #0 {
+define ptr @ret_arg_arg_undef(ptr %b) #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; CHECK-LABEL: define {{[^@]+}}@ret_arg_arg_undef
-; CHECK-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nofree readnone returned [[B:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double*
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[B]], null
; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[IF_END:%.*]]
; CHECK: ret_arg0:
-; CHECK-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double*
-; CHECK-NEXT: ret double* [[BC1]]
+; CHECK-NEXT: ret ptr [[B]]
; CHECK: if.end:
; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG1:%.*]], label [[RET_UNDEF:%.*]]
; CHECK: ret_arg1:
-; CHECK-NEXT: ret double* [[BC0]]
+; CHECK-NEXT: ret ptr [[B]]
; CHECK: ret_undef:
-; CHECK-NEXT: ret double* undef
+; CHECK-NEXT: ret ptr undef
;
entry:
- %bc0 = bitcast i32* %b to double*
- %cmp = icmp eq double* %bc0, null
+ %cmp = icmp eq ptr %b, null
br i1 %cmp, label %ret_arg0, label %if.end
ret_arg0:
- %bc1 = bitcast i32* %b to double*
- ret double* %bc1
+ ret ptr %b
if.end:
br i1 %cmp, label %ret_arg1, label %ret_undef
ret_arg1:
- ret double* %bc0
+ ret ptr %b
ret_undef:
- ret double *undef
+ ret ptr undef
}
@@ -1000,41 +982,37 @@ ret_undef:
; /* return undef */
; }
;
-define double* @ret_undef_arg_arg(i32* %b) #0 {
+define ptr @ret_undef_arg_arg(ptr %b) #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; CHECK-LABEL: define {{[^@]+}}@ret_undef_arg_arg
-; CHECK-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nofree readnone returned [[B:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double*
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[B]], null
; CHECK-NEXT: br i1 [[CMP]], label [[RET_UNDEF:%.*]], label [[IF_END:%.*]]
; CHECK: ret_undef:
-; CHECK-NEXT: ret double* undef
+; CHECK-NEXT: ret ptr undef
; CHECK: if.end:
; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG0:%.*]], label [[RET_ARG1:%.*]]
; CHECK: ret_arg0:
-; CHECK-NEXT: ret double* [[BC0]]
+; CHECK-NEXT: ret ptr [[B]]
; CHECK: ret_arg1:
-; CHECK-NEXT: [[BC1:%.*]] = bitcast i32* [[B]] to double*
-; CHECK-NEXT: ret double* [[BC1]]
+; CHECK-NEXT: ret ptr [[B]]
;
entry:
- %bc0 = bitcast i32* %b to double*
- %cmp = icmp eq double* %bc0, null
+ %cmp = icmp eq ptr %b, null
br i1 %cmp, label %ret_undef, label %if.end
ret_undef:
- ret double *undef
+ ret ptr undef
if.end:
br i1 %cmp, label %ret_arg0, label %ret_arg1
ret_arg0:
- ret double* %bc0
+ ret ptr %b
ret_arg1:
- %bc1 = bitcast i32* %b to double*
- ret double* %bc1
+ ret ptr %b
}
@@ -1048,39 +1026,37 @@ ret_arg1:
; /* return undef */
; }
;
-define double* @ret_undef_arg_undef(i32* %b) #0 {
+define ptr @ret_undef_arg_undef(ptr %b) #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; CHECK-LABEL: define {{[^@]+}}@ret_undef_arg_undef
-; CHECK-SAME: (i32* nofree readnone [[B:%.*]]) #[[ATTR0]] {
+; CHECK-SAME: (ptr nofree readnone returned [[B:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[BC0:%.*]] = bitcast i32* [[B]] to double*
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq double* [[BC0]], null
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[B]], null
; CHECK-NEXT: br i1 [[CMP]], label [[RET_UNDEF0:%.*]], label [[IF_END:%.*]]
; CHECK: ret_undef0:
-; CHECK-NEXT: ret double* undef
+; CHECK-NEXT: ret ptr undef
; CHECK: if.end:
; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNDEF1:%.*]]
; CHECK: ret_arg:
-; CHECK-NEXT: ret double* [[BC0]]
+; CHECK-NEXT: ret ptr [[B]]
; CHECK: ret_undef1:
-; CHECK-NEXT: ret double* undef
+; CHECK-NEXT: ret ptr undef
;
entry:
- %bc0 = bitcast i32* %b to double*
- %cmp = icmp eq double* %bc0, null
+ %cmp = icmp eq ptr %b, null
br i1 %cmp, label %ret_undef0, label %if.end
ret_undef0:
- ret double *undef
+ ret ptr undef
if.end:
br i1 %cmp, label %ret_arg, label %ret_undef1
ret_arg:
- ret double* %bc0
+ ret ptr %b
ret_undef1:
- ret double *undef
+ ret ptr undef
}
; TEST return argument or unknown call result
@@ -1093,90 +1069,90 @@ ret_undef1:
;
; Verify we do not assume b is returned
;
-declare i32* @unknown(i32*)
+declare ptr @unknown(ptr)
-define i32* @ret_arg_or_unknown(i32* %b) #0 {
+define ptr @ret_arg_or_unknown(ptr %b) #0 {
; TUNIT: Function Attrs: noinline nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@ret_arg_or_unknown
-; TUNIT-SAME: (i32* [[B:%.*]]) #[[ATTR5]] {
+; TUNIT-SAME: (ptr [[B:%.*]]) #[[ATTR5]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null
+; TUNIT-NEXT: [[CMP:%.*]] = icmp eq ptr [[B]], null
; TUNIT-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]]
; TUNIT: ret_arg:
-; TUNIT-NEXT: ret i32* [[B]]
+; TUNIT-NEXT: ret ptr [[B]]
; TUNIT: ret_unknown:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]])
-; TUNIT-NEXT: ret i32* [[CALL]]
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr [[B]])
+; TUNIT-NEXT: ret ptr [[CALL]]
;
; CGSCC: Function Attrs: noinline nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@ret_arg_or_unknown
-; CGSCC-SAME: (i32* [[B:%.*]]) #[[ATTR4]] {
+; CGSCC-SAME: (ptr [[B:%.*]]) #[[ATTR4]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null
+; CGSCC-NEXT: [[CMP:%.*]] = icmp eq ptr [[B]], null
; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]]
; CGSCC: ret_arg:
-; CGSCC-NEXT: ret i32* [[B]]
+; CGSCC-NEXT: ret ptr [[B]]
; CGSCC: ret_unknown:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]])
-; CGSCC-NEXT: ret i32* [[CALL]]
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr [[B]])
+; CGSCC-NEXT: ret ptr [[CALL]]
;
entry:
- %cmp = icmp eq i32* %b, null
+ %cmp = icmp eq ptr %b, null
br i1 %cmp, label %ret_arg, label %ret_unknown
ret_arg:
- ret i32* %b
+ ret ptr %b
ret_unknown:
- %call = call i32* @unknown(i32* %b)
- ret i32* %call
+ %call = call ptr @unknown(ptr %b)
+ ret ptr %call
}
-define i32* @ret_arg_or_unknown_through_phi(i32* %b) #0 {
+define ptr @ret_arg_or_unknown_through_phi(ptr %b) #0 {
; TUNIT: Function Attrs: noinline nounwind uwtable
; TUNIT-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi
-; TUNIT-SAME: (i32* [[B:%.*]]) #[[ATTR5]] {
+; TUNIT-SAME: (ptr [[B:%.*]]) #[[ATTR5]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null
+; TUNIT-NEXT: [[CMP:%.*]] = icmp eq ptr [[B]], null
; TUNIT-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]]
; TUNIT: ret_arg:
; TUNIT-NEXT: br label [[R:%.*]]
; TUNIT: ret_unknown:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]])
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr [[B]])
; TUNIT-NEXT: br label [[R]]
; TUNIT: r:
-; TUNIT-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ]
-; TUNIT-NEXT: ret i32* [[PHI]]
+; TUNIT-NEXT: [[PHI:%.*]] = phi ptr [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ]
+; TUNIT-NEXT: ret ptr [[PHI]]
;
; CGSCC: Function Attrs: noinline nounwind uwtable
; CGSCC-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi
-; CGSCC-SAME: (i32* [[B:%.*]]) #[[ATTR4]] {
+; CGSCC-SAME: (ptr [[B:%.*]]) #[[ATTR4]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null
+; CGSCC-NEXT: [[CMP:%.*]] = icmp eq ptr [[B]], null
; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]]
; CGSCC: ret_arg:
; CGSCC-NEXT: br label [[R:%.*]]
; CGSCC: ret_unknown:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @unknown(i32* [[B]])
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr [[B]])
; CGSCC-NEXT: br label [[R]]
; CGSCC: r:
-; CGSCC-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ]
-; CGSCC-NEXT: ret i32* [[PHI]]
+; CGSCC-NEXT: [[PHI:%.*]] = phi ptr [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ]
+; CGSCC-NEXT: ret ptr [[PHI]]
;
entry:
- %cmp = icmp eq i32* %b, null
+ %cmp = icmp eq ptr %b, null
br i1 %cmp, label %ret_arg, label %ret_unknown
ret_arg:
br label %r
ret_unknown:
- %call = call i32* @unknown(i32* %b)
+ %call = call ptr @unknown(ptr %b)
br label %r
r:
- %phi = phi i32* [ %b, %ret_arg ], [ %call, %ret_unknown ]
- ret i32* %phi
+ %phi = phi ptr [ %b, %ret_arg ], [ %call, %ret_unknown ]
+ ret ptr %phi
}
; TEST inconsistent IR in dead code.
@@ -1347,35 +1323,35 @@ define weak_odr i32 @non_exact_2(i32 returned %a) {
;
ret i32 %a
}
-define weak_odr align 16 i32* @non_exact_3(i32* align 32 returned %a) {
+define weak_odr align 16 ptr @non_exact_3(ptr align 32 returned %a) {
; CHECK-LABEL: define {{[^@]+}}@non_exact_3
-; CHECK-SAME: (i32* returned align 32 [[A:%.*]]) {
-; CHECK-NEXT: ret i32* [[A]]
+; CHECK-SAME: (ptr returned align 32 [[A:%.*]]) {
+; CHECK-NEXT: ret ptr [[A]]
;
- ret i32* %a
+ ret ptr %a
}
-define weak_odr align 16 i32* @non_exact_4(i32* align 32 %a) {
+define weak_odr align 16 ptr @non_exact_4(ptr align 32 %a) {
; CHECK-LABEL: define {{[^@]+}}@non_exact_4
-; CHECK-SAME: (i32* align 32 [[A:%.*]]) {
-; CHECK-NEXT: ret i32* [[A]]
+; CHECK-SAME: (ptr align 32 [[A:%.*]]) {
+; CHECK-NEXT: ret ptr [[A]]
;
- ret i32* %a
+ ret ptr %a
}
; We can use the alignment information of the weak function non_exact_3 argument
; because it was given to us and not derived.
; We can use the return information of the weak function non_exact_4.
; FIXME: %c2 and %c3 should be replaced but not %c0 or %c1!
-define i32 @exact(i32* align 8 %a, i32* align 8 %b) {
+define i32 @exact(ptr align 8 %a, ptr align 8 %b) {
; TUNIT: Function Attrs: norecurse
; TUNIT-LABEL: define {{[^@]+}}@exact
-; TUNIT-SAME: (i32* align 8 [[A:%.*]], i32* align 8 [[B:%.*]]) #[[ATTR8:[0-9]+]] {
+; TUNIT-SAME: (ptr align 8 [[A:%.*]], ptr align 8 [[B:%.*]]) #[[ATTR8:[0-9]+]] {
; TUNIT-NEXT: [[C0:%.*]] = call i32 @non_exact_0()
; TUNIT-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1)
; TUNIT-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2)
-; TUNIT-NEXT: [[C3:%.*]] = call align 32 i32* @non_exact_3(i32* align 32 [[A]])
-; TUNIT-NEXT: [[C4:%.*]] = call align 16 i32* @non_exact_4(i32* align 32 [[B]])
-; TUNIT-NEXT: [[C3L:%.*]] = load i32, i32* [[A]], align 32
-; TUNIT-NEXT: [[C4L:%.*]] = load i32, i32* [[C4]], align 16
+; TUNIT-NEXT: [[C3:%.*]] = call align 32 ptr @non_exact_3(ptr align 32 [[A]])
+; TUNIT-NEXT: [[C4:%.*]] = call align 16 ptr @non_exact_4(ptr align 32 [[B]])
+; TUNIT-NEXT: [[C3L:%.*]] = load i32, ptr [[A]], align 32
+; TUNIT-NEXT: [[C4L:%.*]] = load i32, ptr [[C4]], align 16
; TUNIT-NEXT: [[ADD1:%.*]] = add i32 [[C0]], [[C1]]
; TUNIT-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], 2
; TUNIT-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[C3L]]
@@ -1383,14 +1359,14 @@ define i32 @exact(i32* align 8 %a, i32* align 8 %b) {
; TUNIT-NEXT: ret i32 [[ADD4]]
;
; CGSCC-LABEL: define {{[^@]+}}@exact
-; CGSCC-SAME: (i32* align 8 [[A:%.*]], i32* align 8 [[B:%.*]]) {
+; CGSCC-SAME: (ptr align 8 [[A:%.*]], ptr align 8 [[B:%.*]]) {
; CGSCC-NEXT: [[C0:%.*]] = call i32 @non_exact_0()
; CGSCC-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1)
; CGSCC-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2)
-; CGSCC-NEXT: [[C3:%.*]] = call align 32 i32* @non_exact_3(i32* align 32 [[A]])
-; CGSCC-NEXT: [[C4:%.*]] = call align 16 i32* @non_exact_4(i32* align 32 [[B]])
-; CGSCC-NEXT: [[C3L:%.*]] = load i32, i32* [[C3]], align 32
-; CGSCC-NEXT: [[C4L:%.*]] = load i32, i32* [[C4]], align 16
+; CGSCC-NEXT: [[C3:%.*]] = call align 32 ptr @non_exact_3(ptr align 32 [[A]])
+; CGSCC-NEXT: [[C4:%.*]] = call align 16 ptr @non_exact_4(ptr align 32 [[B]])
+; CGSCC-NEXT: [[C3L:%.*]] = load i32, ptr [[C3]], align 32
+; CGSCC-NEXT: [[C4L:%.*]] = load i32, ptr [[C4]], align 16
; CGSCC-NEXT: [[ADD1:%.*]] = add i32 [[C0]], [[C1]]
; CGSCC-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[C2]]
; CGSCC-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[C3L]]
@@ -1400,10 +1376,10 @@ define i32 @exact(i32* align 8 %a, i32* align 8 %b) {
%c0 = call i32 @non_exact_0()
%c1 = call i32 @non_exact_1(i32 1)
%c2 = call i32 @non_exact_2(i32 2)
- %c3 = call i32* @non_exact_3(i32* %a)
- %c4 = call i32* @non_exact_4(i32* %b)
- %c3l = load i32, i32* %c3
- %c4l = load i32, i32* %c4
+ %c3 = call ptr @non_exact_3(ptr %a)
+ %c4 = call ptr @non_exact_4(ptr %b)
+ %c3l = load i32, ptr %c3
+ %c4l = load i32, ptr %c4
%add1 = add i32 %c0, %c1
%add2 = add i32 %add1, %c2
%add3 = add i32 %add2, %c3l
@@ -1412,44 +1388,43 @@ define i32 @exact(i32* align 8 %a, i32* align 8 %b) {
}
@G = external global i8
-define i32* @ret_const() #0 {
+define ptr @ret_const() #0 {
; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; CHECK-LABEL: define {{[^@]+}}@ret_const
; CHECK-SAME: () #[[ATTR0]] {
-; CHECK-NEXT: ret i32* bitcast (i8* @G to i32*)
+; CHECK-NEXT: ret ptr @G
;
- %bc = bitcast i8* @G to i32*
- ret i32* %bc
+ ret ptr @G
}
-define i32* @use_const() #0 {
+define ptr @use_const() #0 {
; TUNIT: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@use_const
; TUNIT-SAME: () #[[ATTR0]] {
-; TUNIT-NEXT: ret i32* bitcast (i8* @G to i32*)
+; TUNIT-NEXT: ret ptr @G
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind willreturn memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@use_const
; CGSCC-SAME: () #[[ATTR3]] {
-; CGSCC-NEXT: [[C:%.*]] = call noundef nonnull dereferenceable(1) i32* @ret_const() #[[ATTR9:[0-9]+]]
-; CGSCC-NEXT: ret i32* [[C]]
+; CGSCC-NEXT: [[C:%.*]] = call noundef nonnull dereferenceable(1) ptr @ret_const() #[[ATTR9:[0-9]+]]
+; CGSCC-NEXT: ret ptr [[C]]
;
- %c = call i32* @ret_const()
- ret i32* %c
+ %c = call ptr @ret_const()
+ ret ptr %c
}
-define i32* @dont_use_const() #0 {
+define ptr @dont_use_const() #0 {
; TUNIT: Function Attrs: nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable
; TUNIT-LABEL: define {{[^@]+}}@dont_use_const
; TUNIT-SAME: () #[[ATTR0]] {
-; TUNIT-NEXT: ret i32* bitcast (i8* @G to i32*)
+; TUNIT-NEXT: ret ptr @G
;
; CGSCC: Function Attrs: nofree noinline nosync nounwind willreturn memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@dont_use_const
; CGSCC-SAME: () #[[ATTR3]] {
-; CGSCC-NEXT: [[C:%.*]] = musttail call noundef nonnull dereferenceable(1) i32* @ret_const() #[[ATTR9]]
-; CGSCC-NEXT: ret i32* [[C]]
+; CGSCC-NEXT: [[C:%.*]] = musttail call noundef nonnull dereferenceable(1) ptr @ret_const() #[[ATTR9]]
+; CGSCC-NEXT: ret ptr [[C]]
;
- %c = musttail call i32* @ret_const()
- ret i32* %c
+ %c = musttail call ptr @ret_const()
+ ret ptr %c
}
; UTC_ARGS: --disable
@@ -1460,38 +1435,35 @@ define i32* @dont_use_const() #0 {
; CHECK-NOT: align 536870912
%struct.Y = type { %struct.X }
-%struct.X = type { i32 (...)** }
+%struct.X = type { ptr }
- at _ZTI1X = external dso_local constant { i8*, i8* }, align 8
- at _ZTI1Y = external dso_local constant { i8*, i8*, i8* }, align 8
+ at _ZTI1X = external dso_local constant { ptr, ptr }, align 8
+ at _ZTI1Y = external dso_local constant { ptr, ptr, ptr }, align 8
-define internal i8* @_ZN1Y3barEv(%struct.Y* %this) align 2 {
+define internal ptr @_ZN1Y3barEv(ptr %this) align 2 {
entry:
- %0 = bitcast %struct.Y* %this to i8*
- ret i8* %0
+ ret ptr %this
}
-define dso_local i8* @_Z3fooP1X(%struct.X* %x) {
+define dso_local ptr @_Z3fooP1X(ptr %x) {
entry:
- %0 = icmp eq %struct.X* %x, null
+ %0 = icmp eq ptr %x, null
br i1 %0, label %dynamic_cast.null, label %dynamic_cast.notnull
dynamic_cast.notnull: ; preds = %entry
- %1 = bitcast %struct.X* %x to i8*
- %2 = call i8* @__dynamic_cast(i8* %1, i8* bitcast ({ i8*, i8* }* @_ZTI1X to i8*), i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1Y to i8*), i64 0) #2
- %3 = bitcast i8* %2 to %struct.Y*
+ %1 = call ptr @__dynamic_cast(ptr %x, ptr @_ZTI1X, ptr @_ZTI1Y, i64 0) #2
br label %dynamic_cast.end
dynamic_cast.null: ; preds = %entry
br label %dynamic_cast.end
dynamic_cast.end: ; preds = %dynamic_cast.null, %dynamic_cast.notnull
- %QQ5 = phi %struct.Y* [ %3, %dynamic_cast.notnull ], [ null, %dynamic_cast.null ]
- %call = call i8* @_ZN1Y3barEv(%struct.Y* %QQ5)
- ret i8* %call
+ %QQ5 = phi ptr [ %1, %dynamic_cast.notnull ], [ null, %dynamic_cast.null ]
+ %call = call ptr @_ZN1Y3barEv(ptr %QQ5)
+ ret ptr %call
}
-declare dso_local i8* @__dynamic_cast(i8*, i8*, i8*, i64)
+declare dso_local ptr @__dynamic_cast(ptr, ptr, ptr, i64)
; UTC_ARGS: --enable
diff --git a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
index 7570b4cf6dc3e..afa4909ad221f 100644
--- a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+++ b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
@@ -57,30 +57,30 @@
; CHECK: @[[GLOBAL:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_STY:%.*]] zeroinitializer, align 8
; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 0, align 4
;.
-define void @write_arg(i32* %p, i32 %v) {
+define void @write_arg(ptr %p, i32 %v) {
; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: write)
; CHECK-LABEL: define {{[^@]+}}@write_arg
-; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
-; CHECK-NEXT: store i32 [[V]], i32* [[P]], align 4, !tbaa [[TBAA3:![0-9]+]]
+; CHECK-NEXT: store i32 [[V]], ptr [[P]], align 4, !tbaa [[TBAA3:![0-9]+]]
; CHECK-NEXT: ret void
;
entry:
- store i32 %v, i32* %p, align 4, !tbaa !3
+ store i32 %v, ptr %p, align 4, !tbaa !3
ret void
}
-define void @write_random(i32* %p) {
+define void @write_random(ptr %p) {
; CHECK-LABEL: define {{[^@]+}}@write_random
-; CHECK-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) {
+; CHECK-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = call i32 (...) @random()
-; CHECK-NEXT: store i32 [[CALL]], i32* [[P]], align 4, !tbaa [[TBAA3]]
+; CHECK-NEXT: store i32 [[CALL]], ptr [[P]], align 4, !tbaa [[TBAA3]]
; CHECK-NEXT: ret void
;
entry:
%call = call i32 (...) @random()
- store i32 %call, i32* %p, align 4, !tbaa !3
+ store i32 %call, ptr %p, align 4, !tbaa !3
ret void
}
@@ -103,150 +103,134 @@ declare i32 @random(...)
; r.i3 = s.i3 + s.i1;
; return r;
; }
-define void @local_alloca_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) {
+define void @local_alloca_simplifiable_1(ptr noalias sret(%struct.S) align 4 %agg.result) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
-; TUNIT-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
+; TUNIT-SAME: (ptr noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4
-; TUNIT-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR16:[0-9]+]]
-; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; TUNIT-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
-; TUNIT-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
-; TUNIT-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR17:[0-9]+]]
-; TUNIT-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR17]]
-; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR17]]
-; TUNIT-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
-; TUNIT-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
-; TUNIT-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
-; TUNIT-NEXT: store float 0x40119999A0000000, float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
-; TUNIT-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
-; TUNIT-NEXT: store float 0x40119999A0000000, float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
-; TUNIT-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
-; TUNIT-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]]
-; TUNIT-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
-; TUNIT-NEXT: store i32 4, i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
-; TUNIT-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
-; TUNIT-NEXT: store i32 4, i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
-; TUNIT-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR16:[0-9]+]]
+; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; TUNIT-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4
+; TUNIT-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5
+; TUNIT-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR17:[0-9]+]]
+; TUNIT-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR17]]
+; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR17]]
+; TUNIT-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3
+; TUNIT-NEXT: store float 0x3FF19999A0000000, ptr [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]]
+; TUNIT-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 4
+; TUNIT-NEXT: store float 0x40119999A0000000, ptr [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]]
+; TUNIT-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 5
+; TUNIT-NEXT: store float 0x40119999A0000000, ptr [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]]
+; TUNIT-NEXT: store i32 1, ptr [[AGG_RESULT]], align 4, !tbaa [[TBAA12:![0-9]+]]
+; TUNIT-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 1
+; TUNIT-NEXT: store i32 4, ptr [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]]
+; TUNIT-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 2
+; TUNIT-NEXT: store i32 4, ptr [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]]
+; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR16]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1
-; CGSCC-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
+; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4
-; CGSCC-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR19:[0-9]+]]
-; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; CGSCC-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7:![0-9]+]]
-; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
-; CGSCC-NEXT: store float 0x40019999A0000000, float* [[F2]], align 4, !tbaa [[TBAA10:![0-9]+]]
-; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
-; CGSCC-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11:![0-9]+]]
-; CGSCC-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR20:[0-9]+]]
-; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR20]]
-; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR20]]
-; CGSCC-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; CGSCC-NEXT: [[I4:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
-; CGSCC-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
-; CGSCC-NEXT: store float [[I4]], float* [[F12]], align 4, !tbaa [[TBAA7]]
-; CGSCC-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
-; CGSCC-NEXT: [[I5:%.*]] = load float, float* [[F23]], align 4, !tbaa [[TBAA10]]
+; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR19:[0-9]+]]
+; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; CGSCC-NEXT: store float 0x3FF19999A0000000, ptr [[F1]], align 4, !tbaa [[TBAA7:![0-9]+]]
+; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4
+; CGSCC-NEXT: store float 0x40019999A0000000, ptr [[F2]], align 4, !tbaa [[TBAA10:![0-9]+]]
+; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5
+; CGSCC-NEXT: store float 0x400A666660000000, ptr [[F3]], align 4, !tbaa [[TBAA11:![0-9]+]]
+; CGSCC-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR20:[0-9]+]]
+; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR20]]
+; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR20]]
+; CGSCC-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; CGSCC-NEXT: [[I4:%.*]] = load float, ptr [[F11]], align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3
+; CGSCC-NEXT: store float [[I4]], ptr [[F12]], align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4
+; CGSCC-NEXT: [[I5:%.*]] = load float, ptr [[F23]], align 4, !tbaa [[TBAA10]]
; CGSCC-NEXT: [[MUL:%.*]] = fmul float [[I5]], 2.000000e+00
-; CGSCC-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
-; CGSCC-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
-; CGSCC-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
-; CGSCC-NEXT: [[I6:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
-; CGSCC-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; CGSCC-NEXT: [[I7:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 4
+; CGSCC-NEXT: store float [[MUL]], ptr [[F24]], align 4, !tbaa [[TBAA10]]
+; CGSCC-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5
+; CGSCC-NEXT: [[I6:%.*]] = load float, ptr [[F35]], align 4, !tbaa [[TBAA11]]
+; CGSCC-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; CGSCC-NEXT: [[I7:%.*]] = load float, ptr [[F16]], align 4, !tbaa [[TBAA7]]
; CGSCC-NEXT: [[ADD:%.*]] = fadd float [[I6]], [[I7]]
-; CGSCC-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
-; CGSCC-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
-; CGSCC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; CGSCC-NEXT: [[I8:%.*]] = load i32, i32* [[I18]], align 4, !tbaa [[TBAA12:![0-9]+]]
-; CGSCC-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
-; CGSCC-NEXT: store i32 [[I8]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
-; CGSCC-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
-; CGSCC-NEXT: [[I9:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13:![0-9]+]]
+; CGSCC-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 5
+; CGSCC-NEXT: store float [[ADD]], ptr [[F37]], align 4, !tbaa [[TBAA11]]
+; CGSCC-NEXT: [[I8:%.*]] = load i32, ptr [[S]], align 4, !tbaa [[TBAA12:![0-9]+]]
+; CGSCC-NEXT: store i32 [[I8]], ptr [[AGG_RESULT]], align 4, !tbaa [[TBAA12]]
+; CGSCC-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1
+; CGSCC-NEXT: [[I9:%.*]] = load i32, ptr [[I210]], align 4, !tbaa [[TBAA13:![0-9]+]]
; CGSCC-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I9]], 1
-; CGSCC-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
-; CGSCC-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
-; CGSCC-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; CGSCC-NEXT: [[I10:%.*]] = load i32, i32* [[I313]], align 4, !tbaa [[TBAA14:![0-9]+]]
-; CGSCC-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; CGSCC-NEXT: [[I11:%.*]] = load i32, i32* [[I114]], align 4, !tbaa [[TBAA12]]
+; CGSCC-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 1
+; CGSCC-NEXT: store i32 [[MUL11]], ptr [[I212]], align 4, !tbaa [[TBAA13]]
+; CGSCC-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; CGSCC-NEXT: [[I10:%.*]] = load i32, ptr [[I313]], align 4, !tbaa [[TBAA14:![0-9]+]]
+; CGSCC-NEXT: [[I11:%.*]] = load i32, ptr [[S]], align 4, !tbaa [[TBAA12]]
; CGSCC-NEXT: [[ADD15:%.*]] = add nsw i32 [[I10]], [[I11]]
-; CGSCC-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
-; CGSCC-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
-; CGSCC-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR19]]
+; CGSCC-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 2
+; CGSCC-NEXT: store i32 [[ADD15]], ptr [[I316]], align 4, !tbaa [[TBAA14]]
+; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR19]]
; CGSCC-NEXT: ret void
;
entry:
%s = alloca %struct.S, align 4
- %i = bitcast %struct.S* %s to i8*
- call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %i)
- %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
- store float 0x3FF19999A0000000, float* %f1, align 4, !tbaa !7
- %f2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
- store float 0x40019999A0000000, float* %f2, align 4, !tbaa !10
- %f3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
- store float 0x400A666660000000, float* %f3, align 4, !tbaa !11
- %i1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
- call void @write_arg(i32* nonnull %i1, i32 1)
- %i2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
- call void @write_arg(i32* nonnull %i2, i32 2)
- %i3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
- call void @write_arg(i32* nonnull %i3, i32 3)
- %f11 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
- %i4 = load float, float* %f11, align 4, !tbaa !7
- %f12 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
- store float %i4, float* %f12, align 4, !tbaa !7
- %f23 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
- %i5 = load float, float* %f23, align 4, !tbaa !10
+ call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %s)
+ %f1 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 3
+ store float 0x3FF19999A0000000, ptr %f1, align 4, !tbaa !7
+ %f2 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 4
+ store float 0x40019999A0000000, ptr %f2, align 4, !tbaa !10
+ %f3 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 5
+ store float 0x400A666660000000, ptr %f3, align 4, !tbaa !11
+ call void @write_arg(ptr nonnull %s, i32 1)
+ %i2 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 1
+ call void @write_arg(ptr nonnull %i2, i32 2)
+ %i3 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 2
+ call void @write_arg(ptr nonnull %i3, i32 3)
+ %f11 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 3
+ %i4 = load float, ptr %f11, align 4, !tbaa !7
+ %f12 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 3
+ store float %i4, ptr %f12, align 4, !tbaa !7
+ %f23 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 4
+ %i5 = load float, ptr %f23, align 4, !tbaa !10
%mul = fmul float %i5, 2.000000e+00
- %f24 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
- store float %mul, float* %f24, align 4, !tbaa !10
- %f35 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
- %i6 = load float, float* %f35, align 4, !tbaa !11
- %f16 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
- %i7 = load float, float* %f16, align 4, !tbaa !7
+ %f24 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 4
+ store float %mul, ptr %f24, align 4, !tbaa !10
+ %f35 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 5
+ %i6 = load float, ptr %f35, align 4, !tbaa !11
+ %f16 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 3
+ %i7 = load float, ptr %f16, align 4, !tbaa !7
%add = fadd float %i6, %i7
- %f37 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
- store float %add, float* %f37, align 4, !tbaa !11
- %i18 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
- %i8 = load i32, i32* %i18, align 4, !tbaa !12
- %i19 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
- store i32 %i8, i32* %i19, align 4, !tbaa !12
- %i210 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
- %i9 = load i32, i32* %i210, align 4, !tbaa !13
+ %f37 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 5
+ store float %add, ptr %f37, align 4, !tbaa !11
+ %i8 = load i32, ptr %s, align 4, !tbaa !12
+ store i32 %i8, ptr %agg.result, align 4, !tbaa !12
+ %i210 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 1
+ %i9 = load i32, ptr %i210, align 4, !tbaa !13
%mul11 = shl nsw i32 %i9, 1
- %i212 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
- store i32 %mul11, i32* %i212, align 4, !tbaa !13
- %i313 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
- %i10 = load i32, i32* %i313, align 4, !tbaa !14
- %i114 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
- %i11 = load i32, i32* %i114, align 4, !tbaa !12
+ %i212 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 1
+ store i32 %mul11, ptr %i212, align 4, !tbaa !13
+ %i313 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 2
+ %i10 = load i32, ptr %i313, align 4, !tbaa !14
+ %i11 = load i32, ptr %s, align 4, !tbaa !12
%add15 = add nsw i32 %i10, %i11
- %i316 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
- store i32 %add15, i32* %i316, align 4, !tbaa !14
- %i12 = bitcast %struct.S* %s to i8*
- call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %i12)
+ %i316 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 2
+ store i32 %add15, ptr %i316, align 4, !tbaa !14
+ call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %s)
ret void
}
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
; void local_alloca_simplifiable_2(void) {
; char Bytes[1024];
@@ -269,8 +253,7 @@ define void @local_alloca_simplifiable_2() {
; TUNIT-SAME: () #[[ATTR3:[0-9]+]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
-; TUNIT-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
-; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR16]]
; TUNIT-NEXT: br label [[FOR_COND:%.*]]
; TUNIT: for.cond:
; TUNIT-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
@@ -280,7 +263,7 @@ define void @local_alloca_simplifiable_2() {
; TUNIT-NEXT: br label [[FOR_END:%.*]]
; TUNIT: for.body:
; TUNIT-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
-; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
+; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[I15]]
; TUNIT-NEXT: br label [[FOR_INC]]
; TUNIT: for.inc:
; TUNIT-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
@@ -294,10 +277,9 @@ define void @local_alloca_simplifiable_2() {
; TUNIT: for.cond.cleanup4:
; TUNIT-NEXT: br label [[FOR_END11:%.*]]
; TUNIT: for.body5:
-; TUNIT-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
; TUNIT-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
; TUNIT-NEXT: [[I18:%.*]] = or i64 [[I17]], 1
-; TUNIT-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
+; TUNIT-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, ptr [[BYTES]], i64 [[I18]]
; TUNIT-NEXT: br label [[FOR_INC9]]
; TUNIT: for.inc9:
; TUNIT-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
@@ -311,19 +293,17 @@ define void @local_alloca_simplifiable_2() {
; TUNIT: for.cond.cleanup15:
; TUNIT-NEXT: br label [[FOR_END24:%.*]]
; TUNIT: for.body16:
-; TUNIT-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
; TUNIT-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
; TUNIT-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
-; TUNIT-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
+; TUNIT-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, ptr [[BYTES]], i64 [[I21]]
; TUNIT-NEXT: br label [[FOR_INC22]]
; TUNIT: for.inc22:
; TUNIT-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
; TUNIT-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]]
; TUNIT: for.end24:
-; TUNIT-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
-; TUNIT-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
-; TUNIT-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR17]]
+; TUNIT-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 1023
+; TUNIT-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 500
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[ARRAYIDX26]], i32 noundef 0) #[[ATTR17]]
; TUNIT-NEXT: br label [[FOR_COND28:%.*]]
; TUNIT: for.cond28:
; TUNIT-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
@@ -332,15 +312,14 @@ define void @local_alloca_simplifiable_2() {
; TUNIT: for.cond.cleanup30:
; TUNIT-NEXT: br label [[FOR_END38:%.*]]
; TUNIT: for.body31:
-; TUNIT-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
-; TUNIT-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]]
+; TUNIT-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 [[INDVARS_IV12]]
+; TUNIT-NEXT: store i8 0, ptr [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]]
; TUNIT-NEXT: br label [[FOR_INC36]]
; TUNIT: for.inc36:
; TUNIT-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
; TUNIT-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]]
; TUNIT: for.end38:
-; TUNIT-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
-; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR16]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn
@@ -348,8 +327,7 @@ define void @local_alloca_simplifiable_2() {
; CGSCC-SAME: () #[[ATTR3:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
-; CGSCC-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
-; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR19]]
; CGSCC-NEXT: br label [[FOR_COND:%.*]]
; CGSCC: for.cond:
; CGSCC-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ]
@@ -359,8 +337,8 @@ define void @local_alloca_simplifiable_2() {
; CGSCC-NEXT: br label [[FOR_END:%.*]]
; CGSCC: for.body:
; CGSCC-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
-; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]]
-; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]]
+; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[I15]]
+; CGSCC-NEXT: store i8 0, ptr [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]]
; CGSCC-NEXT: br label [[FOR_INC]]
; CGSCC: for.inc:
; CGSCC-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
@@ -374,11 +352,10 @@ define void @local_alloca_simplifiable_2() {
; CGSCC: for.cond.cleanup4:
; CGSCC-NEXT: br label [[FOR_END11:%.*]]
; CGSCC: for.body5:
-; CGSCC-NEXT: [[I16:%.*]] = bitcast [1024 x i8]* [[BYTES]] to float*
; CGSCC-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
; CGSCC-NEXT: [[I18:%.*]] = or i64 [[I17]], 1
-; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]]
-; CGSCC-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]]
+; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, ptr [[BYTES]], i64 [[I18]]
+; CGSCC-NEXT: store float 0.000000e+00, ptr [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]]
; CGSCC-NEXT: br label [[FOR_INC9]]
; CGSCC: for.inc9:
; CGSCC-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
@@ -392,21 +369,19 @@ define void @local_alloca_simplifiable_2() {
; CGSCC: for.cond.cleanup15:
; CGSCC-NEXT: br label [[FOR_END24:%.*]]
; CGSCC: for.body16:
-; CGSCC-NEXT: [[I19:%.*]] = bitcast [1024 x i8]* [[BYTES]] to i64*
; CGSCC-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
; CGSCC-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2
-; CGSCC-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]]
-; CGSCC-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]]
+; CGSCC-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, ptr [[BYTES]], i64 [[I21]]
+; CGSCC-NEXT: store i64 0, ptr [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]]
; CGSCC-NEXT: br label [[FOR_INC22]]
; CGSCC: for.inc22:
; CGSCC-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
; CGSCC-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]]
; CGSCC: for.end24:
-; CGSCC-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023
-; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]]
-; CGSCC-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500
-; CGSCC-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32*
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR20]]
+; CGSCC-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 1023
+; CGSCC-NEXT: store i8 0, ptr [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 500
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) [[ARRAYIDX26]], i32 noundef 0) #[[ATTR20]]
; CGSCC-NEXT: br label [[FOR_COND28:%.*]]
; CGSCC: for.cond28:
; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ]
@@ -415,23 +390,21 @@ define void @local_alloca_simplifiable_2() {
; CGSCC: for.cond.cleanup30:
; CGSCC-NEXT: br label [[FOR_END38:%.*]]
; CGSCC: for.body31:
-; CGSCC-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]]
-; CGSCC-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]]
-; CGSCC-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
-; CGSCC-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[INDVARS_IV12]]
+; CGSCC-NEXT: [[I23:%.*]] = load i8, ptr [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 [[INDVARS_IV12]]
+; CGSCC-NEXT: store i8 [[I23]], ptr [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]]
; CGSCC-NEXT: br label [[FOR_INC36]]
; CGSCC: for.inc36:
; CGSCC-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
; CGSCC-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]]
; CGSCC: for.end38:
-; CGSCC-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
-; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR19]]
; CGSCC-NEXT: ret void
;
entry:
%Bytes = alloca [1024 x i8], align 16
- %i = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 0
- call void @llvm.lifetime.start.p0i8(i64 1024, i8* nonnull %i)
+ call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %Bytes)
br label %for.cond
for.cond: ; preds = %for.inc, %entry
@@ -444,8 +417,8 @@ for.cond.cleanup: ; preds = %for.cond
for.body: ; preds = %for.cond
%i15 = mul nuw nsw i64 %indvars.iv, 10
- %arrayidx = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %i15
- store i8 0, i8* %arrayidx, align 2, !tbaa !15
+ %arrayidx = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 %i15
+ store i8 0, ptr %arrayidx, align 2, !tbaa !15
br label %for.inc
for.inc: ; preds = %for.body
@@ -464,11 +437,10 @@ for.cond.cleanup4: ; preds = %for.cond2
br label %for.end11
for.body5: ; preds = %for.cond2
- %i16 = bitcast [1024 x i8]* %Bytes to float*
%i17 = mul nuw nsw i64 %indvars.iv2, 10
%i18 = or i64 %i17, 1
- %arrayidx8 = getelementptr inbounds float, float* %i16, i64 %i18
- store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
+ %arrayidx8 = getelementptr inbounds float, ptr %Bytes, i64 %i18
+ store float 0.000000e+00, ptr %arrayidx8, align 4, !tbaa !18
br label %for.inc9
for.inc9: ; preds = %for.body5
@@ -487,11 +459,10 @@ for.cond.cleanup15: ; preds = %for.cond13
br label %for.end24
for.body16: ; preds = %for.cond13
- %i19 = bitcast [1024 x i8]* %Bytes to i64*
%i20 = mul nuw nsw i64 %indvars.iv7, 10
%i21 = add nuw nsw i64 %i20, 2
- %arrayidx21 = getelementptr inbounds i64, i64* %i19, i64 %i21
- store i64 0, i64* %arrayidx21, align 16, !tbaa !20
+ %arrayidx21 = getelementptr inbounds i64, ptr %Bytes, i64 %i21
+ store i64 0, ptr %arrayidx21, align 16, !tbaa !20
br label %for.inc22
for.inc22: ; preds = %for.body16
@@ -499,11 +470,10 @@ for.inc22: ; preds = %for.body16
br label %for.cond13, !llvm.loop !22
for.end24: ; preds = %for.cond.cleanup15
- %arrayidx25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 1023
- store i8 0, i8* %arrayidx25, align 1, !tbaa !15
- %arrayidx26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 500
- %i22 = bitcast i8* %arrayidx26 to i32*
- call void @write_arg(i32* nonnull %i22, i32 0)
+ %arrayidx25 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 1023
+ store i8 0, ptr %arrayidx25, align 1, !tbaa !15
+ %arrayidx26 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 500
+ call void @write_arg(ptr nonnull %arrayidx26, i32 0)
br label %for.cond28
for.cond28: ; preds = %for.inc36, %for.end24
@@ -515,10 +485,10 @@ for.cond.cleanup30: ; preds = %for.cond28
br label %for.end38
for.body31: ; preds = %for.cond28
- %arrayidx33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %indvars.iv12
- %i23 = load i8, i8* %arrayidx33, align 1, !tbaa !15
- %arrayidx35 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
- store i8 %i23, i8* %arrayidx35, align 1, !tbaa !15
+ %arrayidx33 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 %indvars.iv12
+ %i23 = load i8, ptr %arrayidx33, align 1, !tbaa !15
+ %arrayidx35 = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 %indvars.iv12
+ store i8 %i23, ptr %arrayidx35, align 1, !tbaa !15
br label %for.inc36
for.inc36: ; preds = %for.body31
@@ -526,8 +496,7 @@ for.inc36: ; preds = %for.body31
br label %for.cond28, !llvm.loop !23
for.end38: ; preds = %for.cond.cleanup30
- %i24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 0
- call void @llvm.lifetime.end.p0i8(i64 1024, i8* nonnull %i24)
+ call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %Bytes)
ret void
}
@@ -547,11 +516,11 @@ define i32 @local_alloca_simplifiable_3() {
; CHECK-NEXT: ret i32 2
;
%A = alloca i32, align 4
- store i32 1, i32* %A
+ store i32 1, ptr %A
br label %split
split:
- store i32 2, i32* %A
- %l = load i32, i32* %A, align 4
+ store i32 2, ptr %A
+ %l = load i32, ptr %A, align 4
ret i32 %l
}
; int local_alloca_simplifiable_4() {
@@ -566,7 +535,7 @@ define i32 @local_alloca_simplifiable_4() {
; CHECK-NEXT: ret i32 undef
;
%A = alloca i32, align 4
- %l = load i32, i32* %A, align 4
+ %l = load i32, ptr %A, align 4
ret i32 %l
}
@@ -582,8 +551,7 @@ define i32 @multi_obj_simplifiable_1(i32 %cnd) {
; TUNIT-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[L:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR16]]
; TUNIT-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
; TUNIT-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
; TUNIT: cond.true:
@@ -591,8 +559,7 @@ define i32 @multi_obj_simplifiable_1(i32 %cnd) {
; TUNIT: cond.false:
; TUNIT-NEXT: br label [[COND_END]]
; TUNIT: cond.end:
-; TUNIT-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR16]]
; TUNIT-NEXT: ret i32 5
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn
@@ -600,8 +567,7 @@ define i32 @multi_obj_simplifiable_1(i32 %cnd) {
; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR5:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[L:%.*]] = alloca i32, align 4
-; CGSCC-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR19]]
; CGSCC-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
; CGSCC-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
; CGSCC: cond.true:
@@ -609,16 +575,14 @@ define i32 @multi_obj_simplifiable_1(i32 %cnd) {
; CGSCC: cond.false:
; CGSCC-NEXT: br label [[COND_END]]
; CGSCC: cond.end:
-; CGSCC-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR19]]
; CGSCC-NEXT: ret i32 5
;
entry:
%L = alloca i32, align 4
- %i = bitcast i32* %L to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
- store i32 5, i32* @GI1, align 4, !tbaa !3
- store i32 5, i32* %L, align 4, !tbaa !3
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L)
+ store i32 5, ptr @GI1, align 4, !tbaa !3
+ store i32 5, ptr %L, align 4, !tbaa !3
%tobool.not = icmp eq i32 %cnd, 0
br i1 %tobool.not, label %cond.false, label %cond.true
@@ -629,10 +593,9 @@ cond.false: ; preds = %entry
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
- %cond = phi i32* [ @GI1, %cond.true ], [ %L, %cond.false ]
- %i1 = load i32, i32* %cond, align 4, !tbaa !3
- %i2 = bitcast i32* %L to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i2)
+ %cond = phi ptr [ @GI1, %cond.true ], [ %L, %cond.false ]
+ %i1 = load i32, ptr %cond, align 4, !tbaa !3
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L)
ret i32 %i1
}
@@ -650,8 +613,7 @@ define i32 @multi_obj_simplifiable_2(i32 %cnd) {
; TUNIT-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[L:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR16]]
; TUNIT-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
; TUNIT-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
; TUNIT: cond.true:
@@ -659,8 +621,7 @@ define i32 @multi_obj_simplifiable_2(i32 %cnd) {
; TUNIT: cond.false:
; TUNIT-NEXT: br label [[COND_END]]
; TUNIT: cond.end:
-; TUNIT-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR16]]
; TUNIT-NEXT: ret i32 5
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn
@@ -668,8 +629,7 @@ define i32 @multi_obj_simplifiable_2(i32 %cnd) {
; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR5]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[L:%.*]] = alloca i32, align 4
-; CGSCC-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR19]]
; CGSCC-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0
; CGSCC-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]]
; CGSCC: cond.true:
@@ -677,14 +637,12 @@ define i32 @multi_obj_simplifiable_2(i32 %cnd) {
; CGSCC: cond.false:
; CGSCC-NEXT: br label [[COND_END]]
; CGSCC: cond.end:
-; CGSCC-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR19]]
; CGSCC-NEXT: ret i32 5
;
entry:
%L = alloca i32, align 4
- %i = bitcast i32* %L to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L)
%tobool.not = icmp eq i32 %cnd, 0
br i1 %tobool.not, label %cond.false, label %cond.true
@@ -695,11 +653,10 @@ cond.false: ; preds = %entry
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
- %cond = phi i32* [ @GI2, %cond.true ], [ %L, %cond.false ]
- store i32 5, i32* %cond, align 4, !tbaa !3
- %i1 = bitcast i32* %L to i8*
- %l = load i32, i32* %cond, align 4, !tbaa !3
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i1)
+ %cond = phi ptr [ @GI2, %cond.true ], [ %L, %cond.false ]
+ store i32 5, ptr %cond, align 4, !tbaa !3
+ %l = load i32, ptr %cond, align 4, !tbaa !3
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L)
ret i32 %l
}
@@ -721,95 +678,92 @@ cond.end: ; preds = %cond.false, %cond.t
; return r;
; }
;
-define void @static_global_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result) {
+define void @static_global_simplifiable_1(ptr noalias sret(%struct.S) align 4 %agg.result) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@static_global_simplifiable_1
-; TUNIT-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5:[0-9]+]] {
+; TUNIT-SAME: (ptr noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5:[0-9]+]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR17]]
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR17]]
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR17]]
-; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
-; TUNIT-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
-; TUNIT-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
-; TUNIT-NEXT: store float 0x40119999A0000000, float* [[F2]], align 4, !tbaa [[TBAA10]]
-; TUNIT-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
-; TUNIT-NEXT: store float 0x40119999A0000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
-; TUNIT-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
-; TUNIT-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]]
-; TUNIT-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
-; TUNIT-NEXT: store i32 4, i32* [[I2]], align 4, !tbaa [[TBAA13]]
-; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
-; TUNIT-NEXT: store i32 4, i32* [[I3]], align 4, !tbaa [[TBAA14]]
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) @Gs1, i32 noundef 1) #[[ATTR17]]
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR17]]
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR17]]
+; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3
+; TUNIT-NEXT: store float 0x3FF19999A0000000, ptr [[F1]], align 4, !tbaa [[TBAA7]]
+; TUNIT-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 4
+; TUNIT-NEXT: store float 0x40119999A0000000, ptr [[F2]], align 4, !tbaa [[TBAA10]]
+; TUNIT-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 5
+; TUNIT-NEXT: store float 0x40119999A0000000, ptr [[F3]], align 4, !tbaa [[TBAA11]]
+; TUNIT-NEXT: store i32 1, ptr [[AGG_RESULT]], align 4, !tbaa [[TBAA12]]
+; TUNIT-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 1
+; TUNIT-NEXT: store i32 4, ptr [[I2]], align 4, !tbaa [[TBAA13]]
+; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 2
+; TUNIT-NEXT: store i32 4, ptr [[I3]], align 4, !tbaa [[TBAA14]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@static_global_simplifiable_1
-; CGSCC-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR3]] {
+; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR3]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: store float 0x3FF19999A0000000, float* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa [[TBAA7]]
-; CGSCC-NEXT: store float 0x40019999A0000000, float* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 4), align 4, !tbaa [[TBAA10]]
-; CGSCC-NEXT: store float 0x400A666660000000, float* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 5), align 4, !tbaa [[TBAA11]]
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR20]]
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR20]]
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR20]]
-; CGSCC-NEXT: [[I:%.*]] = load float, float* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa [[TBAA7]]
-; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
-; CGSCC-NEXT: store float [[I]], float* [[F1]], align 4, !tbaa [[TBAA7]]
-; CGSCC-NEXT: [[I4:%.*]] = load float, float* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 4), align 4, !tbaa [[TBAA10]]
+; CGSCC-NEXT: store float 0x3FF19999A0000000, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 3), align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: store float 0x40019999A0000000, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 4), align 4, !tbaa [[TBAA10]]
+; CGSCC-NEXT: store float 0x400A666660000000, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 5), align 4, !tbaa [[TBAA11]]
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) @Gs1, i32 noundef 1) #[[ATTR20]]
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR20]]
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR20]]
+; CGSCC-NEXT: [[I:%.*]] = load float, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 3), align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3
+; CGSCC-NEXT: store float [[I]], ptr [[F1]], align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[I4:%.*]] = load float, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 4), align 4, !tbaa [[TBAA10]]
; CGSCC-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
-; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
-; CGSCC-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]]
-; CGSCC-NEXT: [[I5:%.*]] = load float, float* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 5), align 4, !tbaa [[TBAA11]]
-; CGSCC-NEXT: [[I6:%.*]] = load float, float* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 4
+; CGSCC-NEXT: store float [[MUL]], ptr [[F2]], align 4, !tbaa [[TBAA10]]
+; CGSCC-NEXT: [[I5:%.*]] = load float, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 5), align 4, !tbaa [[TBAA11]]
+; CGSCC-NEXT: [[I6:%.*]] = load float, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 3), align 4, !tbaa [[TBAA7]]
; CGSCC-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]]
-; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
-; CGSCC-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]]
-; CGSCC-NEXT: [[I7:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), align 4, !tbaa [[TBAA12]]
-; CGSCC-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
-; CGSCC-NEXT: store i32 [[I7]], i32* [[I1]], align 4, !tbaa [[TBAA12]]
-; CGSCC-NEXT: [[I8:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), align 4, !tbaa [[TBAA13]]
+; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 5
+; CGSCC-NEXT: store float [[ADD]], ptr [[F3]], align 4, !tbaa [[TBAA11]]
+; CGSCC-NEXT: [[I7:%.*]] = load i32, ptr @Gs1, align 4, !tbaa [[TBAA12]]
+; CGSCC-NEXT: store i32 [[I7]], ptr [[AGG_RESULT]], align 4, !tbaa [[TBAA12]]
+; CGSCC-NEXT: [[I8:%.*]] = load i32, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 1), align 4, !tbaa [[TBAA13]]
; CGSCC-NEXT: [[MUL1:%.*]] = shl nsw i32 [[I8]], 1
-; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
-; CGSCC-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]]
-; CGSCC-NEXT: [[I9:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), align 4, !tbaa [[TBAA14]]
-; CGSCC-NEXT: [[I10:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), align 4, !tbaa [[TBAA12]]
+; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 1
+; CGSCC-NEXT: store i32 [[MUL1]], ptr [[I2]], align 4, !tbaa [[TBAA13]]
+; CGSCC-NEXT: [[I9:%.*]] = load i32, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 2), align 4, !tbaa [[TBAA14]]
+; CGSCC-NEXT: [[I10:%.*]] = load i32, ptr @Gs1, align 4, !tbaa [[TBAA12]]
; CGSCC-NEXT: [[ADD2:%.*]] = add nsw i32 [[I9]], [[I10]]
-; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
-; CGSCC-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]]
+; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 2
+; CGSCC-NEXT: store i32 [[ADD2]], ptr [[I3]], align 4, !tbaa [[TBAA14]]
; CGSCC-NEXT: ret void
;
entry:
- store float 0x3FF19999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
- store float 0x40019999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 4), align 4, !tbaa !10
- store float 0x400A666660000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 5), align 4, !tbaa !11
- call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), i32 1)
- call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 1), i32 2)
- call void @write_arg(i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 2), i32 3)
- %i = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
- %f1 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
- store float %i, float* %f1, align 4, !tbaa !7
- %i4 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 4), align 4, !tbaa !10
+ store float 0x3FF19999A0000000, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 3), align 4, !tbaa !7
+ store float 0x40019999A0000000, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 4), align 4, !tbaa !10
+ store float 0x400A666660000000, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 5), align 4, !tbaa !11
+ call void @write_arg(ptr @Gs1, i32 1)
+ call void @write_arg(ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 1), i32 2)
+ call void @write_arg(ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 2), i32 3)
+ %i = load float, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 3), align 4, !tbaa !7
+ %f1 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 3
+ store float %i, ptr %f1, align 4, !tbaa !7
+ %i4 = load float, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 4), align 4, !tbaa !10
%mul = fmul float %i4, 2.000000e+00
- %f2 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
- store float %mul, float* %f2, align 4, !tbaa !10
- %i5 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 5), align 4, !tbaa !11
- %i6 = load float, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7
+ %f2 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 4
+ store float %mul, ptr %f2, align 4, !tbaa !10
+ %i5 = load float, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 5), align 4, !tbaa !11
+ %i6 = load float, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 3), align 4, !tbaa !7
%add = fadd float %i5, %i6
- %f3 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
- store float %add, float* %f3, align 4, !tbaa !11
- %i7 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), align 4, !tbaa !12
- %i1 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
- store i32 %i7, i32* %i1, align 4, !tbaa !12
- %i8 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 1), align 4, !tbaa !13
+ %f3 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 5
+ store float %add, ptr %f3, align 4, !tbaa !11
+ %i7 = load i32, ptr @Gs1, align 4, !tbaa !12
+ store i32 %i7, ptr %agg.result, align 4, !tbaa !12
+ %i8 = load i32, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 1), align 4, !tbaa !13
%mul1 = shl nsw i32 %i8, 1
- %i2 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
- store i32 %mul1, i32* %i2, align 4, !tbaa !13
- %i9 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 2), align 4, !tbaa !14
- %i10 = load i32, i32* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 0), align 4, !tbaa !12
+ %i2 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 1
+ store i32 %mul1, ptr %i2, align 4, !tbaa !13
+ %i9 = load i32, ptr getelementptr inbounds (%struct.S, ptr @Gs1, i64 0, i32 2), align 4, !tbaa !14
+ %i10 = load i32, ptr @Gs1, align 4, !tbaa !12
%add2 = add nsw i32 %i9, %i10
- %i3 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
- store i32 %add2, i32* %i3, align 4, !tbaa !14
+ %i3 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 2
+ store i32 %add2, ptr %i3, align 4, !tbaa !14
ret void
}
@@ -842,7 +796,7 @@ define void @static_global_simplifiable_2() {
; TUNIT-NEXT: br label [[FOR_END:%.*]]
; TUNIT: for.body:
; TUNIT-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
-; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
+; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], ptr @GBytes, i64 0, i64 [[I]]
; TUNIT-NEXT: br label [[FOR_INC]]
; TUNIT: for.inc:
; TUNIT-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
@@ -858,7 +812,7 @@ define void @static_global_simplifiable_2() {
; TUNIT: for.body5:
; TUNIT-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
; TUNIT-NEXT: [[I16:%.*]] = or i64 [[I15]], 1
-; TUNIT-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
+; TUNIT-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, ptr @GBytes, i64 [[I16]]
; TUNIT-NEXT: br label [[FOR_INC9]]
; TUNIT: for.inc9:
; TUNIT-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
@@ -874,13 +828,13 @@ define void @static_global_simplifiable_2() {
; TUNIT: for.body16:
; TUNIT-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
; TUNIT-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
-; TUNIT-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
+; TUNIT-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, ptr @GBytes, i64 [[I18]]
; TUNIT-NEXT: br label [[FOR_INC21]]
; TUNIT: for.inc21:
; TUNIT-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
; TUNIT-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]]
; TUNIT: for.end23:
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR17]]
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(524) getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 500), i32 noundef 0) #[[ATTR17]]
; TUNIT-NEXT: br label [[FOR_COND25:%.*]]
; TUNIT: for.cond25:
; TUNIT-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
@@ -889,8 +843,8 @@ define void @static_global_simplifiable_2() {
; TUNIT: for.cond.cleanup27:
; TUNIT-NEXT: br label [[FOR_END35:%.*]]
; TUNIT: for.body28:
-; TUNIT-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
-; TUNIT-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
+; TUNIT-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 [[INDVARS_IV12]]
+; TUNIT-NEXT: store i8 0, ptr [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
; TUNIT-NEXT: br label [[FOR_INC33]]
; TUNIT: for.inc33:
; TUNIT-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
@@ -911,8 +865,8 @@ define void @static_global_simplifiable_2() {
; CGSCC-NEXT: br label [[FOR_END:%.*]]
; CGSCC: for.body:
; CGSCC-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
-; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]]
-; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], ptr @GBytes, i64 0, i64 [[I]]
+; CGSCC-NEXT: store i8 0, ptr [[ARRAYIDX]], align 2, !tbaa [[TBAA15]]
; CGSCC-NEXT: br label [[FOR_INC]]
; CGSCC: for.inc:
; CGSCC-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
@@ -928,8 +882,8 @@ define void @static_global_simplifiable_2() {
; CGSCC: for.body5:
; CGSCC-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
; CGSCC-NEXT: [[I16:%.*]] = or i64 [[I15]], 1
-; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]]
-; CGSCC-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
+; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, ptr @GBytes, i64 [[I16]]
+; CGSCC-NEXT: store float 0.000000e+00, ptr [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
; CGSCC-NEXT: br label [[FOR_INC9]]
; CGSCC: for.inc9:
; CGSCC-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
@@ -945,15 +899,15 @@ define void @static_global_simplifiable_2() {
; CGSCC: for.body16:
; CGSCC-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
; CGSCC-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2
-; CGSCC-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]]
-; CGSCC-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]]
+; CGSCC-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, ptr @GBytes, i64 [[I18]]
+; CGSCC-NEXT: store i64 0, ptr [[ARRAYIDX20]], align 16, !tbaa [[TBAA20]]
; CGSCC-NEXT: br label [[FOR_INC21]]
; CGSCC: for.inc21:
; CGSCC-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
; CGSCC-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]]
; CGSCC: for.end23:
-; CGSCC-NEXT: store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]]
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR20]]
+; CGSCC-NEXT: store i8 0, ptr getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 500), i32 noundef 0) #[[ATTR20]]
; CGSCC-NEXT: br label [[FOR_COND25:%.*]]
; CGSCC: for.cond25:
; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ]
@@ -962,10 +916,10 @@ define void @static_global_simplifiable_2() {
; CGSCC: for.cond.cleanup27:
; CGSCC-NEXT: br label [[FOR_END35:%.*]]
; CGSCC: for.body28:
-; CGSCC-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]]
-; CGSCC-NEXT: [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]]
-; CGSCC-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
-; CGSCC-NEXT: store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], ptr @GBytes, i64 0, i64 [[INDVARS_IV12]]
+; CGSCC-NEXT: [[I19:%.*]] = load i8, ptr [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 [[INDVARS_IV12]]
+; CGSCC-NEXT: store i8 [[I19]], ptr [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
; CGSCC-NEXT: br label [[FOR_INC33]]
; CGSCC: for.inc33:
; CGSCC-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
@@ -986,8 +940,8 @@ for.cond.cleanup: ; preds = %for.cond
for.body: ; preds = %for.cond
%i = mul nuw nsw i64 %indvars.iv, 10
- %arrayidx = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 %i
- store i8 0, i8* %arrayidx, align 2, !tbaa !15
+ %arrayidx = getelementptr inbounds [1024 x i8], ptr @GBytes, i64 0, i64 %i
+ store i8 0, ptr %arrayidx, align 2, !tbaa !15
br label %for.inc
for.inc: ; preds = %for.body
@@ -1008,8 +962,8 @@ for.cond.cleanup4: ; preds = %for.cond2
for.body5: ; preds = %for.cond2
%i15 = mul nuw nsw i64 %indvars.iv2, 10
%i16 = or i64 %i15, 1
- %arrayidx8 = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 %i16
- store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
+ %arrayidx8 = getelementptr inbounds float, ptr @GBytes, i64 %i16
+ store float 0.000000e+00, ptr %arrayidx8, align 4, !tbaa !18
br label %for.inc9
for.inc9: ; preds = %for.body5
@@ -1030,8 +984,8 @@ for.cond.cleanup15: ; preds = %for.cond13
for.body16: ; preds = %for.cond13
%i17 = mul nuw nsw i64 %indvars.iv7, 10
%i18 = add nuw nsw i64 %i17, 2
- %arrayidx20 = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 %i18
- store i64 0, i64* %arrayidx20, align 16, !tbaa !20
+ %arrayidx20 = getelementptr inbounds i64, ptr @GBytes, i64 %i18
+ store i64 0, ptr %arrayidx20, align 16, !tbaa !20
br label %for.inc21
for.inc21: ; preds = %for.body16
@@ -1039,8 +993,8 @@ for.inc21: ; preds = %for.body16
br label %for.cond13, !llvm.loop !26
for.end23: ; preds = %for.cond.cleanup15
- store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa !15
- call void @write_arg(i32* bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 0)
+ store i8 0, ptr getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 1023), align 1, !tbaa !15
+ call void @write_arg(ptr getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 500), i32 0)
br label %for.cond25
for.cond25: ; preds = %for.inc33, %for.end23
@@ -1052,10 +1006,10 @@ for.cond.cleanup27: ; preds = %for.cond25
br label %for.end35
for.body28: ; preds = %for.cond25
- %arrayidx30 = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 %indvars.iv12
- %i19 = load i8, i8* %arrayidx30, align 1, !tbaa !15
- %arrayidx32 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
- store i8 %i19, i8* %arrayidx32, align 1, !tbaa !15
+ %arrayidx30 = getelementptr inbounds [1024 x i8], ptr @GBytes, i64 0, i64 %indvars.iv12
+ %i19 = load i8, ptr %arrayidx30, align 1, !tbaa !15
+ %arrayidx32 = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 %indvars.iv12
+ store i8 %i19, ptr %arrayidx32, align 1, !tbaa !15
br label %for.inc33
for.inc33: ; preds = %for.body28
@@ -1075,17 +1029,17 @@ define i32 @static_global_simplifiable_3() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@static_global_simplifiable_3
; TUNIT-SAME: () #[[ATTR5]] {
-; TUNIT-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: store i32 1, ptr @Flag3, align 4, !tbaa [[TBAA3]]
; TUNIT-NEXT: ret i32 1
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@static_global_simplifiable_3
; CGSCC-SAME: () #[[ATTR6:[0-9]+]] {
-; CGSCC-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: store i32 1, ptr @Flag3, align 4, !tbaa [[TBAA3]]
; CGSCC-NEXT: ret i32 1
;
- store i32 1, i32* @Flag3, align 4, !tbaa !3
- %i = load i32, i32* @Flag3, align 4, !tbaa !3
+ store i32 1, ptr @Flag3, align 4, !tbaa !3
+ %i = load i32, ptr @Flag3, align 4, !tbaa !3
ret i32 %i
}
@@ -1106,152 +1060,140 @@ define i32 @static_global_simplifiable_3() {
; return r;
; }
;
-define void @noalias_arg_simplifiable_1(%struct.S* noalias sret(%struct.S) align 4 %agg.result, %struct.S* byval(%struct.S) align 8 %s) {
+define void @noalias_arg_simplifiable_1(ptr noalias sret(%struct.S) align 4 %agg.result, ptr byval(%struct.S) align 8 %s) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
-; TUNIT-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], ptr noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; TUNIT-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
-; TUNIT-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
-; TUNIT-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
-; TUNIT-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
-; TUNIT-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
-; TUNIT-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR17]]
-; TUNIT-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR17]]
-; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR17]]
-; TUNIT-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; TUNIT-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
-; TUNIT-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
-; TUNIT-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
-; TUNIT-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
-; TUNIT-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
+; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; TUNIT-NEXT: store float 0x3FF19999A0000000, ptr [[F1]], align 4, !tbaa [[TBAA7]]
+; TUNIT-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4
+; TUNIT-NEXT: store float 0x40019999A0000000, ptr [[F2]], align 8, !tbaa [[TBAA10]]
+; TUNIT-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5
+; TUNIT-NEXT: store float 0x400A666660000000, ptr [[F3]], align 4, !tbaa [[TBAA11]]
+; TUNIT-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR17]]
+; TUNIT-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR17]]
+; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR17]]
+; TUNIT-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; TUNIT-NEXT: [[I:%.*]] = load float, ptr [[F11]], align 4, !tbaa [[TBAA7]]
+; TUNIT-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3
+; TUNIT-NEXT: store float [[I]], ptr [[F12]], align 4, !tbaa [[TBAA7]]
+; TUNIT-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4
+; TUNIT-NEXT: [[I4:%.*]] = load float, ptr [[F23]], align 8, !tbaa [[TBAA10]]
; TUNIT-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
-; TUNIT-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
-; TUNIT-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
-; TUNIT-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
-; TUNIT-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
-; TUNIT-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; TUNIT-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
+; TUNIT-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 4
+; TUNIT-NEXT: store float [[MUL]], ptr [[F24]], align 4, !tbaa [[TBAA10]]
+; TUNIT-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5
+; TUNIT-NEXT: [[I5:%.*]] = load float, ptr [[F35]], align 4, !tbaa [[TBAA11]]
+; TUNIT-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; TUNIT-NEXT: [[I6:%.*]] = load float, ptr [[F16]], align 4, !tbaa [[TBAA7]]
; TUNIT-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]]
-; TUNIT-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
-; TUNIT-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
-; TUNIT-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; TUNIT-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
-; TUNIT-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
-; TUNIT-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
-; TUNIT-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
-; TUNIT-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
+; TUNIT-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 5
+; TUNIT-NEXT: store float [[ADD]], ptr [[F37]], align 4, !tbaa [[TBAA11]]
+; TUNIT-NEXT: [[I7:%.*]] = load i32, ptr [[S]], align 8, !tbaa [[TBAA12]]
+; TUNIT-NEXT: store i32 [[I7]], ptr [[AGG_RESULT]], align 4, !tbaa [[TBAA12]]
+; TUNIT-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1
+; TUNIT-NEXT: [[I8:%.*]] = load i32, ptr [[I210]], align 4, !tbaa [[TBAA13]]
; TUNIT-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
-; TUNIT-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
-; TUNIT-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
-; TUNIT-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; TUNIT-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
-; TUNIT-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; TUNIT-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
+; TUNIT-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 1
+; TUNIT-NEXT: store i32 [[MUL11]], ptr [[I212]], align 4, !tbaa [[TBAA13]]
+; TUNIT-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; TUNIT-NEXT: [[I9:%.*]] = load i32, ptr [[I313]], align 8, !tbaa [[TBAA14]]
+; TUNIT-NEXT: [[I10:%.*]] = load i32, ptr [[S]], align 8, !tbaa [[TBAA12]]
; TUNIT-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
-; TUNIT-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
-; TUNIT-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
+; TUNIT-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 2
+; TUNIT-NEXT: store i32 [[ADD15]], ptr [[I316]], align 4, !tbaa [[TBAA14]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1
-; CGSCC-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] {
+; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], ptr noalias nocapture nofree noundef nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; CGSCC-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]]
-; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
-; CGSCC-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]]
-; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
-; CGSCC-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]]
-; CGSCC-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR20]]
-; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR20]]
-; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR20]]
-; CGSCC-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; CGSCC-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]]
-; CGSCC-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3
-; CGSCC-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]]
-; CGSCC-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4
-; CGSCC-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]]
+; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; CGSCC-NEXT: store float 0x3FF19999A0000000, ptr [[F1]], align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4
+; CGSCC-NEXT: store float 0x40019999A0000000, ptr [[F2]], align 8, !tbaa [[TBAA10]]
+; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5
+; CGSCC-NEXT: store float 0x400A666660000000, ptr [[F3]], align 4, !tbaa [[TBAA11]]
+; CGSCC-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR20]]
+; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR20]]
+; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR20]]
+; CGSCC-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; CGSCC-NEXT: [[I:%.*]] = load float, ptr [[F11]], align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3
+; CGSCC-NEXT: store float [[I]], ptr [[F12]], align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4
+; CGSCC-NEXT: [[I4:%.*]] = load float, ptr [[F23]], align 8, !tbaa [[TBAA10]]
; CGSCC-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00
-; CGSCC-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4
-; CGSCC-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]]
-; CGSCC-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5
-; CGSCC-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]]
-; CGSCC-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3
-; CGSCC-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]]
+; CGSCC-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 4
+; CGSCC-NEXT: store float [[MUL]], ptr [[F24]], align 4, !tbaa [[TBAA10]]
+; CGSCC-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5
+; CGSCC-NEXT: [[I5:%.*]] = load float, ptr [[F35]], align 4, !tbaa [[TBAA11]]
+; CGSCC-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3
+; CGSCC-NEXT: [[I6:%.*]] = load float, ptr [[F16]], align 4, !tbaa [[TBAA7]]
; CGSCC-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]]
-; CGSCC-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5
-; CGSCC-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]]
-; CGSCC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; CGSCC-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]]
-; CGSCC-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0
-; CGSCC-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]]
-; CGSCC-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1
-; CGSCC-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]]
+; CGSCC-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 5
+; CGSCC-NEXT: store float [[ADD]], ptr [[F37]], align 4, !tbaa [[TBAA11]]
+; CGSCC-NEXT: [[I7:%.*]] = load i32, ptr [[S]], align 8, !tbaa [[TBAA12]]
+; CGSCC-NEXT: store i32 [[I7]], ptr [[AGG_RESULT]], align 4, !tbaa [[TBAA12]]
+; CGSCC-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1
+; CGSCC-NEXT: [[I8:%.*]] = load i32, ptr [[I210]], align 4, !tbaa [[TBAA13]]
; CGSCC-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1
-; CGSCC-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1
-; CGSCC-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]]
-; CGSCC-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; CGSCC-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]]
-; CGSCC-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0
-; CGSCC-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]]
+; CGSCC-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 1
+; CGSCC-NEXT: store i32 [[MUL11]], ptr [[I212]], align 4, !tbaa [[TBAA13]]
+; CGSCC-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; CGSCC-NEXT: [[I9:%.*]] = load i32, ptr [[I313]], align 8, !tbaa [[TBAA14]]
+; CGSCC-NEXT: [[I10:%.*]] = load i32, ptr [[S]], align 8, !tbaa [[TBAA12]]
; CGSCC-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]]
-; CGSCC-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2
-; CGSCC-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]]
+; CGSCC-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 2
+; CGSCC-NEXT: store i32 [[ADD15]], ptr [[I316]], align 4, !tbaa [[TBAA14]]
; CGSCC-NEXT: ret void
;
entry:
- %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
- store float 0x3FF19999A0000000, float* %f1, align 4, !tbaa !7
- %f2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
- store float 0x40019999A0000000, float* %f2, align 8, !tbaa !10
- %f3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
- store float 0x400A666660000000, float* %f3, align 4, !tbaa !11
- %i1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
- call void @write_arg(i32* nonnull %i1, i32 1)
- %i2 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
- call void @write_arg(i32* nonnull %i2, i32 2)
- %i3 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
- call void @write_arg(i32* nonnull %i3, i32 3)
- %f11 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
- %i = load float, float* %f11, align 4, !tbaa !7
- %f12 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 3
- store float %i, float* %f12, align 4, !tbaa !7
- %f23 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 4
- %i4 = load float, float* %f23, align 8, !tbaa !10
+ %f1 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 3
+ store float 0x3FF19999A0000000, ptr %f1, align 4, !tbaa !7
+ %f2 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 4
+ store float 0x40019999A0000000, ptr %f2, align 8, !tbaa !10
+ %f3 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 5
+ store float 0x400A666660000000, ptr %f3, align 4, !tbaa !11
+ call void @write_arg(ptr nonnull %s, i32 1)
+ %i2 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 1
+ call void @write_arg(ptr nonnull %i2, i32 2)
+ %i3 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 2
+ call void @write_arg(ptr nonnull %i3, i32 3)
+ %f11 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 3
+ %i = load float, ptr %f11, align 4, !tbaa !7
+ %f12 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 3
+ store float %i, ptr %f12, align 4, !tbaa !7
+ %f23 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 4
+ %i4 = load float, ptr %f23, align 8, !tbaa !10
%mul = fmul float %i4, 2.000000e+00
- %f24 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 4
- store float %mul, float* %f24, align 4, !tbaa !10
- %f35 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 5
- %i5 = load float, float* %f35, align 4, !tbaa !11
- %f16 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3
- %i6 = load float, float* %f16, align 4, !tbaa !7
+ %f24 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 4
+ store float %mul, ptr %f24, align 4, !tbaa !10
+ %f35 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 5
+ %i5 = load float, ptr %f35, align 4, !tbaa !11
+ %f16 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 3
+ %i6 = load float, ptr %f16, align 4, !tbaa !7
%add = fadd float %i5, %i6
- %f37 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 5
- store float %add, float* %f37, align 4, !tbaa !11
- %i18 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
- %i7 = load i32, i32* %i18, align 8, !tbaa !12
- %i19 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 0
- store i32 %i7, i32* %i19, align 4, !tbaa !12
- %i210 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 1
- %i8 = load i32, i32* %i210, align 4, !tbaa !13
+ %f37 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 5
+ store float %add, ptr %f37, align 4, !tbaa !11
+ %i7 = load i32, ptr %s, align 8, !tbaa !12
+ store i32 %i7, ptr %agg.result, align 4, !tbaa !12
+ %i210 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 1
+ %i8 = load i32, ptr %i210, align 4, !tbaa !13
%mul11 = shl nsw i32 %i8, 1
- %i212 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 1
- store i32 %mul11, i32* %i212, align 4, !tbaa !13
- %i313 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
- %i9 = load i32, i32* %i313, align 8, !tbaa !14
- %i114 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 0
- %i10 = load i32, i32* %i114, align 8, !tbaa !12
+ %i212 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 1
+ store i32 %mul11, ptr %i212, align 4, !tbaa !13
+ %i313 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 2
+ %i9 = load i32, ptr %i313, align 8, !tbaa !14
+ %i10 = load i32, ptr %s, align 8, !tbaa !12
%add15 = add nsw i32 %i9, %i10
- %i316 = getelementptr inbounds %struct.S, %struct.S* %agg.result, i64 0, i32 2
- store i32 %add15, i32* %i316, align 4, !tbaa !14
+ %i316 = getelementptr inbounds %struct.S, ptr %agg.result, i64 0, i32 2
+ store i32 %add15, ptr %i316, align 4, !tbaa !14
ret void
}
@@ -1269,10 +1211,10 @@ entry:
; globalBytes[i] = Bytes[i];
; }
;
-define void @noalias_arg_simplifiable_2(i8* %Bytes) {
+define void @noalias_arg_simplifiable_2(ptr %Bytes) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn
; TUNIT-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
-; TUNIT-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR3]] {
+; TUNIT-SAME: (ptr nocapture nofree [[BYTES:%.*]]) #[[ATTR3]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: br label [[FOR_COND:%.*]]
; TUNIT: for.cond:
@@ -1283,8 +1225,8 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
; TUNIT-NEXT: br label [[FOR_END:%.*]]
; TUNIT: for.body:
; TUNIT-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
-; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
-; TUNIT-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]]
+; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 [[I]]
+; TUNIT-NEXT: store i8 0, ptr [[ARRAYIDX]], align 1, !tbaa [[TBAA19]]
; TUNIT-NEXT: br label [[FOR_INC]]
; TUNIT: for.inc:
; TUNIT-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
@@ -1298,11 +1240,10 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
; TUNIT: for.cond.cleanup4:
; TUNIT-NEXT: br label [[FOR_END11:%.*]]
; TUNIT: for.body5:
-; TUNIT-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
; TUNIT-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
; TUNIT-NEXT: [[I17:%.*]] = or i64 [[I16]], 1
-; TUNIT-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
-; TUNIT-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]]
+; TUNIT-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, ptr [[BYTES]], i64 [[I17]]
+; TUNIT-NEXT: store float 0.000000e+00, ptr [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]]
; TUNIT-NEXT: br label [[FOR_INC9]]
; TUNIT: for.inc9:
; TUNIT-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
@@ -1316,21 +1257,19 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
; TUNIT: for.cond.cleanup15:
; TUNIT-NEXT: br label [[FOR_END23:%.*]]
; TUNIT: for.body16:
-; TUNIT-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
; TUNIT-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
; TUNIT-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
-; TUNIT-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
-; TUNIT-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]]
+; TUNIT-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, ptr [[BYTES]], i64 [[I20]]
+; TUNIT-NEXT: store i64 0, ptr [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]]
; TUNIT-NEXT: br label [[FOR_INC21]]
; TUNIT: for.inc21:
; TUNIT-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
; TUNIT-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
; TUNIT: for.end23:
-; TUNIT-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
-; TUNIT-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]]
-; TUNIT-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
-; TUNIT-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
-; TUNIT-NEXT: call void @write_arg(i32* nocapture nofree nonnull writeonly align 4 [[I21]], i32 noundef 0) #[[ATTR17]]
+; TUNIT-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 1023
+; TUNIT-NEXT: store i8 0, ptr [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]]
+; TUNIT-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 500
+; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 [[ARRAYIDX25]], i32 noundef 0) #[[ATTR17]]
; TUNIT-NEXT: br label [[FOR_COND27:%.*]]
; TUNIT: for.cond27:
; TUNIT-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
@@ -1339,10 +1278,10 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
; TUNIT: for.cond.cleanup29:
; TUNIT-NEXT: br label [[FOR_END37:%.*]]
; TUNIT: for.body30:
-; TUNIT-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
-; TUNIT-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
-; TUNIT-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
-; TUNIT-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]]
+; TUNIT-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 [[INDVARS_IV12]]
+; TUNIT-NEXT: [[I22:%.*]] = load i8, ptr [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]]
+; TUNIT-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 [[INDVARS_IV12]]
+; TUNIT-NEXT: store i8 [[I22]], ptr [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]]
; TUNIT-NEXT: br label [[FOR_INC35]]
; TUNIT: for.inc35:
; TUNIT-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
@@ -1352,7 +1291,7 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
;
; CGSCC: Function Attrs: nofree nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2
-; CGSCC-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR3]] {
+; CGSCC-SAME: (ptr nocapture nofree [[BYTES:%.*]]) #[[ATTR3]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: br label [[FOR_COND:%.*]]
; CGSCC: for.cond:
@@ -1363,8 +1302,8 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
; CGSCC-NEXT: br label [[FOR_END:%.*]]
; CGSCC: for.body:
; CGSCC-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10
-; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]]
-; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 [[I]]
+; CGSCC-NEXT: store i8 0, ptr [[ARRAYIDX]], align 1, !tbaa [[TBAA15]]
; CGSCC-NEXT: br label [[FOR_INC]]
; CGSCC: for.inc:
; CGSCC-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
@@ -1378,11 +1317,10 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
; CGSCC: for.cond.cleanup4:
; CGSCC-NEXT: br label [[FOR_END11:%.*]]
; CGSCC: for.body5:
-; CGSCC-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float*
; CGSCC-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10
; CGSCC-NEXT: [[I17:%.*]] = or i64 [[I16]], 1
-; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]]
-; CGSCC-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
+; CGSCC-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, ptr [[BYTES]], i64 [[I17]]
+; CGSCC-NEXT: store float 0.000000e+00, ptr [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]]
; CGSCC-NEXT: br label [[FOR_INC9]]
; CGSCC: for.inc9:
; CGSCC-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1
@@ -1396,21 +1334,19 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
; CGSCC: for.cond.cleanup15:
; CGSCC-NEXT: br label [[FOR_END23:%.*]]
; CGSCC: for.body16:
-; CGSCC-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64*
; CGSCC-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10
; CGSCC-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2
-; CGSCC-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]]
-; CGSCC-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]]
+; CGSCC-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, ptr [[BYTES]], i64 [[I20]]
+; CGSCC-NEXT: store i64 0, ptr [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]]
; CGSCC-NEXT: br label [[FOR_INC21]]
; CGSCC: for.inc21:
; CGSCC-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1
; CGSCC-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]]
; CGSCC: for.end23:
-; CGSCC-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023
-; CGSCC-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]]
-; CGSCC-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500
-; CGSCC-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32*
-; CGSCC-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR20]]
+; CGSCC-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 1023
+; CGSCC-NEXT: store i8 0, ptr [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 500
+; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARRAYIDX25]], i32 noundef 0) #[[ATTR20]]
; CGSCC-NEXT: br label [[FOR_COND27:%.*]]
; CGSCC: for.cond27:
; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ]
@@ -1419,10 +1355,10 @@ define void @noalias_arg_simplifiable_2(i8* %Bytes) {
; CGSCC: for.cond.cleanup29:
; CGSCC-NEXT: br label [[FOR_END37:%.*]]
; CGSCC: for.body30:
-; CGSCC-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]]
-; CGSCC-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
-; CGSCC-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]]
-; CGSCC-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 [[INDVARS_IV12]]
+; CGSCC-NEXT: [[I22:%.*]] = load i8, ptr [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]]
+; CGSCC-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 [[INDVARS_IV12]]
+; CGSCC-NEXT: store i8 [[I22]], ptr [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]]
; CGSCC-NEXT: br label [[FOR_INC35]]
; CGSCC: for.inc35:
; CGSCC-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1
@@ -1443,8 +1379,8 @@ for.cond.cleanup: ; preds = %for.cond
for.body: ; preds = %for.cond
%i = mul nuw nsw i64 %indvars.iv, 10
- %arrayidx = getelementptr inbounds i8, i8* %Bytes, i64 %i
- store i8 0, i8* %arrayidx, align 1, !tbaa !15
+ %arrayidx = getelementptr inbounds i8, ptr %Bytes, i64 %i
+ store i8 0, ptr %arrayidx, align 1, !tbaa !15
br label %for.inc
for.inc: ; preds = %for.body
@@ -1463,11 +1399,10 @@ for.cond.cleanup4: ; preds = %for.cond2
br label %for.end11
for.body5: ; preds = %for.cond2
- %i15 = bitcast i8* %Bytes to float*
%i16 = mul nuw nsw i64 %indvars.iv2, 10
%i17 = or i64 %i16, 1
- %arrayidx8 = getelementptr inbounds float, float* %i15, i64 %i17
- store float 0.000000e+00, float* %arrayidx8, align 4, !tbaa !18
+ %arrayidx8 = getelementptr inbounds float, ptr %Bytes, i64 %i17
+ store float 0.000000e+00, ptr %arrayidx8, align 4, !tbaa !18
br label %for.inc9
for.inc9: ; preds = %for.body5
@@ -1486,11 +1421,10 @@ for.cond.cleanup15: ; preds = %for.cond13
br label %for.end23
for.body16: ; preds = %for.cond13
- %i18 = bitcast i8* %Bytes to i64*
%i19 = mul nuw nsw i64 %indvars.iv7, 10
%i20 = add nuw nsw i64 %i19, 2
- %arrayidx20 = getelementptr inbounds i64, i64* %i18, i64 %i20
- store i64 0, i64* %arrayidx20, align 8, !tbaa !20
+ %arrayidx20 = getelementptr inbounds i64, ptr %Bytes, i64 %i20
+ store i64 0, ptr %arrayidx20, align 8, !tbaa !20
br label %for.inc21
for.inc21: ; preds = %for.body16
@@ -1498,11 +1432,10 @@ for.inc21: ; preds = %for.body16
br label %for.cond13, !llvm.loop !30
for.end23: ; preds = %for.cond.cleanup15
- %arrayidx24 = getelementptr inbounds i8, i8* %Bytes, i64 1023
- store i8 0, i8* %arrayidx24, align 1, !tbaa !15
- %arrayidx25 = getelementptr inbounds i8, i8* %Bytes, i64 500
- %i21 = bitcast i8* %arrayidx25 to i32*
- call void @write_arg(i32* nonnull %i21, i32 0)
+ %arrayidx24 = getelementptr inbounds i8, ptr %Bytes, i64 1023
+ store i8 0, ptr %arrayidx24, align 1, !tbaa !15
+ %arrayidx25 = getelementptr inbounds i8, ptr %Bytes, i64 500
+ call void @write_arg(ptr nonnull %arrayidx25, i32 0)
br label %for.cond27
for.cond27: ; preds = %for.inc35, %for.end23
@@ -1514,10 +1447,10 @@ for.cond.cleanup29: ; preds = %for.cond27
br label %for.end37
for.body30: ; preds = %for.cond27
- %arrayidx32 = getelementptr inbounds i8, i8* %Bytes, i64 %indvars.iv12
- %i22 = load i8, i8* %arrayidx32, align 1, !tbaa !15
- %arrayidx34 = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 %indvars.iv12
- store i8 %i22, i8* %arrayidx34, align 1, !tbaa !15
+ %arrayidx32 = getelementptr inbounds i8, ptr %Bytes, i64 %indvars.iv12
+ %i22 = load i8, ptr %arrayidx32, align 1, !tbaa !15
+ %arrayidx34 = getelementptr inbounds [1024 x i8], ptr @globalBytes, i64 0, i64 %indvars.iv12
+ store i8 %i22, ptr %arrayidx34, align 1, !tbaa !15
br label %for.inc35
for.inc35: ; preds = %for.body30
@@ -1542,74 +1475,59 @@ define i32 @local_alloca_not_simplifiable_1() {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[X:%.*]] = alloca i32, align 4
; TUNIT-NEXT: [[Y:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR16]]
-; TUNIT-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR16]]
-; TUNIT-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
-; TUNIT-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
-; TUNIT-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8*
-; TUNIT-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
-; TUNIT-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
-; TUNIT-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[X]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[Y]]) #[[ATTR16]]
+; TUNIT-NEXT: store i32 1, ptr [[Y]], align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: store i32 1, ptr [[X]], align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: call void @escape(ptr noundef nonnull align 4 dereferenceable(4) [[X]])
+; TUNIT-NEXT: call void @write_random(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
+; TUNIT-NEXT: [[I3:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA3]]
; TUNIT-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
; TUNIT-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
-; TUNIT-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: [[I4:%.*]] = load i32, ptr [[Y]], align 4, !tbaa [[TBAA3]]
; TUNIT-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
; TUNIT-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
-; TUNIT-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
-; TUNIT-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
+; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[Y]])
+; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[X]])
; TUNIT-NEXT: ret i32 [[ADD1]]
;
; CGSCC-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[X:%.*]] = alloca i32, align 4
; CGSCC-NEXT: [[Y:%.*]] = alloca i32, align 4
-; CGSCC-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR19]]
-; CGSCC-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR19]]
-; CGSCC-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]]
-; CGSCC-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]]
-; CGSCC-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8*
-; CGSCC-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]])
-; CGSCC-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
-; CGSCC-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[X]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[Y]]) #[[ATTR19]]
+; CGSCC-NEXT: store i32 1, ptr [[Y]], align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: store i32 1, ptr [[X]], align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: call void @escape(ptr noundef nonnull align 4 dereferenceable(4) [[X]])
+; CGSCC-NEXT: call void @write_random(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]])
+; CGSCC-NEXT: [[I3:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA3]]
; CGSCC-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0
; CGSCC-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1
-; CGSCC-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: [[I4:%.*]] = load i32, ptr [[Y]], align 4, !tbaa [[TBAA3]]
; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]]
; CGSCC-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]]
-; CGSCC-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]])
-; CGSCC-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]])
+; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[Y]])
+; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[X]])
; CGSCC-NEXT: ret i32 [[ADD1]]
;
entry:
%X = alloca i32, align 4
%Y = alloca i32, align 4
- %i = bitcast i32* %X to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i)
- %i1 = bitcast i32* %Y to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %i1)
- store i32 1, i32* %Y, align 4, !tbaa !3
- store i32 1, i32* %X, align 4, !tbaa !3
- %i2 = bitcast i32* %X to i8*
- call void @escape(i8* nonnull %i2)
- call void @write_random(i32* nonnull %Y)
- %i3 = load i32, i32* %X, align 4, !tbaa !3
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X)
+ call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Y)
+ store i32 1, ptr %Y, align 4, !tbaa !3
+ store i32 1, ptr %X, align 4, !tbaa !3
+ call void @escape(ptr nonnull %X)
+ call void @write_random(ptr nonnull %Y)
+ %i3 = load i32, ptr %X, align 4, !tbaa !3
%tobool.not = icmp eq i32 %i3, 0
%cond = select i1 %tobool.not, i32 2, i32 1
- %i4 = load i32, i32* %Y, align 4, !tbaa !3
+ %i4 = load i32, ptr %Y, align 4, !tbaa !3
%add = add nsw i32 %i3, %i4
%add1 = add nsw i32 %add, %cond
- %i5 = bitcast i32* %Y to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i5)
- %i6 = bitcast i32* %X to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %i6)
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y)
+ call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X)
ret i32 %add1
}
@@ -1619,19 +1537,18 @@ define i8 @local_alloca_not_simplifiable_2(i64 %index1, i64 %index2, i1 %cnd) {
; TUNIT-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR3]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
-; TUNIT-NEXT: [[GEP0:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
-; TUNIT-NEXT: store i8 7, i8* [[GEP0]], align 16
+; TUNIT-NEXT: store i8 7, ptr [[BYTES]], align 16
; TUNIT-NEXT: br i1 [[CND]], label [[LEFT:%.*]], label [[RIGHT:%.*]]
; TUNIT: left:
-; TUNIT-NEXT: [[GEP1:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDEX1]]
+; TUNIT-NEXT: [[GEP1:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[INDEX1]]
; TUNIT-NEXT: br label [[JOIN:%.*]]
; TUNIT: right:
-; TUNIT-NEXT: [[GEP2:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDEX2]]
+; TUNIT-NEXT: [[GEP2:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[INDEX2]]
; TUNIT-NEXT: br label [[JOIN]]
; TUNIT: join:
-; TUNIT-NEXT: [[GEP_JOIN:%.*]] = phi i8* [ [[GEP1]], [[LEFT]] ], [ [[GEP2]], [[RIGHT]] ]
-; TUNIT-NEXT: store i8 9, i8* [[GEP_JOIN]], align 4
-; TUNIT-NEXT: [[I:%.*]] = load i8, i8* [[GEP0]], align 16
+; TUNIT-NEXT: [[GEP_JOIN:%.*]] = phi ptr [ [[GEP1]], [[LEFT]] ], [ [[GEP2]], [[RIGHT]] ]
+; TUNIT-NEXT: store i8 9, ptr [[GEP_JOIN]], align 4
+; TUNIT-NEXT: [[I:%.*]] = load i8, ptr [[BYTES]], align 16
; TUNIT-NEXT: ret i8 [[I]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn
@@ -1639,42 +1556,40 @@ define i8 @local_alloca_not_simplifiable_2(i64 %index1, i64 %index2, i1 %cnd) {
; CGSCC-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR5]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
-; CGSCC-NEXT: [[GEP0:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0
-; CGSCC-NEXT: store i8 7, i8* [[GEP0]], align 16
+; CGSCC-NEXT: store i8 7, ptr [[BYTES]], align 16
; CGSCC-NEXT: br i1 [[CND]], label [[LEFT:%.*]], label [[RIGHT:%.*]]
; CGSCC: left:
-; CGSCC-NEXT: [[GEP1:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDEX1]]
+; CGSCC-NEXT: [[GEP1:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[INDEX1]]
; CGSCC-NEXT: br label [[JOIN:%.*]]
; CGSCC: right:
-; CGSCC-NEXT: [[GEP2:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDEX2]]
+; CGSCC-NEXT: [[GEP2:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[INDEX2]]
; CGSCC-NEXT: br label [[JOIN]]
; CGSCC: join:
-; CGSCC-NEXT: [[GEP_JOIN:%.*]] = phi i8* [ [[GEP1]], [[LEFT]] ], [ [[GEP2]], [[RIGHT]] ]
-; CGSCC-NEXT: store i8 9, i8* [[GEP_JOIN]], align 4
-; CGSCC-NEXT: [[I:%.*]] = load i8, i8* [[GEP0]], align 16
+; CGSCC-NEXT: [[GEP_JOIN:%.*]] = phi ptr [ [[GEP1]], [[LEFT]] ], [ [[GEP2]], [[RIGHT]] ]
+; CGSCC-NEXT: store i8 9, ptr [[GEP_JOIN]], align 4
+; CGSCC-NEXT: [[I:%.*]] = load i8, ptr [[BYTES]], align 16
; CGSCC-NEXT: ret i8 [[I]]
;
entry:
%Bytes = alloca [1024 x i8], align 16
- %gep0 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 0
- store i8 7, i8* %gep0, align 4
+ store i8 7, ptr %Bytes, align 4
br i1 %cnd, label %left, label %right
left: ; preds = %entry
- %gep1 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %index1
+ %gep1 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 %index1
br label %join
right: ; preds = %entry
- %gep2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %index2
+ %gep2 = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 %index2
br label %join
join: ; preds = %right, %left
- %gep.join = phi i8* [ %gep1, %left ], [ %gep2, %right ]
- store i8 9, i8* %gep.join, align 4
+ %gep.join = phi ptr [ %gep1, %left ], [ %gep2, %right ]
+ store i8 9, ptr %gep.join, align 4
; This load cannot be replaced by the value 7 from %entry, since the previous
; store interferes due to its unknown offset.
- %i = load i8, i8* %gep0, align 4
+ %i = load i8, ptr %Bytes, align 4
ret i8 %i
}
@@ -1685,32 +1600,30 @@ define i32 @unknown_access_mixed_simplifiable(i32 %arg1, i32 %arg2) {
; CHECK-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR4]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
-; CHECK-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
-; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
-; CHECK-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
-; CHECK-NEXT: store i32 7, i32* [[GEP1]], align 4
-; CHECK-NEXT: store i32 7, i32* [[GEP2]], align 4
-; CHECK-NEXT: store i32 7, i32* [[GEP3]], align 4
-; CHECK-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
-; CHECK-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
-; CHECK-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
+; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG1]]
+; CHECK-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG2]]
+; CHECK-NEXT: store i32 7, ptr [[GEP1]], align 4
+; CHECK-NEXT: store i32 7, ptr [[GEP2]], align 4
+; CHECK-NEXT: store i32 7, ptr [[GEP3]], align 4
+; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[GEP1]], align 4
+; CHECK-NEXT: [[L2:%.*]] = load i32, ptr [[GEP2]], align 4
+; CHECK-NEXT: [[L3:%.*]] = load i32, ptr [[GEP3]], align 4
; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
; CHECK-NEXT: ret i32 [[ADD2]]
;
entry:
%s = alloca %struct.S, align 4
- %bc = bitcast %struct.S* %s to i32*
- %gep1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
- %gep2 = getelementptr inbounds i32, i32* %bc, i32 %arg1
- %gep3 = getelementptr inbounds i32, i32* %bc, i32 %arg2
- store i32 7, i32* %gep1
- store i32 7, i32* %gep2
- store i32 7, i32* %gep3
- %l1 = load i32, i32* %gep1
- %l2 = load i32, i32* %gep2
- %l3 = load i32, i32* %gep3
+ %gep1 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 2
+ %gep2 = getelementptr inbounds i32, ptr %s, i32 %arg1
+ %gep3 = getelementptr inbounds i32, ptr %s, i32 %arg2
+ store i32 7, ptr %gep1
+ store i32 7, ptr %gep2
+ store i32 7, ptr %gep3
+ %l1 = load i32, ptr %gep1
+ %l2 = load i32, ptr %gep2
+ %l3 = load i32, ptr %gep3
%add1 = add i32 %l1, %l2
%add2 = add i32 %add1, %l3
ret i32 %add2
@@ -1723,21 +1636,18 @@ define i32 @unknown_access_mixed_not_simplifiable(i32 %arg1, i32 %arg2, i32 %arg
; CHECK-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR4]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4
-; CHECK-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32*
-; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2
-; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG1]]
-; CHECK-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, i32* [[BC]], i32 [[ARG2]]
-; CHECK-NEXT: [[BC4A:%.*]] = bitcast %struct.S* [[S]] to i8*
-; CHECK-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, i8* [[BC4A]], i32 [[ARG3]]
-; CHECK-NEXT: [[BC4B:%.*]] = bitcast i8* [[GEP4]] to i32*
-; CHECK-NEXT: store i32 7, i32* [[GEP1]], align 4
-; CHECK-NEXT: store i32 7, i32* [[GEP2]], align 4
-; CHECK-NEXT: store i32 7, i32* [[GEP3]], align 4
-; CHECK-NEXT: store i32 7, i32* [[BC4B]], align 4
-; CHECK-NEXT: [[L1:%.*]] = load i32, i32* [[GEP1]], align 4
-; CHECK-NEXT: [[L2:%.*]] = load i32, i32* [[GEP2]], align 4
-; CHECK-NEXT: [[L3:%.*]] = load i32, i32* [[GEP3]], align 4
-; CHECK-NEXT: [[L4:%.*]] = load i32, i32* [[BC4B]], align 4
+; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2
+; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG1]]
+; CHECK-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG2]]
+; CHECK-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, ptr [[S]], i32 [[ARG3]]
+; CHECK-NEXT: store i32 7, ptr [[GEP1]], align 4
+; CHECK-NEXT: store i32 7, ptr [[GEP2]], align 4
+; CHECK-NEXT: store i32 7, ptr [[GEP3]], align 4
+; CHECK-NEXT: store i32 7, ptr [[GEP4]], align 4
+; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[GEP1]], align 4
+; CHECK-NEXT: [[L2:%.*]] = load i32, ptr [[GEP2]], align 4
+; CHECK-NEXT: [[L3:%.*]] = load i32, ptr [[GEP3]], align 4
+; CHECK-NEXT: [[L4:%.*]] = load i32, ptr [[GEP4]], align 4
; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]]
; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]]
; CHECK-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]]
@@ -1745,28 +1655,25 @@ define i32 @unknown_access_mixed_not_simplifiable(i32 %arg1, i32 %arg2, i32 %arg
;
entry:
%s = alloca %struct.S, align 4
- %bc = bitcast %struct.S* %s to i32*
- %gep1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 2
- %gep2 = getelementptr inbounds i32, i32* %bc, i32 %arg1
- %gep3 = getelementptr inbounds i32, i32* %bc, i32 %arg2
- %bc4a = bitcast %struct.S* %s to i8*
- %gep4 = getelementptr inbounds i8, i8* %bc4a, i32 %arg3
- %bc4b = bitcast i8* %gep4 to i32*
- store i32 7, i32* %gep1
- store i32 7, i32* %gep2
- store i32 7, i32* %gep3
- store i32 7, i32* %bc4b
- %l1 = load i32, i32* %gep1
- %l2 = load i32, i32* %gep2
- %l3 = load i32, i32* %gep3
- %l4 = load i32, i32* %bc4b
+ %gep1 = getelementptr inbounds %struct.S, ptr %s, i64 0, i32 2
+ %gep2 = getelementptr inbounds i32, ptr %s, i32 %arg1
+ %gep3 = getelementptr inbounds i32, ptr %s, i32 %arg2
+ %gep4 = getelementptr inbounds i8, ptr %s, i32 %arg3
+ store i32 7, ptr %gep1
+ store i32 7, ptr %gep2
+ store i32 7, ptr %gep3
+ store i32 7, ptr %gep4
+ %l1 = load i32, ptr %gep1
+ %l2 = load i32, ptr %gep2
+ %l3 = load i32, ptr %gep3
+ %l4 = load i32, ptr %gep4
%add1 = add i32 %l1, %l2
%add2 = add i32 %add1, %l3
%add3 = add i32 %add2, %l4
ret i32 %add3
}
-declare void @escape(i8*)
+declare void @escape(ptr)
; int Flag0 = 0;
; int global_not_simplifiable_1(int cnd) {
@@ -1778,18 +1685,18 @@ define i32 @global_not_simplifiable_1(i32 %cnd) {
; TUNIT-LABEL: define {{[^@]+}}@global_not_simplifiable_1
; TUNIT-SAME: (i32 [[CND:%.*]]) #[[ATTR6:[0-9]+]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: [[I:%.*]] = load i32, ptr @Flag0, align 4, !tbaa [[TBAA3]]
; TUNIT-NEXT: ret i32 [[I]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(read)
; CGSCC-LABEL: define {{[^@]+}}@global_not_simplifiable_1
; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: [[I:%.*]] = load i32, ptr @Flag0, align 4, !tbaa [[TBAA3]]
; CGSCC-NEXT: ret i32 [[I]]
;
entry:
- %i = load i32, i32* @Flag0, align 4, !tbaa !3
+ %i = load i32, ptr @Flag0, align 4, !tbaa !3
ret i32 %i
}
@@ -1815,13 +1722,13 @@ define i32 @static_global_not_simplifiable_1(i32 %cnd) {
; CHECK-NEXT: ret i32 1
;
entry:
- %i = load i32, i32* @Flag1, align 4, !tbaa !3
+ %i = load i32, ptr @Flag1, align 4, !tbaa !3
call void @sync()
%tobool.not = icmp eq i32 %cnd, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %entry
- store i32 1, i32* @Flag1, align 4, !tbaa !3
+ store i32 1, ptr @Flag1, align 4, !tbaa !3
br label %if.end
if.end: ; preds = %if.then, %entry
@@ -1842,17 +1749,17 @@ define i32 @static_global_simplifiable_4(i32 %cnd) {
; CHECK-LABEL: define {{[^@]+}}@static_global_simplifiable_4
; CHECK-SAME: (i32 [[CND:%.*]]) {
; CHECK-NEXT: entry:
-; CHECK-NEXT: store i32 1, i32* @Flag2, align 4, !tbaa [[TBAA3]]
+; CHECK-NEXT: store i32 1, ptr @Flag2, align 4, !tbaa [[TBAA3]]
; CHECK-NEXT: call void @sync()
-; CHECK-NEXT: [[I:%.*]] = load i32, i32* @Flag2, align 4, !tbaa [[TBAA3]]
-; CHECK-NEXT: store i32 2, i32* @Flag2, align 4, !tbaa [[TBAA3]]
+; CHECK-NEXT: [[I:%.*]] = load i32, ptr @Flag2, align 4, !tbaa [[TBAA3]]
+; CHECK-NEXT: store i32 2, ptr @Flag2, align 4, !tbaa [[TBAA3]]
; CHECK-NEXT: ret i32 [[I]]
;
entry:
- store i32 1, i32* @Flag2, align 4, !tbaa !3
+ store i32 1, ptr @Flag2, align 4, !tbaa !3
call void @sync()
- %i = load i32, i32* @Flag2, align 4, !tbaa !3
- store i32 2, i32* @Flag2, align 4, !tbaa !3
+ %i = load i32, ptr @Flag2, align 4, !tbaa !3
+ store i32 2, ptr @Flag2, align 4, !tbaa !3
ret i32 %i
}
@@ -1868,66 +1775,66 @@ define i32 @static_global_not_simplifiable_2(i32 %cnd) {
; TUNIT-LABEL: define {{[^@]+}}@static_global_not_simplifiable_2
; TUNIT-SAME: (i32 [[CND:%.*]]) {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: store i32 1, i32* @Flag4, align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: store i32 1, ptr @Flag4, align 4, !tbaa [[TBAA3]]
; TUNIT-NEXT: call void @sync() #[[ATTR18:[0-9]+]]
-; TUNIT-NEXT: [[I:%.*]] = load i32, i32* @Flag4, align 4, !tbaa [[TBAA3]]
-; TUNIT-NEXT: store i32 2, i32* @Flag4, align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: [[I:%.*]] = load i32, ptr @Flag4, align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: store i32 2, ptr @Flag4, align 4, !tbaa [[TBAA3]]
; TUNIT-NEXT: ret i32 [[I]]
;
; CGSCC-LABEL: define {{[^@]+}}@static_global_not_simplifiable_2
; CGSCC-SAME: (i32 [[CND:%.*]]) {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: store i32 1, i32* @Flag4, align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: store i32 1, ptr @Flag4, align 4, !tbaa [[TBAA3]]
; CGSCC-NEXT: call void @sync() #[[ATTR21:[0-9]+]]
-; CGSCC-NEXT: [[I:%.*]] = load i32, i32* @Flag4, align 4, !tbaa [[TBAA3]]
-; CGSCC-NEXT: store i32 2, i32* @Flag4, align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: [[I:%.*]] = load i32, ptr @Flag4, align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: store i32 2, ptr @Flag4, align 4, !tbaa [[TBAA3]]
; CGSCC-NEXT: ret i32 [[I]]
;
entry:
- store i32 1, i32* @Flag4, align 4, !tbaa !3
+ store i32 1, ptr @Flag4, align 4, !tbaa !3
call void @sync() nocallback
- %i = load i32, i32* @Flag4, align 4, !tbaa !3
- store i32 2, i32* @Flag4, align 4, !tbaa !3
+ %i = load i32, ptr @Flag4, align 4, !tbaa !3
+ store i32 2, ptr @Flag4, align 4, !tbaa !3
ret i32 %i
}
define void @static_global_not_simplifiable_2_helper() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@static_global_not_simplifiable_2_helper
; TUNIT-SAME: () #[[ATTR5]] {
-; TUNIT-NEXT: store i32 2, i32* @Flag4, align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: store i32 2, ptr @Flag4, align 4, !tbaa [[TBAA3]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@static_global_not_simplifiable_2_helper
; CGSCC-SAME: () #[[ATTR6]] {
-; CGSCC-NEXT: store i32 2, i32* @Flag4, align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: store i32 2, ptr @Flag4, align 4, !tbaa [[TBAA3]]
; CGSCC-NEXT: ret void
;
- store i32 2, i32* @Flag4, align 4, !tbaa !3
+ store i32 2, ptr @Flag4, align 4, !tbaa !3
ret void
}
; Similiar to static_global_simplifiable_3 but with a may-store.
-define i32 @static_global_not_simplifiable_3(i1 %c, i32* %p) {
+define i32 @static_global_not_simplifiable_3(i1 %c, ptr %p) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn
; TUNIT-LABEL: define {{[^@]+}}@static_global_not_simplifiable_3
-; TUNIT-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] {
-; TUNIT-NEXT: [[SEL:%.*]] = select i1 [[C]], i32* @Flag3, i32* [[P]]
-; TUNIT-NEXT: store i32 1, i32* [[SEL]], align 4, !tbaa [[TBAA3]]
-; TUNIT-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]]
+; TUNIT-SAME: (i1 [[C:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] {
+; TUNIT-NEXT: [[SEL:%.*]] = select i1 [[C]], ptr @Flag3, ptr [[P]]
+; TUNIT-NEXT: store i32 1, ptr [[SEL]], align 4, !tbaa [[TBAA3]]
+; TUNIT-NEXT: [[I:%.*]] = load i32, ptr @Flag3, align 4, !tbaa [[TBAA3]]
; TUNIT-NEXT: ret i32 [[I]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@static_global_not_simplifiable_3
-; CGSCC-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR5]] {
-; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[C]], i32* @Flag3, i32* [[P]]
-; CGSCC-NEXT: store i32 1, i32* [[SEL]], align 4, !tbaa [[TBAA3]]
-; CGSCC-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]]
+; CGSCC-SAME: (i1 [[C:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR5]] {
+; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[C]], ptr @Flag3, ptr [[P]]
+; CGSCC-NEXT: store i32 1, ptr [[SEL]], align 4, !tbaa [[TBAA3]]
+; CGSCC-NEXT: [[I:%.*]] = load i32, ptr @Flag3, align 4, !tbaa [[TBAA3]]
; CGSCC-NEXT: ret i32 [[I]]
;
- %sel = select i1 %c, i32* @Flag3, i32* %p
- store i32 1, i32* %sel, align 4, !tbaa !3
- %i = load i32, i32* @Flag3, align 4, !tbaa !3
+ %sel = select i1 %c, ptr @Flag3, ptr %p
+ store i32 1, ptr %sel, align 4, !tbaa !3
+ %i = load i32, ptr @Flag3, align 4, !tbaa !3
ret i32 %i
}
@@ -1948,51 +1855,51 @@ define i32 @write_read_global() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn
; TUNIT-LABEL: define {{[^@]+}}@write_read_global
; TUNIT-SAME: () #[[ATTR3]] {
-; TUNIT-NEXT: store i32 7, i32* @Gint1, align 4
-; TUNIT-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4
+; TUNIT-NEXT: store i32 7, ptr @Gint1, align 4
+; TUNIT-NEXT: [[L:%.*]] = load i32, ptr @Gint1, align 4
; TUNIT-NEXT: ret i32 [[L]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@write_read_global
; CGSCC-SAME: () #[[ATTR5]] {
-; CGSCC-NEXT: store i32 7, i32* @Gint1, align 4
-; CGSCC-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4
+; CGSCC-NEXT: store i32 7, ptr @Gint1, align 4
+; CGSCC-NEXT: [[L:%.*]] = load i32, ptr @Gint1, align 4
; CGSCC-NEXT: ret i32 [[L]]
;
- store i32 7, i32* @Gint1
- %l = load i32, i32* @Gint1
+ store i32 7, ptr @Gint1
+ %l = load i32, ptr @Gint1
ret i32 %l
}
define void @write_global() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@write_global
; TUNIT-SAME: () #[[ATTR5]] {
-; TUNIT-NEXT: store i32 7, i32* @Gint2, align 4
+; TUNIT-NEXT: store i32 7, ptr @Gint2, align 4
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@write_global
; CGSCC-SAME: () #[[ATTR6]] {
-; CGSCC-NEXT: store i32 7, i32* @Gint2, align 4
+; CGSCC-NEXT: store i32 7, ptr @Gint2, align 4
; CGSCC-NEXT: ret void
;
- store i32 7, i32* @Gint2
+ store i32 7, ptr @Gint2
ret void
}
define i32 @read_global() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(read)
; TUNIT-LABEL: define {{[^@]+}}@read_global
; TUNIT-SAME: () #[[ATTR6]] {
-; TUNIT-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4
+; TUNIT-NEXT: [[L:%.*]] = load i32, ptr @Gint2, align 4
; TUNIT-NEXT: ret i32 [[L]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(read)
; CGSCC-LABEL: define {{[^@]+}}@read_global
; CGSCC-SAME: () #[[ATTR7]] {
-; CGSCC-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4
+; CGSCC-NEXT: [[L:%.*]] = load i32, ptr @Gint2, align 4
; CGSCC-NEXT: ret i32 [[L]]
;
- %l = load i32, i32* @Gint2
+ %l = load i32, ptr @Gint2
ret i32 %l
}
define i32 @write_read_static_global() {
@@ -2006,40 +1913,40 @@ define i32 @write_read_static_global() {
; CGSCC-SAME: () #[[ATTR6]] {
; CGSCC-NEXT: ret i32 7
;
- store i32 7, i32* @Gstatic_int1
- %l = load i32, i32* @Gstatic_int1
+ store i32 7, ptr @Gstatic_int1
+ %l = load i32, ptr @Gstatic_int1
ret i32 %l
}
define void @write_static_global() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; TUNIT-LABEL: define {{[^@]+}}@write_static_global
; TUNIT-SAME: () #[[ATTR5]] {
-; TUNIT-NEXT: store i32 7, i32* @Gstatic_int2, align 4
+; TUNIT-NEXT: store i32 7, ptr @Gstatic_int2, align 4
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@write_static_global
; CGSCC-SAME: () #[[ATTR6]] {
-; CGSCC-NEXT: store i32 7, i32* @Gstatic_int2, align 4
+; CGSCC-NEXT: store i32 7, ptr @Gstatic_int2, align 4
; CGSCC-NEXT: ret void
;
- store i32 7, i32* @Gstatic_int2
+ store i32 7, ptr @Gstatic_int2
ret void
}
define i32 @read_static_global() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(read)
; TUNIT-LABEL: define {{[^@]+}}@read_static_global
; TUNIT-SAME: () #[[ATTR6]] {
-; TUNIT-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4
+; TUNIT-NEXT: [[L:%.*]] = load i32, ptr @Gstatic_int2, align 4
; TUNIT-NEXT: ret i32 [[L]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(read)
; CGSCC-LABEL: define {{[^@]+}}@read_static_global
; CGSCC-SAME: () #[[ATTR7]] {
-; CGSCC-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4
+; CGSCC-NEXT: [[L:%.*]] = load i32, ptr @Gstatic_int2, align 4
; CGSCC-NEXT: ret i32 [[L]]
;
- %l = load i32, i32* @Gstatic_int2
+ %l = load i32, ptr @Gstatic_int2
ret i32 %l
}
define i32 @write_read_static_undef_global() {
@@ -2053,8 +1960,8 @@ define i32 @write_read_static_undef_global() {
; CGSCC-SAME: () #[[ATTR6]] {
; CGSCC-NEXT: ret i32 7
;
- store i32 7, i32* @Gstatic_undef_int1
- %l = load i32, i32* @Gstatic_undef_int1
+ store i32 7, ptr @Gstatic_undef_int1
+ %l = load i32, ptr @Gstatic_undef_int1
ret i32 %l
}
define void @write_static_undef_global() {
@@ -2066,10 +1973,10 @@ define void @write_static_undef_global() {
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@write_static_undef_global
; CGSCC-SAME: () #[[ATTR6]] {
-; CGSCC-NEXT: store i32 7, i32* @Gstatic_undef_int2, align 4
+; CGSCC-NEXT: store i32 7, ptr @Gstatic_undef_int2, align 4
; CGSCC-NEXT: ret void
;
- store i32 7, i32* @Gstatic_undef_int2
+ store i32 7, ptr @Gstatic_undef_int2
ret void
}
define i32 @read_static_undef_global() {
@@ -2078,7 +1985,7 @@ define i32 @read_static_undef_global() {
; CHECK-SAME: () #[[ATTR4]] {
; CHECK-NEXT: ret i32 7
;
- %l = load i32, i32* @Gstatic_undef_int2
+ %l = load i32, ptr @Gstatic_undef_int2
ret i32 %l
}
@@ -2088,7 +1995,7 @@ define i32 @single_read_of_static_global() {
; CHECK-SAME: () #[[ATTR4]] {
; CHECK-NEXT: ret i32 0
;
- %l = load i32, i32* @Gstatic_int3
+ %l = load i32, ptr @Gstatic_int3
ret i32 %l
}
@@ -2098,36 +2005,34 @@ define i8 @phi_store() {
; CHECK-SAME: () #[[ATTR4]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A:%.*]] = alloca i16, align 2
-; CHECK-NEXT: [[B:%.*]] = bitcast i16* [[A]] to i8*
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: [[P:%.*]] = phi i8* [ [[B]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
+; CHECK-NEXT: [[P:%.*]] = phi ptr [ [[A]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
-; CHECK-NEXT: store i8 1, i8* [[P]], align 1
-; CHECK-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
+; CHECK-NEXT: store i8 1, ptr [[P]], align 1
+; CHECK-NEXT: [[G]] = getelementptr i8, ptr [[P]], i64 1
; CHECK-NEXT: [[O]] = add nsw i8 [[I]], 1
; CHECK-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2
; CHECK-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
; CHECK: end:
-; CHECK-NEXT: [[S:%.*]] = getelementptr i8, i8* [[B]], i64 1
-; CHECK-NEXT: [[L:%.*]] = load i8, i8* [[S]], align 1
+; CHECK-NEXT: [[S:%.*]] = getelementptr i8, ptr [[A]], i64 1
+; CHECK-NEXT: [[L:%.*]] = load i8, ptr [[S]], align 1
; CHECK-NEXT: ret i8 [[L]]
;
entry:
%a = alloca i16
- %b = bitcast i16* %a to i8*
br label %loop
loop:
- %p = phi i8* [%b, %entry], [%g, %loop]
+ %p = phi ptr [%a, %entry], [%g, %loop]
%i = phi i8 [0, %entry], [%o, %loop]
- store i8 1, i8* %p
- %g = getelementptr i8, i8* %p, i64 1
+ store i8 1, ptr %p
+ %g = getelementptr i8, ptr %p, i64 1
%o = add nsw i8 %i, 1
%c = icmp eq i8 %o, 2
br i1 %c, label %end, label %loop
end:
- %s = getelementptr i8, i8* %b, i64 1
- %l = load i8, i8* %s
+ %s = getelementptr i8, ptr %a, i64 1
+ %l = load i8, ptr %s
ret i8 %l
}
@@ -2140,16 +2045,18 @@ define i8 @phi_no_store_1() {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: br label [[LOOP:%.*]]
; TUNIT: loop:
-; TUNIT-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
+; TUNIT-NEXT: [[P:%.*]] = phi ptr [ @a1, [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
; TUNIT-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
-; TUNIT-NEXT: store i8 1, i8* [[P]], align 1
-; TUNIT-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
+; TUNIT-NEXT: store i8 1, ptr [[P]], align 1
+; TUNIT-NEXT: [[G]] = getelementptr i8, ptr [[P]], i64 1
; TUNIT-NEXT: [[O]] = add nsw i8 [[I]], 1
; TUNIT-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3
; TUNIT-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
; TUNIT: end:
-; TUNIT-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2
-; TUNIT-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1
+; TUNIT-NEXT: [[S11:%.*]] = getelementptr i8, ptr @a1, i64 2
+; TUNIT-NEXT: [[L11:%.*]] = load i8, ptr [[S11]], align 2
+; TUNIT-NEXT: [[S12:%.*]] = getelementptr i8, ptr @a1, i64 3
+; TUNIT-NEXT: [[L12:%.*]] = load i8, ptr [[S12]], align 1
; TUNIT-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]]
; TUNIT-NEXT: ret i8 [[ADD]]
;
@@ -2159,35 +2066,36 @@ define i8 @phi_no_store_1() {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: br label [[LOOP:%.*]]
; CGSCC: loop:
-; CGSCC-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a1 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
+; CGSCC-NEXT: [[P:%.*]] = phi ptr [ @a1, [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
; CGSCC-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
-; CGSCC-NEXT: store i8 1, i8* [[P]], align 1
-; CGSCC-NEXT: [[G]] = getelementptr i8, i8* [[P]], i64 1
+; CGSCC-NEXT: store i8 1, ptr [[P]], align 1
+; CGSCC-NEXT: [[G]] = getelementptr i8, ptr [[P]], i64 1
; CGSCC-NEXT: [[O]] = add nsw i8 [[I]], 1
; CGSCC-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 3
; CGSCC-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
; CGSCC: end:
-; CGSCC-NEXT: [[L11:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 2), align 2
-; CGSCC-NEXT: [[L12:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a1 to i8*), i64 3), align 1
+; CGSCC-NEXT: [[S11:%.*]] = getelementptr i8, ptr @a1, i64 2
+; CGSCC-NEXT: [[L11:%.*]] = load i8, ptr [[S11]], align 2
+; CGSCC-NEXT: [[S12:%.*]] = getelementptr i8, ptr @a1, i64 3
+; CGSCC-NEXT: [[L12:%.*]] = load i8, ptr [[S12]], align 1
; CGSCC-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]]
; CGSCC-NEXT: ret i8 [[ADD]]
;
entry:
- %b = bitcast i32* @a1 to i8*
br label %loop
loop:
- %p = phi i8* [%b, %entry], [%g, %loop]
+ %p = phi ptr [@a1, %entry], [%g, %loop]
%i = phi i8 [0, %entry], [%o, %loop]
- store i8 1, i8* %p
- %g = getelementptr i8, i8* %p, i64 1
+ store i8 1, ptr %p
+ %g = getelementptr i8, ptr %p, i64 1
%o = add nsw i8 %i, 1
%c = icmp eq i8 %o, 3
br i1 %c, label %end, label %loop
end:
- %s11 = getelementptr i8, i8* %b, i64 2
- %l11 = load i8, i8* %s11
- %s12 = getelementptr i8, i8* %b, i64 3
- %l12 = load i8, i8* %s12
+ %s11 = getelementptr i8, ptr @a1, i64 2
+ %l11 = load i8, ptr %s11
+ %s12 = getelementptr i8, ptr @a1, i64 3
+ %l12 = load i8, ptr %s12
%add = add i8 %l11, %l12
ret i8 %add
}
@@ -2201,16 +2109,18 @@ define i8 @phi_no_store_2() {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: br label [[LOOP:%.*]]
; TUNIT: loop:
-; TUNIT-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
+; TUNIT-NEXT: [[P:%.*]] = phi ptr [ @a2, [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
; TUNIT-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
-; TUNIT-NEXT: store i8 1, i8* [[P]], align 2
-; TUNIT-NEXT: [[G]] = getelementptr i8, i8* bitcast (i32* @a2 to i8*), i64 2
+; TUNIT-NEXT: store i8 1, ptr [[P]], align 2
+; TUNIT-NEXT: [[G]] = getelementptr i8, ptr @a2, i64 2
; TUNIT-NEXT: [[O]] = add nsw i8 [[I]], 1
; TUNIT-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
; TUNIT-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
; TUNIT: end:
-; TUNIT-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2
-; TUNIT-NEXT: [[L22:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 3), align 1
+; TUNIT-NEXT: [[S21:%.*]] = getelementptr i8, ptr @a2, i64 2
+; TUNIT-NEXT: [[L21:%.*]] = load i8, ptr [[S21]], align 2
+; TUNIT-NEXT: [[S22:%.*]] = getelementptr i8, ptr @a2, i64 3
+; TUNIT-NEXT: [[L22:%.*]] = load i8, ptr [[S22]], align 1
; TUNIT-NEXT: [[ADD:%.*]] = add i8 [[L21]], [[L22]]
; TUNIT-NEXT: ret i8 [[ADD]]
;
@@ -2220,35 +2130,36 @@ define i8 @phi_no_store_2() {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: br label [[LOOP:%.*]]
; CGSCC: loop:
-; CGSCC-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a2 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
+; CGSCC-NEXT: [[P:%.*]] = phi ptr [ @a2, [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
; CGSCC-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
-; CGSCC-NEXT: store i8 1, i8* [[P]], align 2
-; CGSCC-NEXT: [[G]] = getelementptr i8, i8* bitcast (i32* @a2 to i8*), i64 2
+; CGSCC-NEXT: store i8 1, ptr [[P]], align 2
+; CGSCC-NEXT: [[G]] = getelementptr i8, ptr @a2, i64 2
; CGSCC-NEXT: [[O]] = add nsw i8 [[I]], 1
; CGSCC-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
; CGSCC-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
; CGSCC: end:
-; CGSCC-NEXT: [[L21:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 2), align 2
-; CGSCC-NEXT: [[L22:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a2 to i8*), i64 3), align 1
+; CGSCC-NEXT: [[S21:%.*]] = getelementptr i8, ptr @a2, i64 2
+; CGSCC-NEXT: [[L21:%.*]] = load i8, ptr [[S21]], align 2
+; CGSCC-NEXT: [[S22:%.*]] = getelementptr i8, ptr @a2, i64 3
+; CGSCC-NEXT: [[L22:%.*]] = load i8, ptr [[S22]], align 1
; CGSCC-NEXT: [[ADD:%.*]] = add i8 [[L21]], [[L22]]
; CGSCC-NEXT: ret i8 [[ADD]]
;
entry:
- %b = bitcast i32* @a2 to i8*
br label %loop
loop:
- %p = phi i8* [%b, %entry], [%g, %loop]
+ %p = phi ptr [@a2, %entry], [%g, %loop]
%i = phi i8 [0, %entry], [%o, %loop]
- store i8 1, i8* %p
- %g = getelementptr i8, i8* %b, i64 2
+ store i8 1, ptr %p
+ %g = getelementptr i8, ptr @a2, i64 2
%o = add nsw i8 %i, 1
%c = icmp eq i8 %o, 7
br i1 %c, label %end, label %loop
end:
- %s21 = getelementptr i8, i8* %b, i64 2
- %l21 = load i8, i8* %s21
- %s22 = getelementptr i8, i8* %b, i64 3
- %l22 = load i8, i8* %s22
+ %s21 = getelementptr i8, ptr @a2, i64 2
+ %l21 = load i8, ptr %s21
+ %s22 = getelementptr i8, ptr @a2, i64 3
+ %l22 = load i8, ptr %s22
%add = add i8 %l21, %l22
ret i8 %add
}
@@ -2258,21 +2169,25 @@ define i8 @phi_no_store_3() {
; TUNIT-LABEL: define {{[^@]+}}@phi_no_store_3
; TUNIT-SAME: () #[[ATTR3]] {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: store i8 0, i8* getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 3), align 1
+; TUNIT-NEXT: [[S30:%.*]] = getelementptr i8, ptr @a3, i64 3
+; TUNIT-NEXT: store i8 0, ptr [[S30]], align 1
; TUNIT-NEXT: br label [[LOOP:%.*]]
; TUNIT: loop:
-; TUNIT-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
+; TUNIT-NEXT: [[P:%.*]] = phi ptr [ @a3, [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
; TUNIT-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
-; TUNIT-NEXT: store i8 1, i8* [[P]], align 2
-; TUNIT-NEXT: [[G]] = getelementptr i8, i8* bitcast (i32* @a3 to i8*), i64 2
+; TUNIT-NEXT: store i8 1, ptr [[P]], align 2
+; TUNIT-NEXT: [[G]] = getelementptr i8, ptr @a3, i64 2
; TUNIT-NEXT: [[O]] = add nsw i8 [[I]], 1
; TUNIT-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
; TUNIT-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
; TUNIT: end:
-; TUNIT-NEXT: [[L31:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), align 2
-; TUNIT-NEXT: [[L32:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 3), align 1
+; TUNIT-NEXT: [[S31:%.*]] = getelementptr i8, ptr @a3, i64 2
+; TUNIT-NEXT: [[L31:%.*]] = load i8, ptr [[S31]], align 2
+; TUNIT-NEXT: [[S32:%.*]] = getelementptr i8, ptr @a3, i64 3
+; TUNIT-NEXT: [[L32:%.*]] = load i8, ptr [[S32]], align 1
; TUNIT-NEXT: [[ADD:%.*]] = add i8 [[L31]], [[L32]]
-; TUNIT-NEXT: [[L34:%.*]] = load i8, i8* bitcast (i32* getelementptr inbounds (i32, i32* @a3, i64 1) to i8*), align 4
+; TUNIT-NEXT: [[S34:%.*]] = getelementptr i8, ptr @a3, i64 4
+; TUNIT-NEXT: [[L34:%.*]] = load i8, ptr [[S34]], align 4
; TUNIT-NEXT: [[ADD2:%.*]] = add i8 [[ADD]], [[L34]]
; TUNIT-NEXT: ret i8 [[ADD2]]
;
@@ -2280,45 +2195,48 @@ define i8 @phi_no_store_3() {
; CGSCC-LABEL: define {{[^@]+}}@phi_no_store_3
; CGSCC-SAME: () #[[ATTR5]] {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: store i8 0, i8* getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 3), align 1
+; CGSCC-NEXT: [[S30:%.*]] = getelementptr i8, ptr @a3, i64 3
+; CGSCC-NEXT: store i8 0, ptr [[S30]], align 1
; CGSCC-NEXT: br label [[LOOP:%.*]]
; CGSCC: loop:
-; CGSCC-NEXT: [[P:%.*]] = phi i8* [ bitcast (i32* @a3 to i8*), [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
+; CGSCC-NEXT: [[P:%.*]] = phi ptr [ @a3, [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ]
; CGSCC-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ]
-; CGSCC-NEXT: store i8 1, i8* [[P]], align 2
-; CGSCC-NEXT: [[G]] = getelementptr i8, i8* bitcast (i32* @a3 to i8*), i64 2
+; CGSCC-NEXT: store i8 1, ptr [[P]], align 2
+; CGSCC-NEXT: [[G]] = getelementptr i8, ptr @a3, i64 2
; CGSCC-NEXT: [[O]] = add nsw i8 [[I]], 1
; CGSCC-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 7
; CGSCC-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]]
; CGSCC: end:
-; CGSCC-NEXT: [[L31:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 2), align 2
-; CGSCC-NEXT: [[L32:%.*]] = load i8, i8* getelementptr (i8, i8* bitcast (i32* @a3 to i8*), i64 3), align 1
+; CGSCC-NEXT: [[S31:%.*]] = getelementptr i8, ptr @a3, i64 2
+; CGSCC-NEXT: [[L31:%.*]] = load i8, ptr [[S31]], align 2
+; CGSCC-NEXT: [[S32:%.*]] = getelementptr i8, ptr @a3, i64 3
+; CGSCC-NEXT: [[L32:%.*]] = load i8, ptr [[S32]], align 1
; CGSCC-NEXT: [[ADD:%.*]] = add i8 [[L31]], [[L32]]
-; CGSCC-NEXT: [[L34:%.*]] = load i8, i8* bitcast (i32* getelementptr inbounds (i32, i32* @a3, i64 1) to i8*), align 4
+; CGSCC-NEXT: [[S34:%.*]] = getelementptr i8, ptr @a3, i64 4
+; CGSCC-NEXT: [[L34:%.*]] = load i8, ptr [[S34]], align 4
; CGSCC-NEXT: [[ADD2:%.*]] = add i8 [[ADD]], [[L34]]
; CGSCC-NEXT: ret i8 [[ADD2]]
;
entry:
- %b = bitcast i32* @a3 to i8*
- %s30 = getelementptr i8, i8* %b, i64 3
- store i8 0, i8* %s30
+ %s30 = getelementptr i8, ptr @a3, i64 3
+ store i8 0, ptr %s30
br label %loop
loop:
- %p = phi i8* [%b, %entry], [%g, %loop]
+ %p = phi ptr [@a3, %entry], [%g, %loop]
%i = phi i8 [0, %entry], [%o, %loop]
- store i8 1, i8* %p
- %g = getelementptr i8, i8* %b, i64 2
+ store i8 1, ptr %p
+ %g = getelementptr i8, ptr @a3, i64 2
%o = add nsw i8 %i, 1
%c = icmp eq i8 %o, 7
br i1 %c, label %end, label %loop
end:
- %s31 = getelementptr i8, i8* %b, i64 2
- %l31 = load i8, i8* %s31
- %s32 = getelementptr i8, i8* %b, i64 3
- %l32 = load i8, i8* %s32
+ %s31 = getelementptr i8, ptr @a3, i64 2
+ %l31 = load i8, ptr %s31
+ %s32 = getelementptr i8, ptr @a3, i64 3
+ %l32 = load i8, ptr %s32
%add = add i8 %l31, %l32
- %s34 = getelementptr i8, i8* %b, i64 4
- %l34 = load i8, i8* %s34
+ %s34 = getelementptr i8, ptr @a3, i64 4
+ %l34 = load i8, ptr %s34
%add2 = add i8 %add, %l34
ret i8 %add2
}
@@ -2327,20 +2245,19 @@ define i8 @cast_and_load_1() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn
; TUNIT-LABEL: define {{[^@]+}}@cast_and_load_1
; TUNIT-SAME: () #[[ATTR3]] {
-; TUNIT-NEXT: store i32 42, i32* @bytes1, align 4
-; TUNIT-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4
+; TUNIT-NEXT: store i32 42, ptr @bytes1, align 4
+; TUNIT-NEXT: [[L:%.*]] = load i8, ptr @bytes1, align 4
; TUNIT-NEXT: ret i8 [[L]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@cast_and_load_1
; CGSCC-SAME: () #[[ATTR5]] {
-; CGSCC-NEXT: store i32 42, i32* @bytes1, align 4
-; CGSCC-NEXT: [[L:%.*]] = load i8, i8* bitcast (i32* @bytes1 to i8*), align 4
+; CGSCC-NEXT: store i32 42, ptr @bytes1, align 4
+; CGSCC-NEXT: [[L:%.*]] = load i8, ptr @bytes1, align 4
; CGSCC-NEXT: ret i8 [[L]]
;
- store i32 42, i32* @bytes1
- %bc = bitcast i32* @bytes1 to i8*
- %l = load i8, i8* %bc
+ store i32 42, ptr @bytes1
+ %l = load i8, ptr @bytes1
ret i8 %l
}
@@ -2348,20 +2265,19 @@ define i64 @cast_and_load_2() {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn
; TUNIT-LABEL: define {{[^@]+}}@cast_and_load_2
; TUNIT-SAME: () #[[ATTR3]] {
-; TUNIT-NEXT: store i32 42, i32* @bytes2, align 4
-; TUNIT-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4
+; TUNIT-NEXT: store i32 42, ptr @bytes2, align 4
+; TUNIT-NEXT: [[L:%.*]] = load i64, ptr @bytes2, align 4
; TUNIT-NEXT: ret i64 [[L]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@cast_and_load_2
; CGSCC-SAME: () #[[ATTR5]] {
-; CGSCC-NEXT: store i32 42, i32* @bytes2, align 4
-; CGSCC-NEXT: [[L:%.*]] = load i64, i64* bitcast (i32* @bytes2 to i64*), align 4
+; CGSCC-NEXT: store i32 42, ptr @bytes2, align 4
+; CGSCC-NEXT: [[L:%.*]] = load i64, ptr @bytes2, align 4
; CGSCC-NEXT: ret i64 [[L]]
;
- store i32 42, i32* @bytes2
- %bc = bitcast i32* @bytes2 to i64*
- %l = load i64, i64* %bc
+ store i32 42, ptr @bytes2
+ %l = load i64, ptr @bytes2
ret i64 %l
}
@@ -2398,7 +2314,7 @@ define void @recursive_load_store(i64 %N, i32 %v) {
; CGSCC-NEXT: ret void
;
entry:
- store i32 %v, i32* @rec_storage
+ store i32 %v, ptr @rec_storage
br label %for.cond
for.cond:
@@ -2407,14 +2323,14 @@ for.cond:
br i1 %exitcond, label %for.body, label %for.end
for.body:
- %ll = load i32, i32* @rec_storage
- store i32 %ll, i32* @rec_storage
+ %ll = load i32, ptr @rec_storage
+ store i32 %ll, ptr @rec_storage
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.cond
for.end:
- %lr = load i32, i32* @rec_storage
- store i32 %lr, i32* @rec_storage
+ %lr = load i32, ptr @rec_storage
+ store i32 %lr, ptr @rec_storage
ret void
}
@@ -2423,18 +2339,15 @@ define dso_local i32 @round_trip_malloc(i32 %x) {
; CHECK-SAME: (i32 returned [[X:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL_H2S:%.*]] = alloca i8, i64 4, align 1
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL_H2S]] to i32*
-; CHECK-NEXT: store i32 [[X]], i32* [[TMP0]], align 4
+; CHECK-NEXT: store i32 [[X]], ptr [[CALL_H2S]], align 4
; CHECK-NEXT: ret i32 [[X]]
;
entry:
- %call = call noalias i8* @malloc(i64 4) norecurse
- %0 = bitcast i8* %call to i32*
- store i32 %x, i32* %0, align 4
- %1 = load i32, i32* %0, align 4
- %2 = bitcast i32* %0 to i8*
- call void @free(i8* %2) norecurse
- ret i32 %1
+ %call = call noalias ptr @malloc(i64 4) norecurse
+ store i32 %x, ptr %call, align 4
+ %0 = load i32, ptr %call, align 4
+ call void @free(ptr %call) norecurse
+ ret i32 %0
}
define dso_local i32 @round_trip_malloc_constant() {
@@ -2443,46 +2356,42 @@ define dso_local i32 @round_trip_malloc_constant() {
; CHECK-NEXT: ret i32 7
;
entry:
- %call = call noalias i8* @malloc(i64 4) norecurse
- %0 = bitcast i8* %call to i32*
- store i32 7, i32* %0, align 4
- %1 = load i32, i32* %0, align 4
- %2 = bitcast i32* %0 to i8*
- call void @free(i8* %2) norecurse
- ret i32 %1
+ %call = call noalias ptr @malloc(i64 4) norecurse
+ store i32 7, ptr %call, align 4
+ %0 = load i32, ptr %call, align 4
+ call void @free(ptr %call) norecurse
+ ret i32 %0
}
-declare noalias i8* @malloc(i64) allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc"
+declare noalias ptr @malloc(i64) allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc"
-declare void @free(i8*) allockind("free") "alloc-family"="malloc"
+declare void @free(ptr) allockind("free") "alloc-family"="malloc"
define dso_local i32 @conditional_malloc(i32 %x) {
; CHECK-LABEL: define {{[^@]+}}@conditional_malloc
; CHECK-SAME: (i32 returned [[X:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL_H2S:%.*]] = alloca i8, i64 4, align 1
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL_H2S]] to i32*
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: store i32 [[X]], i32* [[TMP0]], align 4
+; CHECK-NEXT: store i32 [[X]], ptr [[CALL_H2S]], align 4
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
; CHECK-NEXT: ret i32 [[X]]
;
entry:
- %call = call noalias i8* @malloc(i64 4) norecurse
- %0 = bitcast i8* %call to i32*
+ %call = call noalias ptr @malloc(i64 4) norecurse
%tobool = icmp ne i32 %x, 0
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
- store i32 %x, i32* %0, align 4
+ store i32 %x, ptr %call, align 4
br label %if.end
if.end: ; preds = %if.then, %entry
- %1 = load i32, i32* %0, align 4
- ret i32 %1
+ %0 = load i32, ptr %call, align 4
+ ret i32 %0
}
define dso_local i32 @round_trip_calloc(i32 %x) {
@@ -2490,67 +2399,61 @@ define dso_local i32 @round_trip_calloc(i32 %x) {
; CHECK-SAME: (i32 returned [[X:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL_H2S:%.*]] = alloca i8, i64 4, align 1
-; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALL_H2S]], i8 0, i64 4, i1 false)
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL_H2S]] to i32*
-; CHECK-NEXT: store i32 [[X]], i32* [[TMP0]], align 4
+; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[CALL_H2S]], i8 0, i64 4, i1 false)
+; CHECK-NEXT: store i32 [[X]], ptr [[CALL_H2S]], align 4
; CHECK-NEXT: ret i32 [[X]]
;
entry:
- %call = call noalias i8* @calloc(i64 4, i64 1) norecurse
- %0 = bitcast i8* %call to i32*
- store i32 %x, i32* %0, align 4
- %1 = load i32, i32* %0, align 4
- ret i32 %1
+ %call = call noalias ptr @calloc(i64 4, i64 1) norecurse
+ store i32 %x, ptr %call, align 4
+ %0 = load i32, ptr %call, align 4
+ ret i32 %0
}
define dso_local i32 @round_trip_calloc_constant() {
; CHECK-LABEL: define {{[^@]+}}@round_trip_calloc_constant() {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL_H2S:%.*]] = alloca i8, i64 4, align 1
-; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALL_H2S]], i8 0, i64 4, i1 false)
+; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[CALL_H2S]], i8 0, i64 4, i1 false)
; CHECK-NEXT: ret i32 11
;
entry:
- %call = call noalias i8* @calloc(i64 4, i64 1) norecurse
- %0 = bitcast i8* %call to i32*
- store i32 11, i32* %0, align 4
- %1 = load i32, i32* %0, align 4
- ret i32 %1
+ %call = call noalias ptr @calloc(i64 4, i64 1) norecurse
+ store i32 11, ptr %call, align 4
+ %0 = load i32, ptr %call, align 4
+ ret i32 %0
}
-declare noalias i8* @calloc(i64, i64) allockind("alloc,zeroed") allocsize(0, 1) "alloc-family"="malloc"
+declare noalias ptr @calloc(i64, i64) allockind("alloc,zeroed") allocsize(0, 1) "alloc-family"="malloc"
define dso_local i32 @conditional_calloc(i32 %x) {
; CHECK-LABEL: define {{[^@]+}}@conditional_calloc
; CHECK-SAME: (i32 [[X:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL_H2S:%.*]] = alloca i8, i64 4, align 1
-; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALL_H2S]], i8 0, i64 4, i1 false)
-; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL_H2S]] to i32*
+; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[CALL_H2S]], i8 0, i64 4, i1 false)
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: store i32 [[X]], i32* [[TMP0]], align 4
+; CHECK-NEXT: store i32 [[X]], ptr [[CALL_H2S]], align 4
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP0]], align 4
-; CHECK-NEXT: ret i32 [[TMP1]]
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL_H2S]], align 4
+; CHECK-NEXT: ret i32 [[TMP0]]
;
entry:
- %call = call noalias i8* @calloc(i64 1, i64 4) norecurse
- %0 = bitcast i8* %call to i32*
+ %call = call noalias ptr @calloc(i64 1, i64 4) norecurse
%tobool = icmp ne i32 %x, 0
br i1 %tobool, label %if.end, label %if.then
if.then: ; preds = %entry
- store i32 %x, i32* %0, align 4
+ store i32 %x, ptr %call, align 4
br label %if.end
if.end: ; preds = %if.then, %entry
- %1 = load i32, i32* %0, align 4
- %2 = bitcast i32* %0 to i8*
- call void @free(i8* %2) norecurse
- ret i32 %1
+ %0 = load i32, ptr %call, align 4
+ call void @free(ptr %call) norecurse
+ ret i32 %0
}
define dso_local i32 @conditional_calloc_zero(i1 %c) {
@@ -2558,7 +2461,7 @@ define dso_local i32 @conditional_calloc_zero(i1 %c) {
; CHECK-SAME: (i1 [[C:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL_H2S:%.*]] = alloca i8, i64 4, align 1
-; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALL_H2S]], i8 0, i64 4, i1 false)
+; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr [[CALL_H2S]], i8 0, i64 4, i1 false)
; CHECK-NEXT: br i1 [[C]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
; CHECK-NEXT: br label [[IF_END]]
@@ -2566,72 +2469,64 @@ define dso_local i32 @conditional_calloc_zero(i1 %c) {
; CHECK-NEXT: ret i32 0
;
entry:
- %call = call noalias i8* @calloc(i64 1, i64 4) norecurse
- %0 = bitcast i8* %call to i32*
+ %call = call noalias ptr @calloc(i64 1, i64 4) norecurse
br i1 %c, label %if.end, label %if.then
if.then: ; preds = %entry
- store i32 0, i32* %0, align 4
+ store i32 0, ptr %call, align 4
br label %if.end
if.end: ; preds = %if.then, %entry
- %1 = load i32, i32* %0, align 4
- %2 = bitcast i32* %0 to i8*
- call void @free(i8* %2) norecurse
- ret i32 %1
+ %0 = load i32, ptr %call, align 4
+ call void @free(ptr %call) norecurse
+ ret i32 %0
}
-define dso_local i32* @malloc_like(i32 %s) {
+define dso_local ptr @malloc_like(i32 %s) {
; TUNIT-LABEL: define {{[^@]+}}@malloc_like
; TUNIT-SAME: (i32 [[S:%.*]]) {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[CONV:%.*]] = sext i32 [[S]] to i64
-; TUNIT-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR19:[0-9]+]]
-; TUNIT-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
-; TUNIT-NEXT: ret i32* [[TMP0]]
+; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @malloc(i64 [[CONV]]) #[[ATTR19:[0-9]+]]
+; TUNIT-NEXT: ret ptr [[CALL]]
;
; CGSCC-LABEL: define {{[^@]+}}@malloc_like
; CGSCC-SAME: (i32 [[S:%.*]]) {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[CONV:%.*]] = sext i32 [[S]] to i64
-; CGSCC-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 [[CONV]]) #[[ATTR22:[0-9]+]]
-; CGSCC-NEXT: [[TMP0:%.*]] = bitcast i8* [[CALL]] to i32*
-; CGSCC-NEXT: ret i32* [[TMP0]]
+; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @malloc(i64 [[CONV]]) #[[ATTR22:[0-9]+]]
+; CGSCC-NEXT: ret ptr [[CALL]]
;
entry:
%conv = sext i32 %s to i64
- %call = call noalias i8* @malloc(i64 %conv) norecurse
- %0 = bitcast i8* %call to i32*
- ret i32* %0
+ %call = call noalias ptr @malloc(i64 %conv) norecurse
+ ret ptr %call
}
define dso_local i32 @round_trip_malloc_like(i32 %x) {
; TUNIT-LABEL: define {{[^@]+}}@round_trip_malloc_like
; TUNIT-SAME: (i32 [[X:%.*]]) {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR19]]
-; TUNIT-NEXT: store i32 [[X]], i32* [[CALL]], align 4
-; TUNIT-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
-; TUNIT-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
-; TUNIT-NEXT: call void @free(i8* noundef nonnull [[TMP1]]) #[[ATTR19]]
+; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @malloc_like(i32 noundef 4) #[[ATTR19]]
+; TUNIT-NEXT: store i32 [[X]], ptr [[CALL]], align 4
+; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4
+; TUNIT-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR19]]
; TUNIT-NEXT: ret i32 [[TMP0]]
;
; CGSCC-LABEL: define {{[^@]+}}@round_trip_malloc_like
; CGSCC-SAME: (i32 [[X:%.*]]) {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @malloc_like(i32 noundef 4) #[[ATTR22]]
-; CGSCC-NEXT: store i32 [[X]], i32* [[CALL]], align 4
-; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
-; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
-; CGSCC-NEXT: call void @free(i8* noundef nonnull [[TMP1]]) #[[ATTR22]]
+; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @malloc_like(i32 noundef 4) #[[ATTR22]]
+; CGSCC-NEXT: store i32 [[X]], ptr [[CALL]], align 4
+; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4
+; CGSCC-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR22]]
; CGSCC-NEXT: ret i32 [[TMP0]]
;
entry:
- %call = call i32* @malloc_like(i32 4) norecurse
- store i32 %x, i32* %call, align 4
- %0 = load i32, i32* %call, align 4
- %1 = bitcast i32* %call to i8*
- call void @free(i8* %1) norecurse
+ %call = call ptr @malloc_like(i32 4) norecurse
+ store i32 %x, ptr %call, align 4
+ %0 = load i32, ptr %call, align 4
+ call void @free(ptr %call) norecurse
ret i32 %0
}
@@ -2639,214 +2534,194 @@ define dso_local i32 @round_trip_unknown_alloc(i32 %x) {
; TUNIT-LABEL: define {{[^@]+}}@round_trip_unknown_alloc
; TUNIT-SAME: (i32 [[X:%.*]]) {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR19]]
-; TUNIT-NEXT: store i32 [[X]], i32* [[CALL]], align 4
-; TUNIT-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
-; TUNIT-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
-; TUNIT-NEXT: call void @free(i8* noundef nonnull [[TMP1]]) #[[ATTR19]]
+; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR19]]
+; TUNIT-NEXT: store i32 [[X]], ptr [[CALL]], align 4
+; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4
+; TUNIT-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR19]]
; TUNIT-NEXT: ret i32 [[TMP0]]
;
; CGSCC-LABEL: define {{[^@]+}}@round_trip_unknown_alloc
; CGSCC-SAME: (i32 [[X:%.*]]) {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL:%.*]] = call i32* @unknown_alloc(i32 noundef 4) #[[ATTR22]]
-; CGSCC-NEXT: store i32 [[X]], i32* [[CALL]], align 4
-; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
-; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
-; CGSCC-NEXT: call void @free(i8* noundef nonnull [[TMP1]]) #[[ATTR22]]
+; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR22]]
+; CGSCC-NEXT: store i32 [[X]], ptr [[CALL]], align 4
+; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4
+; CGSCC-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR22]]
; CGSCC-NEXT: ret i32 [[TMP0]]
;
entry:
- %call = call i32* @unknown_alloc(i32 4) norecurse
- store i32 %x, i32* %call, align 4
- %0 = load i32, i32* %call, align 4
- %1 = bitcast i32* %call to i8*
- call void @free(i8* %1) norecurse
+ %call = call ptr @unknown_alloc(i32 4) norecurse
+ store i32 %x, ptr %call, align 4
+ %0 = load i32, ptr %call, align 4
+ call void @free(ptr %call) norecurse
ret i32 %0
}
-declare noalias i32* @unknown_alloc(i32)
+declare noalias ptr @unknown_alloc(i32)
define dso_local i32 @conditional_unknown_alloc(i32 %x) {
; TUNIT-LABEL: define {{[^@]+}}@conditional_unknown_alloc
; TUNIT-SAME: (i32 [[X:%.*]]) {
; TUNIT-NEXT: entry:
-; TUNIT-NEXT: [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR19]]
+; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR19]]
; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; TUNIT: if.then:
-; TUNIT-NEXT: store i32 [[X]], i32* [[CALL]], align 4
+; TUNIT-NEXT: store i32 [[X]], ptr [[CALL]], align 4
; TUNIT-NEXT: br label [[IF_END]]
; TUNIT: if.end:
-; TUNIT-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
-; TUNIT-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
-; TUNIT-NEXT: call void @free(i8* nonnull [[TMP1]]) #[[ATTR19]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4
+; TUNIT-NEXT: call void @free(ptr nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR19]]
; TUNIT-NEXT: ret i32 [[TMP0]]
;
; CGSCC-LABEL: define {{[^@]+}}@conditional_unknown_alloc
; CGSCC-SAME: (i32 [[X:%.*]]) {
; CGSCC-NEXT: entry:
-; CGSCC-NEXT: [[CALL:%.*]] = call noalias i32* @unknown_alloc(i32 noundef 4) #[[ATTR22]]
+; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR22]]
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CGSCC: if.then:
-; CGSCC-NEXT: store i32 [[X]], i32* [[CALL]], align 4
+; CGSCC-NEXT: store i32 [[X]], ptr [[CALL]], align 4
; CGSCC-NEXT: br label [[IF_END]]
; CGSCC: if.end:
-; CGSCC-NEXT: [[TMP0:%.*]] = load i32, i32* [[CALL]], align 4
-; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i32* [[CALL]] to i8*
-; CGSCC-NEXT: call void @free(i8* nonnull [[TMP1]]) #[[ATTR22]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4
+; CGSCC-NEXT: call void @free(ptr nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR22]]
; CGSCC-NEXT: ret i32 [[TMP0]]
;
entry:
- %call = call noalias i32* @unknown_alloc(i32 4) norecurse
+ %call = call noalias ptr @unknown_alloc(i32 4) norecurse
%tobool = icmp ne i32 %x, 0
br i1 %tobool, label %if.end, label %if.then
if.then: ; preds = %entry
- store i32 %x, i32* %call, align 4
+ store i32 %x, ptr %call, align 4
br label %if.end
if.end: ; preds = %if.then, %entry
- %0 = load i32, i32* %call, align 4
- %1 = bitcast i32* %call to i8*
- call void @free(i8* %1) norecurse
+ %0 = load i32, ptr %call, align 4
+ call void @free(ptr %call) norecurse
ret i32 %0
}
-%struct.STy = type { float*, double*, %struct.STy* }
+%struct.STy = type { ptr, ptr, ptr }
@global = internal global %struct.STy zeroinitializer, align 8
; We mark %dst as writeonly and %src as readonly, that is (for now) all we can expect.
-define dso_local void @test_nested_memory(float* %dst, double* %src) {
+define dso_local void @test_nested_memory(ptr %dst, ptr %src) {
; TUNIT-LABEL: define {{[^@]+}}@test_nested_memory
-; TUNIT-SAME: (float* nocapture nofree writeonly [[DST:%.*]], double* nocapture nofree readonly [[SRC:%.*]]) {
+; TUNIT-SAME: (ptr nocapture nofree writeonly [[DST:%.*]], ptr nocapture nofree readonly [[SRC:%.*]]) {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[CALL_H2S:%.*]] = alloca i8, i64 24, align 1
; TUNIT-NEXT: [[LOCAL:%.*]] = alloca [[STRUCT_STY:%.*]], align 8
-; TUNIT-NEXT: [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[LOCAL]], i64 0, i32 2
-; TUNIT-NEXT: store %struct.STy* @global, %struct.STy** [[INNER]], align 8
-; TUNIT-NEXT: [[DST1:%.*]] = bitcast i8* [[CALL_H2S]] to float**
-; TUNIT-NEXT: store float* [[DST]], float** [[DST1]], align 8
-; TUNIT-NEXT: [[SRC2:%.*]] = getelementptr inbounds i8, i8* [[CALL_H2S]], i64 8
-; TUNIT-NEXT: [[TMP0:%.*]] = bitcast i8* [[SRC2]] to double**
-; TUNIT-NEXT: store double* [[SRC]], double** [[TMP0]], align 8
-; TUNIT-NEXT: store i8* [[CALL_H2S]], i8** bitcast (%struct.STy** getelementptr inbounds ([[STRUCT_STY]], %struct.STy* @global, i64 0, i32 2) to i8**), align 8
-; TUNIT-NEXT: [[LOCAL_CAST:%.*]] = bitcast %struct.STy* [[LOCAL]] to float**
-; TUNIT-NEXT: [[TMP1:%.*]] = load float*, float** [[LOCAL_CAST]], align 8
-; TUNIT-NEXT: [[LOCAL_0_1:%.*]] = getelementptr [[STRUCT_STY]], %struct.STy* [[LOCAL]], i64 0, i32 1
-; TUNIT-NEXT: [[TMP2:%.*]] = load double*, double** [[LOCAL_0_1]], align 8
-; TUNIT-NEXT: [[LOCAL_0_2:%.*]] = getelementptr [[STRUCT_STY]], %struct.STy* [[LOCAL]], i64 0, i32 2
-; TUNIT-NEXT: [[TMP3:%.*]] = load %struct.STy*, %struct.STy** [[LOCAL_0_2]], align 8
-; TUNIT-NEXT: call fastcc void @nested_memory_callee(float* [[TMP1]], double* [[TMP2]], %struct.STy* [[TMP3]]) #[[ATTR20:[0-9]+]]
+; TUNIT-NEXT: [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], ptr [[LOCAL]], i64 0, i32 2
+; TUNIT-NEXT: store ptr @global, ptr [[INNER]], align 8
+; TUNIT-NEXT: store ptr [[DST]], ptr [[CALL_H2S]], align 8
+; TUNIT-NEXT: [[SRC2:%.*]] = getelementptr inbounds i8, ptr [[CALL_H2S]], i64 8
+; TUNIT-NEXT: store ptr [[SRC]], ptr [[SRC2]], align 8
+; TUNIT-NEXT: store ptr [[CALL_H2S]], ptr getelementptr inbounds ([[STRUCT_STY]], ptr @global, i64 0, i32 2), align 8
+; TUNIT-NEXT: [[TMP0:%.*]] = load ptr, ptr [[LOCAL]], align 8
+; TUNIT-NEXT: [[LOCAL_0_1:%.*]] = getelementptr [[STRUCT_STY]], ptr [[LOCAL]], i64 0, i32 1
+; TUNIT-NEXT: [[TMP1:%.*]] = load ptr, ptr [[LOCAL_0_1]], align 8
+; TUNIT-NEXT: [[LOCAL_0_2:%.*]] = getelementptr [[STRUCT_STY]], ptr [[LOCAL]], i64 0, i32 2
+; TUNIT-NEXT: [[TMP2:%.*]] = load ptr, ptr [[LOCAL_0_2]], align 8
+; TUNIT-NEXT: call fastcc void @nested_memory_callee(ptr [[TMP0]], ptr [[TMP1]], ptr [[TMP2]]) #[[ATTR20:[0-9]+]]
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@test_nested_memory
-; CGSCC-SAME: (float* nofree [[DST:%.*]], double* nofree [[SRC:%.*]]) {
+; CGSCC-SAME: (ptr nofree [[DST:%.*]], ptr nofree [[SRC:%.*]]) {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[LOCAL:%.*]] = alloca [[STRUCT_STY:%.*]], align 8
-; CGSCC-NEXT: [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[LOCAL]], i64 0, i32 2
-; CGSCC-NEXT: [[CALL:%.*]] = call noalias dereferenceable_or_null(24) i8* @malloc(i64 noundef 24)
-; CGSCC-NEXT: [[DST1:%.*]] = bitcast i8* [[CALL]] to float**
-; CGSCC-NEXT: store float* [[DST]], float** [[DST1]], align 8
-; CGSCC-NEXT: [[SRC2:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 8
-; CGSCC-NEXT: [[TMP0:%.*]] = bitcast i8* [[SRC2]] to double**
-; CGSCC-NEXT: store double* [[SRC]], double** [[TMP0]], align 8
-; CGSCC-NEXT: store i8* [[CALL]], i8** bitcast (%struct.STy** getelementptr inbounds ([[STRUCT_STY]], %struct.STy* @global, i64 0, i32 2) to i8**), align 8
-; CGSCC-NEXT: call fastcc void @nested_memory_callee(float* nofree nonnull align 4294967296 undef, double* nofree nonnull align 4294967296 undef, %struct.STy* nofree noundef nonnull align 8 dereferenceable(24) @global) #[[ATTR23:[0-9]+]]
+; CGSCC-NEXT: [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], ptr [[LOCAL]], i64 0, i32 2
+; CGSCC-NEXT: [[CALL:%.*]] = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24)
+; CGSCC-NEXT: store ptr [[DST]], ptr [[CALL]], align 8
+; CGSCC-NEXT: [[SRC2:%.*]] = getelementptr inbounds i8, ptr [[CALL]], i64 8
+; CGSCC-NEXT: store ptr [[SRC]], ptr [[SRC2]], align 8
+; CGSCC-NEXT: store ptr [[CALL]], ptr getelementptr inbounds ([[STRUCT_STY]], ptr @global, i64 0, i32 2), align 8
+; CGSCC-NEXT: call fastcc void @nested_memory_callee(ptr nofree nonnull align 4294967296 undef, ptr nofree nonnull align 4294967296 undef, ptr nofree noundef nonnull align 8 dereferenceable(24) @global) #[[ATTR23:[0-9]+]]
; CGSCC-NEXT: ret void
;
entry:
%local = alloca %struct.STy, align 8
- %0 = bitcast %struct.STy* %local to i8*
- %inner = getelementptr inbounds %struct.STy, %struct.STy* %local, i64 0, i32 2
- store %struct.STy* @global, %struct.STy** %inner, align 8
- %call = call noalias dereferenceable_or_null(24) i8* @malloc(i64 24) #4
- %dst1 = bitcast i8* %call to float**
- store float* %dst, float** %dst1, align 8
- %src2 = getelementptr inbounds i8, i8* %call, i64 8
- %1 = bitcast i8* %src2 to double**
- store double* %src, double** %1, align 8
- store i8* %call, i8** bitcast (%struct.STy** getelementptr inbounds (%struct.STy, %struct.STy* @global, i64 0, i32 2) to i8**), align 8
- call fastcc void @nested_memory_callee(%struct.STy* nonnull %local)
+ %inner = getelementptr inbounds %struct.STy, ptr %local, i64 0, i32 2
+ store ptr @global, ptr %inner, align 8
+ %call = call noalias dereferenceable_or_null(24) ptr @malloc(i64 24) #4
+ store ptr %dst, ptr %call, align 8
+ %src2 = getelementptr inbounds i8, ptr %call, i64 8
+ store ptr %src, ptr %src2, align 8
+ store ptr %call, ptr getelementptr inbounds (%struct.STy, ptr @global, i64 0, i32 2), align 8
+ call fastcc void @nested_memory_callee(ptr nonnull %local)
ret void
}
-define internal fastcc void @nested_memory_callee(%struct.STy* nocapture readonly %S) nofree norecurse nounwind uwtable {
+define internal fastcc void @nested_memory_callee(ptr nocapture readonly %S) nofree norecurse nounwind uwtable {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn uwtable
; TUNIT-LABEL: define {{[^@]+}}@nested_memory_callee
-; TUNIT-SAME: (float* [[TMP0:%.*]], double* [[TMP1:%.*]], %struct.STy* [[TMP2:%.*]]) #[[ATTR11:[0-9]+]] {
+; TUNIT-SAME: (ptr [[TMP0:%.*]], ptr [[TMP1:%.*]], ptr [[TMP2:%.*]]) #[[ATTR11:[0-9]+]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[S_PRIV:%.*]] = alloca [[STRUCT_STY:%.*]], align 8
-; TUNIT-NEXT: [[S_PRIV_CAST:%.*]] = bitcast %struct.STy* [[S_PRIV]] to float**
-; TUNIT-NEXT: store float* [[TMP0]], float** [[S_PRIV_CAST]], align 8
-; TUNIT-NEXT: [[S_PRIV_0_1:%.*]] = getelementptr [[STRUCT_STY]], %struct.STy* [[S_PRIV]], i64 0, i32 1
-; TUNIT-NEXT: store double* [[TMP1]], double** [[S_PRIV_0_1]], align 8
-; TUNIT-NEXT: [[S_PRIV_0_2:%.*]] = getelementptr [[STRUCT_STY]], %struct.STy* [[S_PRIV]], i64 0, i32 2
-; TUNIT-NEXT: store %struct.STy* [[TMP2]], %struct.STy** [[S_PRIV_0_2]], align 8
-; TUNIT-NEXT: [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[S_PRIV]], i64 0, i32 2
-; TUNIT-NEXT: [[TMP3:%.*]] = load %struct.STy*, %struct.STy** [[INNER]], align 8
-; TUNIT-NEXT: [[INNER1:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP3]], i64 0, i32 2
-; TUNIT-NEXT: [[TMP4:%.*]] = load %struct.STy*, %struct.STy** [[INNER1]], align 8
-; TUNIT-NEXT: [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP4]], i64 0, i32 1
-; TUNIT-NEXT: [[TMP5:%.*]] = load double*, double** [[SRC]], align 8
-; TUNIT-NEXT: [[TMP6:%.*]] = load double, double* [[TMP5]], align 8
+; TUNIT-NEXT: store ptr [[TMP0]], ptr [[S_PRIV]], align 8
+; TUNIT-NEXT: [[S_PRIV_0_1:%.*]] = getelementptr [[STRUCT_STY]], ptr [[S_PRIV]], i64 0, i32 1
+; TUNIT-NEXT: store ptr [[TMP1]], ptr [[S_PRIV_0_1]], align 8
+; TUNIT-NEXT: [[S_PRIV_0_2:%.*]] = getelementptr [[STRUCT_STY]], ptr [[S_PRIV]], i64 0, i32 2
+; TUNIT-NEXT: store ptr [[TMP2]], ptr [[S_PRIV_0_2]], align 8
+; TUNIT-NEXT: [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], ptr [[S_PRIV]], i64 0, i32 2
+; TUNIT-NEXT: [[TMP3:%.*]] = load ptr, ptr [[INNER]], align 8
+; TUNIT-NEXT: [[INNER1:%.*]] = getelementptr inbounds [[STRUCT_STY]], ptr [[TMP3]], i64 0, i32 2
+; TUNIT-NEXT: [[TMP4:%.*]] = load ptr, ptr [[INNER1]], align 8
+; TUNIT-NEXT: [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], ptr [[TMP4]], i64 0, i32 1
+; TUNIT-NEXT: [[TMP5:%.*]] = load ptr, ptr [[SRC]], align 8
+; TUNIT-NEXT: [[TMP6:%.*]] = load double, ptr [[TMP5]], align 8
; TUNIT-NEXT: [[CONV:%.*]] = fptrunc double [[TMP6]] to float
-; TUNIT-NEXT: [[DST:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP4]], i64 0, i32 0
-; TUNIT-NEXT: [[TMP7:%.*]] = load float*, float** [[DST]], align 8
-; TUNIT-NEXT: store float [[CONV]], float* [[TMP7]], align 4
+; TUNIT-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP4]], align 8
+; TUNIT-NEXT: store float [[CONV]], ptr [[TMP7]], align 4
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn uwtable
; CGSCC-LABEL: define {{[^@]+}}@nested_memory_callee
-; CGSCC-SAME: (float* [[TMP0:%.*]], double* [[TMP1:%.*]], %struct.STy* [[TMP2:%.*]]) #[[ATTR12:[0-9]+]] {
+; CGSCC-SAME: (ptr [[TMP0:%.*]], ptr [[TMP1:%.*]], ptr [[TMP2:%.*]]) #[[ATTR12:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[S_PRIV:%.*]] = alloca [[STRUCT_STY:%.*]], align 8
-; CGSCC-NEXT: [[S_PRIV_CAST:%.*]] = bitcast %struct.STy* [[S_PRIV]] to float**
-; CGSCC-NEXT: store float* [[TMP0]], float** [[S_PRIV_CAST]], align 8
-; CGSCC-NEXT: [[S_PRIV_0_1:%.*]] = getelementptr [[STRUCT_STY]], %struct.STy* [[S_PRIV]], i64 0, i32 1
-; CGSCC-NEXT: store double* [[TMP1]], double** [[S_PRIV_0_1]], align 8
-; CGSCC-NEXT: [[S_PRIV_0_2:%.*]] = getelementptr [[STRUCT_STY]], %struct.STy* [[S_PRIV]], i64 0, i32 2
-; CGSCC-NEXT: store %struct.STy* [[TMP2]], %struct.STy** [[S_PRIV_0_2]], align 8
-; CGSCC-NEXT: [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[S_PRIV]], i64 0, i32 2
-; CGSCC-NEXT: [[TMP3:%.*]] = load %struct.STy*, %struct.STy** [[INNER]], align 8
-; CGSCC-NEXT: [[INNER1:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP3]], i64 0, i32 2
-; CGSCC-NEXT: [[TMP4:%.*]] = load %struct.STy*, %struct.STy** [[INNER1]], align 8
-; CGSCC-NEXT: [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP4]], i64 0, i32 1
-; CGSCC-NEXT: [[TMP5:%.*]] = load double*, double** [[SRC]], align 8
-; CGSCC-NEXT: [[TMP6:%.*]] = load double, double* [[TMP5]], align 8
+; CGSCC-NEXT: store ptr [[TMP0]], ptr [[S_PRIV]], align 8
+; CGSCC-NEXT: [[S_PRIV_0_1:%.*]] = getelementptr [[STRUCT_STY]], ptr [[S_PRIV]], i64 0, i32 1
+; CGSCC-NEXT: store ptr [[TMP1]], ptr [[S_PRIV_0_1]], align 8
+; CGSCC-NEXT: [[S_PRIV_0_2:%.*]] = getelementptr [[STRUCT_STY]], ptr [[S_PRIV]], i64 0, i32 2
+; CGSCC-NEXT: store ptr [[TMP2]], ptr [[S_PRIV_0_2]], align 8
+; CGSCC-NEXT: [[INNER:%.*]] = getelementptr inbounds [[STRUCT_STY]], ptr [[S_PRIV]], i64 0, i32 2
+; CGSCC-NEXT: [[TMP3:%.*]] = load ptr, ptr [[INNER]], align 8
+; CGSCC-NEXT: [[INNER1:%.*]] = getelementptr inbounds [[STRUCT_STY]], ptr [[TMP3]], i64 0, i32 2
+; CGSCC-NEXT: [[TMP4:%.*]] = load ptr, ptr [[INNER1]], align 8
+; CGSCC-NEXT: [[SRC:%.*]] = getelementptr inbounds [[STRUCT_STY]], ptr [[TMP4]], i64 0, i32 1
+; CGSCC-NEXT: [[TMP5:%.*]] = load ptr, ptr [[SRC]], align 8
+; CGSCC-NEXT: [[TMP6:%.*]] = load double, ptr [[TMP5]], align 8
; CGSCC-NEXT: [[CONV:%.*]] = fptrunc double [[TMP6]] to float
-; CGSCC-NEXT: [[DST:%.*]] = getelementptr inbounds [[STRUCT_STY]], %struct.STy* [[TMP4]], i64 0, i32 0
-; CGSCC-NEXT: [[TMP7:%.*]] = load float*, float** [[DST]], align 8
-; CGSCC-NEXT: store float [[CONV]], float* [[TMP7]], align 4
+; CGSCC-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP4]], align 8
+; CGSCC-NEXT: store float [[CONV]], ptr [[TMP7]], align 4
; CGSCC-NEXT: ret void
;
entry:
- %inner = getelementptr inbounds %struct.STy, %struct.STy* %S, i64 0, i32 2
- %0 = load %struct.STy*, %struct.STy** %inner, align 8
- %inner1 = getelementptr inbounds %struct.STy, %struct.STy* %0, i64 0, i32 2
- %1 = load %struct.STy*, %struct.STy** %inner1, align 8
- %src = getelementptr inbounds %struct.STy, %struct.STy* %1, i64 0, i32 1
- %2 = load double*, double** %src, align 8
- %3 = load double, double* %2, align 8
+ %inner = getelementptr inbounds %struct.STy, ptr %S, i64 0, i32 2
+ %0 = load ptr, ptr %inner, align 8
+ %inner1 = getelementptr inbounds %struct.STy, ptr %0, i64 0, i32 2
+ %1 = load ptr, ptr %inner1, align 8
+ %src = getelementptr inbounds %struct.STy, ptr %1, i64 0, i32 1
+ %2 = load ptr, ptr %src, align 8
+ %3 = load double, ptr %2, align 8
%conv = fptrunc double %3 to float
- %dst = getelementptr inbounds %struct.STy, %struct.STy* %1, i64 0, i32 0
- %4 = load float*, float** %dst, align 8
- store float %conv, float* %4, align 4
+ %4 = load ptr, ptr %1, align 8
+ store float %conv, ptr %4, align 4
ret void
}
; Make sure the access %1 is not forwarded to the loads %2 and %3 as the indices are
; varying and the accesses thus not "exact". This used to simplify %cmp12 to true.
-define hidden void @no_propagation_of_unknown_index_access(i32* %in, i32* %out, i32 %idx) #0 {
+define hidden void @no_propagation_of_unknown_index_access(ptr %in, ptr %out, i32 %idx) #0 {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access
-; TUNIT-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR1]] {
+; TUNIT-SAME: (ptr nocapture nofree readonly [[IN:%.*]], ptr nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR1]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[BUF:%.*]] = alloca [128 x i32], align 16
-; TUNIT-NEXT: [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8*
-; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR16]]
; TUNIT-NEXT: br label [[FOR_COND:%.*]]
; TUNIT: for.cond:
; TUNIT-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ]
@@ -2856,10 +2731,10 @@ define hidden void @no_propagation_of_unknown_index_access(i32* %in, i32* %out,
; TUNIT-NEXT: br label [[FOR_COND4:%.*]]
; TUNIT: for.body:
; TUNIT-NEXT: [[IDXPROM:%.*]] = sext i32 [[I_0]] to i64
-; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN]], i64 [[IDXPROM]]
-; TUNIT-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4
-; TUNIT-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM]]
-; TUNIT-NEXT: store i32 [[TMP1]], i32* [[ARRAYIDX2]], align 4
+; TUNIT-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[IN]], i64 [[IDXPROM]]
+; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
+; TUNIT-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], ptr [[BUF]], i64 0, i64 [[IDXPROM]]
+; TUNIT-NEXT: store i32 [[TMP0]], ptr [[ARRAYIDX2]], align 4
; TUNIT-NEXT: [[INC]] = add nsw i32 [[I_0]], 1
; TUNIT-NEXT: br label [[FOR_COND]], !llvm.loop [[TBAA10]]
; TUNIT: for.cond4:
@@ -2867,29 +2742,28 @@ define hidden void @no_propagation_of_unknown_index_access(i32* %in, i32* %out,
; TUNIT-NEXT: [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128
; TUNIT-NEXT: br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]]
; TUNIT: for.cond.cleanup6:
-; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR16]]
+; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR16]]
; TUNIT-NEXT: ret void
; TUNIT: for.body7:
; TUNIT-NEXT: [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64
-; TUNIT-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM8]]
-; TUNIT-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX9]], align 4
+; TUNIT-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], ptr [[BUF]], i64 0, i64 [[IDXPROM8]]
+; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX9]], align 4
; TUNIT-NEXT: [[IDXPROM10:%.*]] = sext i32 [[IDX]] to i64
-; TUNIT-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM10]]
-; TUNIT-NEXT: [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX11]], align 4
-; TUNIT-NEXT: [[CMP12:%.*]] = icmp sle i32 [[TMP2]], [[TMP3]]
+; TUNIT-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], ptr [[BUF]], i64 0, i64 [[IDXPROM10]]
+; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX11]], align 4
+; TUNIT-NEXT: [[CMP12:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
; TUNIT-NEXT: [[CONV:%.*]] = zext i1 [[CMP12]] to i32
-; TUNIT-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, i32* [[OUT]], i64 [[IDXPROM8]]
-; TUNIT-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX14]], align 4
+; TUNIT-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 [[IDXPROM8]]
+; TUNIT-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX14]], align 4
; TUNIT-NEXT: [[INC16]] = add nsw i32 [[I3_0]], 1
; TUNIT-NEXT: br label [[FOR_COND4]], !llvm.loop [[TBAA12]]
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access
-; CGSCC-SAME: (i32* nocapture nofree readonly [[IN:%.*]], i32* nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR13:[0-9]+]] {
+; CGSCC-SAME: (ptr nocapture nofree readonly [[IN:%.*]], ptr nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR13:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[BUF:%.*]] = alloca [128 x i32], align 16
-; CGSCC-NEXT: [[TMP0:%.*]] = bitcast [128 x i32]* [[BUF]] to i8*
-; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR19]]
; CGSCC-NEXT: br label [[FOR_COND:%.*]]
; CGSCC: for.cond:
; CGSCC-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ]
@@ -2899,10 +2773,10 @@ define hidden void @no_propagation_of_unknown_index_access(i32* %in, i32* %out,
; CGSCC-NEXT: br label [[FOR_COND4:%.*]]
; CGSCC: for.body:
; CGSCC-NEXT: [[IDXPROM:%.*]] = sext i32 [[I_0]] to i64
-; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN]], i64 [[IDXPROM]]
-; CGSCC-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX]], align 4
-; CGSCC-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM]]
-; CGSCC-NEXT: store i32 [[TMP1]], i32* [[ARRAYIDX2]], align 4
+; CGSCC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[IN]], i64 [[IDXPROM]]
+; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
+; CGSCC-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [128 x i32], ptr [[BUF]], i64 0, i64 [[IDXPROM]]
+; CGSCC-NEXT: store i32 [[TMP0]], ptr [[ARRAYIDX2]], align 4
; CGSCC-NEXT: [[INC]] = add nsw i32 [[I_0]], 1
; CGSCC-NEXT: br label [[FOR_COND]], !llvm.loop [[TBAA10]]
; CGSCC: for.cond4:
@@ -2910,26 +2784,25 @@ define hidden void @no_propagation_of_unknown_index_access(i32* %in, i32* %out,
; CGSCC-NEXT: [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128
; CGSCC-NEXT: br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]]
; CGSCC: for.cond.cleanup6:
-; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 512, i8* nocapture nofree noundef nonnull align 16 dereferenceable(512) [[TMP0]]) #[[ATTR19]]
+; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR19]]
; CGSCC-NEXT: ret void
; CGSCC: for.body7:
; CGSCC-NEXT: [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64
-; CGSCC-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM8]]
-; CGSCC-NEXT: [[TMP2:%.*]] = load i32, i32* [[ARRAYIDX9]], align 4
+; CGSCC-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds [128 x i32], ptr [[BUF]], i64 0, i64 [[IDXPROM8]]
+; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX9]], align 4
; CGSCC-NEXT: [[IDXPROM10:%.*]] = sext i32 [[IDX]] to i64
-; CGSCC-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], [128 x i32]* [[BUF]], i64 0, i64 [[IDXPROM10]]
-; CGSCC-NEXT: [[TMP3:%.*]] = load i32, i32* [[ARRAYIDX11]], align 4
-; CGSCC-NEXT: [[CMP12:%.*]] = icmp sle i32 [[TMP2]], [[TMP3]]
+; CGSCC-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [128 x i32], ptr [[BUF]], i64 0, i64 [[IDXPROM10]]
+; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX11]], align 4
+; CGSCC-NEXT: [[CMP12:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
; CGSCC-NEXT: [[CONV:%.*]] = zext i1 [[CMP12]] to i32
-; CGSCC-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, i32* [[OUT]], i64 [[IDXPROM8]]
-; CGSCC-NEXT: store i32 [[CONV]], i32* [[ARRAYIDX14]], align 4
+; CGSCC-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 [[IDXPROM8]]
+; CGSCC-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX14]], align 4
; CGSCC-NEXT: [[INC16]] = add nsw i32 [[I3_0]], 1
; CGSCC-NEXT: br label [[FOR_COND4]], !llvm.loop [[TBAA12]]
;
entry:
%buf = alloca [128 x i32], align 16
- %0 = bitcast [128 x i32]* %buf to i8*
- call void @llvm.lifetime.start.p0i8(i64 512, i8* %0) #2
+ call void @llvm.lifetime.start.p0(i64 512, ptr %buf) #2
br label %for.cond
for.cond: ; preds = %for.body, %entry
@@ -2942,10 +2815,10 @@ for.cond.cleanup: ; preds = %for.cond
for.body: ; preds = %for.cond
%idxprom = sext i32 %i.0 to i64
- %arrayidx = getelementptr inbounds i32, i32* %in, i64 %idxprom
- %1 = load i32, i32* %arrayidx, align 4
- %arrayidx2 = getelementptr inbounds [128 x i32], [128 x i32]* %buf, i64 0, i64 %idxprom
- store i32 %1, i32* %arrayidx2, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %in, i64 %idxprom
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds [128 x i32], ptr %buf, i64 0, i64 %idxprom
+ store i32 %0, ptr %arrayidx2, align 4
%inc = add nsw i32 %i.0, 1
br label %for.cond, !llvm.loop !10
@@ -2955,62 +2828,62 @@ for.cond4: ; preds = %for.body7, %for.con
br i1 %cmp5, label %for.body7, label %for.cond.cleanup6
for.cond.cleanup6: ; preds = %for.cond4
- call void @llvm.lifetime.end.p0i8(i64 512, i8* %0) #2
+ call void @llvm.lifetime.end.p0(i64 512, ptr %buf) #2
ret void
for.body7: ; preds = %for.cond4
%idxprom8 = sext i32 %i3.0 to i64
- %arrayidx9 = getelementptr inbounds [128 x i32], [128 x i32]* %buf, i64 0, i64 %idxprom8
- %2 = load i32, i32* %arrayidx9, align 4
+ %arrayidx9 = getelementptr inbounds [128 x i32], ptr %buf, i64 0, i64 %idxprom8
+ %1 = load i32, ptr %arrayidx9, align 4
%idxprom10 = sext i32 %idx to i64
- %arrayidx11 = getelementptr inbounds [128 x i32], [128 x i32]* %buf, i64 0, i64 %idxprom10
- %3 = load i32, i32* %arrayidx11, align 4
- %cmp12 = icmp sle i32 %2, %3
+ %arrayidx11 = getelementptr inbounds [128 x i32], ptr %buf, i64 0, i64 %idxprom10
+ %2 = load i32, ptr %arrayidx11, align 4
+ %cmp12 = icmp sle i32 %1, %2
%conv = zext i1 %cmp12 to i32
- %arrayidx14 = getelementptr inbounds i32, i32* %out, i64 %idxprom8
- store i32 %conv, i32* %arrayidx14, align 4
+ %arrayidx14 = getelementptr inbounds i32, ptr %out, i64 %idxprom8
+ store i32 %conv, ptr %arrayidx14, align 4
%inc16 = add nsw i32 %i3.0, 1
br label %for.cond4, !llvm.loop !12
}
; Ensure we do not return true.
-define internal i1 @alloca_non_unique(i32* %p, i32 %in, i1 %c) {
+define internal i1 @alloca_non_unique(ptr %p, i32 %in, i1 %c) {
; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@alloca_non_unique
-; TUNIT-SAME: (i32* nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR12:[0-9]+]] {
+; TUNIT-SAME: (ptr nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR12:[0-9]+]] {
; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: store i32 [[IN]], i32* [[A]], align 4
+; TUNIT-NEXT: store i32 [[IN]], ptr [[A]], align 4
; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
; TUNIT: t:
-; TUNIT-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32 noundef 42, i1 noundef false) #[[ATTR14:[0-9]+]]
+; TUNIT-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32 noundef 42, i1 noundef false) #[[ATTR14:[0-9]+]]
; TUNIT-NEXT: ret i1 [[R]]
; TUNIT: f:
-; TUNIT-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 4
+; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[P]], align 4
; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32 [[IN]], [[L]]
; TUNIT-NEXT: ret i1 [[CMP]]
;
; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@alloca_non_unique
-; CGSCC-SAME: (i32* nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14:[0-9]+]] {
+; CGSCC-SAME: (ptr nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14:[0-9]+]] {
; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4
-; CGSCC-NEXT: store i32 [[IN]], i32* [[A]], align 4
+; CGSCC-NEXT: store i32 [[IN]], ptr [[A]], align 4
; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
; CGSCC: t:
-; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32 noundef 42, i1 noundef false) #[[ATTR17:[0-9]+]]
+; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32 noundef 42, i1 noundef false) #[[ATTR17:[0-9]+]]
; CGSCC-NEXT: ret i1 [[R]]
; CGSCC: f:
-; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 4
+; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[P]], align 4
; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[IN]], [[L]]
; CGSCC-NEXT: ret i1 [[CMP]]
;
%a = alloca i32
- store i32 %in, i32* %a
+ store i32 %in, ptr %a
br i1 %c, label %t, label %f
t:
- %r = call i1 @alloca_non_unique(i32* %a, i32 42, i1 false)
+ %r = call i1 @alloca_non_unique(ptr %a, i32 42, i1 false)
ret i1 %r
f:
- %l = load i32, i32* %p
+ %l = load i32, ptr %p
%cmp = icmp eq i32 %in, %l
ret i1 %cmp
}
@@ -3020,16 +2893,16 @@ define i1 @alloca_non_unique_caller(i32 %in, i1 %c) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none)
; TUNIT-LABEL: define {{[^@]+}}@alloca_non_unique_caller
; TUNIT-SAME: (i32 [[IN:%.*]], i1 [[C:%.*]]) #[[ATTR13:[0-9]+]] {
-; TUNIT-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(i32* undef, i32 [[IN]], i1 [[C]]) #[[ATTR14]]
+; TUNIT-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr undef, i32 [[IN]], i1 [[C]]) #[[ATTR14]]
; TUNIT-NEXT: ret i1 [[R]]
;
; CGSCC: Function Attrs: nofree nosync nounwind memory(none)
; CGSCC-LABEL: define {{[^@]+}}@alloca_non_unique_caller
; CGSCC-SAME: (i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR15:[0-9]+]] {
-; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(i32* undef, i32 [[IN]], i1 noundef [[C]]) #[[ATTR23]]
+; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr undef, i32 [[IN]], i1 noundef [[C]]) #[[ATTR23]]
; CGSCC-NEXT: ret i1 [[R]]
;
- %r = call i1 @alloca_non_unique(i32* undef, i32 %in, i1 %c)
+ %r = call i1 @alloca_non_unique(ptr undef, i32 %in, i1 %c)
ret i1 %r
}
@@ -3039,9 +2912,9 @@ define i32 @scope_value_traversal(i32 %bad, i1 %c, i1 %c2) {
; TUNIT-LABEL: define {{[^@]+}}@scope_value_traversal
; TUNIT-SAME: (i32 [[BAD:%.*]], i1 [[C:%.*]], i1 [[C2:%.*]]) #[[ATTR4]] {
; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4
-; TUNIT-NEXT: store i32 [[BAD]], i32* [[A]], align 4
-; TUNIT-NEXT: call void @scope_value_traversal_helper(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]], i1 [[C2]]) #[[ATTR17]]
-; TUNIT-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4
+; TUNIT-NEXT: store i32 [[BAD]], ptr [[A]], align 4
+; TUNIT-NEXT: call void @scope_value_traversal_helper(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]], i1 [[C2]]) #[[ATTR17]]
+; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[A]], align 4
; TUNIT-NEXT: [[SEL:%.*]] = select i1 [[C]], i32 [[BAD]], i32 [[L]]
; TUNIT-NEXT: ret i32 [[SEL]]
;
@@ -3049,40 +2922,40 @@ define i32 @scope_value_traversal(i32 %bad, i1 %c, i1 %c2) {
; CGSCC-LABEL: define {{[^@]+}}@scope_value_traversal
; CGSCC-SAME: (i32 [[BAD:%.*]], i1 [[C:%.*]], i1 [[C2:%.*]]) #[[ATTR16:[0-9]+]] {
; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4
-; CGSCC-NEXT: store i32 [[BAD]], i32* [[A]], align 4
-; CGSCC-NEXT: call void @scope_value_traversal_helper(i32* noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]], i1 [[C2]]) #[[ATTR20]]
-; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4
+; CGSCC-NEXT: store i32 [[BAD]], ptr [[A]], align 4
+; CGSCC-NEXT: call void @scope_value_traversal_helper(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]], i1 [[C2]]) #[[ATTR20]]
+; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[A]], align 4
; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[C]], i32 [[BAD]], i32 [[L]]
; CGSCC-NEXT: ret i32 [[SEL]]
;
%a = alloca i32
- store i32 %bad, i32* %a
- call void @scope_value_traversal_helper(i32* %a, i1 %c2)
- %l = load i32, i32* %a
+ store i32 %bad, ptr %a
+ call void @scope_value_traversal_helper(ptr %a, i1 %c2)
+ %l = load i32, ptr %a
%sel = select i1 %c, i32 %bad, i32 %l
ret i32 %sel
}
-define void @scope_value_traversal_helper(i32* %a, i1 %c) {
+define void @scope_value_traversal_helper(ptr %a, i1 %c) {
; TUNIT: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@scope_value_traversal_helper
-; TUNIT-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i1 [[C:%.*]]) #[[ATTR1]] {
-; TUNIT-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4
+; TUNIT-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i1 [[C:%.*]]) #[[ATTR1]] {
+; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[A]], align 4
; TUNIT-NEXT: [[SEL:%.*]] = select i1 [[C]], i32 [[L]], i32 42
-; TUNIT-NEXT: store i32 [[SEL]], i32* [[A]], align 4
+; TUNIT-NEXT: store i32 [[SEL]], ptr [[A]], align 4
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@scope_value_traversal_helper
-; CGSCC-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i1 [[C:%.*]]) #[[ATTR13]] {
-; CGSCC-NEXT: [[L:%.*]] = load i32, i32* [[A]], align 4
+; CGSCC-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i1 [[C:%.*]]) #[[ATTR13]] {
+; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[A]], align 4
; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[C]], i32 [[L]], i32 42
-; CGSCC-NEXT: store i32 [[SEL]], i32* [[A]], align 4
+; CGSCC-NEXT: store i32 [[SEL]], ptr [[A]], align 4
; CGSCC-NEXT: ret void
;
- %l = load i32, i32* %a
+ %l = load i32, ptr %a
%sel = select i1 %c, i32 %l, i32 42
- store i32 %sel, i32* %a
+ store i32 %sel, ptr %a
ret void
}
@@ -3092,16 +2965,16 @@ define i8 @gep_index_from_binary_operator(i1 %cnd1, i1 %cnd2) {
; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR4]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
-; CHECK-NEXT: [[GEP_FIXED:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 12
+; CHECK-NEXT: [[GEP_FIXED:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 12
; CHECK-NEXT: ret i8 100
;
entry:
%Bytes = alloca [1024 x i8], align 16
%offset = add i64 5, 7
- %gep.fixed = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 12
- %gep.sum = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %offset
- store i8 100, i8* %gep.fixed, align 4
- %i = load i8, i8* %gep.sum, align 4
+ %gep.fixed = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 12
+ %gep.sum = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 %offset
+ store i8 100, ptr %gep.fixed, align 4
+ %i = load i8, ptr %gep.sum, align 4
ret i8 %i
}
@@ -3111,21 +2984,20 @@ define i8 @gep_index_from_memory(i1 %cnd1, i1 %cnd2) {
; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR4]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16
-; CHECK-NEXT: [[GEP_LOADED:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 12
+; CHECK-NEXT: [[GEP_LOADED:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 12
; CHECK-NEXT: ret i8 100
;
entry:
%Bytes = alloca [1024 x i8], align 16
%addr = alloca i64, align 16
- %gep.addr = getelementptr inbounds i64, i64* %addr, i64 0
- store i64 12, i64* %gep.addr, align 8
- %offset = load i64, i64* %gep.addr, align 8
- %gep.fixed = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 12
+ store i64 12, ptr %addr, align 8
+ %offset = load i64, ptr %addr, align 8
+ %gep.fixed = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 12
- %gep.loaded = getelementptr inbounds [1024 x i8], [1024 x i8]* %Bytes, i64 0, i64 %offset
- store i8 100, i8* %gep.loaded, align 4
+ %gep.loaded = getelementptr inbounds [1024 x i8], ptr %Bytes, i64 0, i64 %offset
+ store i8 100, ptr %gep.loaded, align 4
- %i = load i8, i8* %gep.fixed, align 4
+ %i = load i8, ptr %gep.fixed, align 4
ret i8 %i
}
@@ -3136,30 +3008,30 @@ define i32 @a(i1 %c) {
; TUNIT: Function Attrs: nofree nosync nounwind
; TUNIT-LABEL: define {{[^@]+}}@a
; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR14]] {
-; TUNIT-NEXT: store i32 3, i32* @G, align 4
+; TUNIT-NEXT: store i32 3, ptr @G, align 4
; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
; TUNIT: t:
; TUNIT-NEXT: [[REC:%.*]] = call i32 @a(i1 noundef false) #[[ATTR14]]
; TUNIT-NEXT: br label [[F]]
; TUNIT: f:
-; TUNIT-NEXT: [[R:%.*]] = load i32, i32* @G, align 4
-; TUNIT-NEXT: store i32 5, i32* @G, align 4
+; TUNIT-NEXT: [[R:%.*]] = load i32, ptr @G, align 4
+; TUNIT-NEXT: store i32 5, ptr @G, align 4
; TUNIT-NEXT: ret i32 [[R]]
;
; CGSCC: Function Attrs: nofree nosync nounwind
; CGSCC-LABEL: define {{[^@]+}}@a
; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR17]] {
-; CGSCC-NEXT: store i32 3, i32* @G, align 4
+; CGSCC-NEXT: store i32 3, ptr @G, align 4
; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
; CGSCC: t:
; CGSCC-NEXT: [[REC:%.*]] = call i32 @a(i1 noundef false) #[[ATTR17]]
; CGSCC-NEXT: br label [[F]]
; CGSCC: f:
-; CGSCC-NEXT: [[R:%.*]] = load i32, i32* @G, align 4
-; CGSCC-NEXT: store i32 5, i32* @G, align 4
+; CGSCC-NEXT: [[R:%.*]] = load i32, ptr @G, align 4
+; CGSCC-NEXT: store i32 5, ptr @G, align 4
; CGSCC-NEXT: ret i32 [[R]]
;
- store i32 3, i32* @G
+ store i32 3, ptr @G
br i1 %c, label %t, label %f
t:
@@ -3167,8 +3039,8 @@ t:
br label %f
f:
- %r = load i32, i32* @G
- store i32 5, i32* @G
+ %r = load i32, ptr @G
+ store i32 5, ptr @G
ret i32 %r
}
More information about the llvm-commits
mailing list