[llvm] 8ff9bdb - Utils: Update tests for opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 17:53:11 PST 2022
Author: Matt Arsenault
Date: 2022-11-27T20:29:13-05:00
New Revision: 8ff9bdb8e2de7d2a5132296018423a6569e8410d
URL: https://github.com/llvm/llvm-project/commit/8ff9bdb8e2de7d2a5132296018423a6569e8410d
DIFF: https://github.com/llvm/llvm-project/commit/8ff9bdb8e2de7d2a5132296018423a6569e8410d.diff
LOG: Utils: Update tests for opaque pointers
Also use -disable-output
Added:
Modified:
llvm/test/Transforms/Util/assume-builder.ll
llvm/test/Transforms/Util/assume-simplify.ll
llvm/test/Transforms/Util/trivial-auto-var-init-crash-20210521.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Util/assume-builder.ll b/llvm/test/Transforms/Util/assume-builder.ll
index 52f4bf9519be8..47629a22e3696 100644
--- a/llvm/test/Transforms/Util/assume-builder.ll
+++ b/llvm/test/Transforms/Util/assume-builder.ll
@@ -7,953 +7,897 @@
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
-%struct.S = type { i32, i8, i32* }
-%struct.A = type { i8*, i64*, [4 x [4 x %struct.D]], i64 }
+%struct.S = type { i32, i8, ptr }
+%struct.A = type { ptr, ptr, [4 x [4 x %struct.D]], i64 }
%struct.D = type { i64, i64 }
-declare void @func(i32*, i32*)
-declare void @func_cold(i32*) #0
-declare void @func_strbool(i32*) #1
-declare void @func_many(i32*) #2
-declare void @func_argattr(i32* align 8, i32* nonnull) #3
-declare void @func_argattr2(i32* noundef align 8, i32* noundef nonnull) #3
+declare void @func(ptr, ptr)
+declare void @func_cold(ptr) #0
+declare void @func_strbool(ptr) #1
+declare void @func_many(ptr) #2
+declare void @func_argattr(ptr align 8, ptr nonnull) #3
+declare void @func_argattr2(ptr noundef align 8, ptr noundef nonnull) #3
declare void @may_throw()
-define void @test(i32* %P, i32* %P1, i32* %P2, i32* %P3) {
+define void @test(ptr %P, ptr %P1, ptr %P2, ptr %P3) {
; BASIC-LABEL: define {{[^@]+}}@test
-; BASIC-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]]) {
+; BASIC-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], ptr [[P2:%.*]], ptr [[P3:%.*]]) {
; BASIC-NEXT: bb:
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P]]), "dereferenceable"(i32* [[P]], i64 16) ]
-; BASIC-NEXT: call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12) ]
-; BASIC-NEXT: call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P]]), "dereferenceable"(ptr [[P]], i64 16) ]
+; BASIC-NEXT: call void @func(ptr nonnull dereferenceable(16) [[P]], ptr null)
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 12) ]
+; BASIC-NEXT: call void @func(ptr dereferenceable(12) [[P1]], ptr nonnull [[P]])
; BASIC-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; BASIC-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
+; BASIC-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
; BASIC-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; BASIC-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]])
-; BASIC-NEXT: call void @func(i32* [[P1]], i32* [[P]])
-; BASIC-NEXT: call void @func_strbool(i32* [[P1]])
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 32) ]
-; BASIC-NEXT: call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
-; BASIC-NEXT: call void @func_many(i32* align 8 [[P1]])
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; BASIC-NEXT: call void @func_many(i32* noundef align 8 [[P1]])
-; BASIC-NEXT: call void @func_argattr(i32* [[P2]], i32* [[P3]])
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P2]]), "align"(i32* [[P2]], i64 8), "noundef"(i32* [[P3]]), "nonnull"(i32* [[P3]]) ]
-; BASIC-NEXT: call void @func_argattr2(i32* [[P2]], i32* [[P3]])
-; BASIC-NEXT: call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P1]]), "noundef"(i32* [[P]]) ]
-; BASIC-NEXT: call void @func(i32* noundef nonnull [[P1]], i32* noundef nonnull [[P]])
+; BASIC-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]])
+; BASIC-NEXT: call void @func(ptr [[P1]], ptr [[P]])
+; BASIC-NEXT: call void @func_strbool(ptr [[P1]])
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 32) ]
+; BASIC-NEXT: call void @func(ptr dereferenceable(32) [[P]], ptr dereferenceable(8) [[P]])
+; BASIC-NEXT: call void @func_many(ptr align 8 [[P1]])
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; BASIC-NEXT: call void @func_many(ptr noundef align 8 [[P1]])
+; BASIC-NEXT: call void @func_argattr(ptr [[P2]], ptr [[P3]])
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P2]]), "align"(ptr [[P2]], i64 8), "noundef"(ptr [[P3]]), "nonnull"(ptr [[P3]]) ]
+; BASIC-NEXT: call void @func_argattr2(ptr [[P2]], ptr [[P3]])
+; BASIC-NEXT: call void @func(ptr nonnull [[P1]], ptr nonnull [[P]])
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P1]]), "noundef"(ptr [[P]]) ]
+; BASIC-NEXT: call void @func(ptr noundef nonnull [[P1]], ptr noundef nonnull [[P]])
; BASIC-NEXT: ret void
;
; ALL-LABEL: define {{[^@]+}}@test
-; ALL-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]]) {
+; ALL-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], ptr [[P2:%.*]], ptr [[P3:%.*]]) {
; ALL-NEXT: bb:
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P]]), "dereferenceable"(i32* [[P]], i64 16) ]
-; ALL-NEXT: call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12) ]
-; ALL-NEXT: call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P]]), "dereferenceable"(ptr [[P]], i64 16) ]
+; ALL-NEXT: call void @func(ptr nonnull dereferenceable(16) [[P]], ptr null)
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 12) ]
+; ALL-NEXT: call void @func(ptr dereferenceable(12) [[P1]], ptr nonnull [[P]])
; ALL-NEXT: call void @llvm.assume(i1 true) [ "cold"(), "nounwind"(), "willreturn"() ]
-; ALL-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
+; ALL-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
; ALL-NEXT: call void @llvm.assume(i1 true) [ "cold"(), "nounwind"(), "willreturn"() ]
-; ALL-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]])
-; ALL-NEXT: call void @func(i32* [[P1]], i32* [[P]])
-; ALL-NEXT: call void @func_strbool(i32* [[P1]])
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 32) ]
-; ALL-NEXT: call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
+; ALL-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]])
+; ALL-NEXT: call void @func(ptr [[P1]], ptr [[P]])
+; ALL-NEXT: call void @func_strbool(ptr [[P1]])
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 32) ]
+; ALL-NEXT: call void @func(ptr dereferenceable(32) [[P]], ptr dereferenceable(8) [[P]])
; ALL-NEXT: call void @llvm.assume(i1 true) [ "norecurse"(), "nounwind"(), "willreturn"() ]
-; ALL-NEXT: call void @func_many(i32* align 8 [[P1]])
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P1]]), "align"(i32* [[P1]], i64 8), "norecurse"(), "nounwind"(), "willreturn"() ]
-; ALL-NEXT: call void @func_many(i32* noundef align 8 [[P1]])
+; ALL-NEXT: call void @func_many(ptr align 8 [[P1]])
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P1]]), "align"(ptr [[P1]], i64 8), "norecurse"(), "nounwind"(), "willreturn"() ]
+; ALL-NEXT: call void @func_many(ptr noundef align 8 [[P1]])
; ALL-NEXT: call void @llvm.assume(i1 true) [ "nounwind"() ]
-; ALL-NEXT: call void @func_argattr(i32* [[P2]], i32* [[P3]])
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P2]]), "align"(i32* [[P2]], i64 8), "noundef"(i32* [[P3]]), "nonnull"(i32* [[P3]]), "nounwind"() ]
-; ALL-NEXT: call void @func_argattr2(i32* [[P2]], i32* [[P3]])
-; ALL-NEXT: call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P1]]), "noundef"(i32* [[P]]) ]
-; ALL-NEXT: call void @func(i32* noundef nonnull [[P1]], i32* noundef nonnull [[P]])
+; ALL-NEXT: call void @func_argattr(ptr [[P2]], ptr [[P3]])
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P2]]), "align"(ptr [[P2]], i64 8), "noundef"(ptr [[P3]]), "nonnull"(ptr [[P3]]), "nounwind"() ]
+; ALL-NEXT: call void @func_argattr2(ptr [[P2]], ptr [[P3]])
+; ALL-NEXT: call void @func(ptr nonnull [[P1]], ptr nonnull [[P]])
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P1]]), "noundef"(ptr [[P]]) ]
+; ALL-NEXT: call void @func(ptr noundef nonnull [[P1]], ptr noundef nonnull [[P]])
; ALL-NEXT: ret void
;
; WITH-AC-LABEL: define {{[^@]+}}@test
-; WITH-AC-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]]) {
+; WITH-AC-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], ptr [[P2:%.*]], ptr [[P3:%.*]]) {
; WITH-AC-NEXT: bb:
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P]]), "dereferenceable"(i32* [[P]], i64 16) ]
-; WITH-AC-NEXT: call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12) ]
-; WITH-AC-NEXT: call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P]]), "dereferenceable"(ptr [[P]], i64 16) ]
+; WITH-AC-NEXT: call void @func(ptr nonnull dereferenceable(16) [[P]], ptr null)
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 12) ]
+; WITH-AC-NEXT: call void @func(ptr dereferenceable(12) [[P1]], ptr nonnull [[P]])
; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; WITH-AC-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
+; WITH-AC-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; WITH-AC-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]])
-; WITH-AC-NEXT: call void @func(i32* [[P1]], i32* [[P]])
-; WITH-AC-NEXT: call void @func_strbool(i32* [[P1]])
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 32) ]
-; WITH-AC-NEXT: call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
-; WITH-AC-NEXT: call void @func_many(i32* align 8 [[P1]])
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; WITH-AC-NEXT: call void @func_many(i32* noundef align 8 [[P1]])
-; WITH-AC-NEXT: call void @func_argattr(i32* [[P2]], i32* [[P3]])
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P2]]), "align"(i32* [[P2]], i64 8), "noundef"(i32* [[P3]]), "nonnull"(i32* [[P3]]) ]
-; WITH-AC-NEXT: call void @func_argattr2(i32* [[P2]], i32* [[P3]])
-; WITH-AC-NEXT: call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P1]]), "noundef"(i32* [[P]]) ]
-; WITH-AC-NEXT: call void @func(i32* noundef nonnull [[P1]], i32* noundef nonnull [[P]])
+; WITH-AC-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]])
+; WITH-AC-NEXT: call void @func(ptr [[P1]], ptr [[P]])
+; WITH-AC-NEXT: call void @func_strbool(ptr [[P1]])
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 32) ]
+; WITH-AC-NEXT: call void @func(ptr dereferenceable(32) [[P]], ptr dereferenceable(8) [[P]])
+; WITH-AC-NEXT: call void @func_many(ptr align 8 [[P1]])
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; WITH-AC-NEXT: call void @func_many(ptr noundef align 8 [[P1]])
+; WITH-AC-NEXT: call void @func_argattr(ptr [[P2]], ptr [[P3]])
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P2]]), "align"(ptr [[P2]], i64 8), "noundef"(ptr [[P3]]), "nonnull"(ptr [[P3]]) ]
+; WITH-AC-NEXT: call void @func_argattr2(ptr [[P2]], ptr [[P3]])
+; WITH-AC-NEXT: call void @func(ptr nonnull [[P1]], ptr nonnull [[P]])
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P1]]), "noundef"(ptr [[P]]) ]
+; WITH-AC-NEXT: call void @func(ptr noundef nonnull [[P1]], ptr noundef nonnull [[P]])
; WITH-AC-NEXT: ret void
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@test
-; CROSS-BLOCK-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]]) {
+; CROSS-BLOCK-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], ptr [[P2:%.*]], ptr [[P3:%.*]]) {
; CROSS-BLOCK-NEXT: bb:
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P]]), "dereferenceable"(i32* [[P]], i64 16) ]
-; CROSS-BLOCK-NEXT: call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12) ]
-; CROSS-BLOCK-NEXT: call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P]]), "dereferenceable"(ptr [[P]], i64 16) ]
+; CROSS-BLOCK-NEXT: call void @func(ptr nonnull dereferenceable(16) [[P]], ptr null)
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 12) ]
+; CROSS-BLOCK-NEXT: call void @func(ptr dereferenceable(12) [[P1]], ptr nonnull [[P]])
; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; CROSS-BLOCK-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
+; CROSS-BLOCK-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; CROSS-BLOCK-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]])
-; CROSS-BLOCK-NEXT: call void @func(i32* [[P1]], i32* [[P]])
-; CROSS-BLOCK-NEXT: call void @func_strbool(i32* [[P1]])
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 32) ]
-; CROSS-BLOCK-NEXT: call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
-; CROSS-BLOCK-NEXT: call void @func_many(i32* align 8 [[P1]])
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; CROSS-BLOCK-NEXT: call void @func_many(i32* noundef align 8 [[P1]])
-; CROSS-BLOCK-NEXT: call void @func_argattr(i32* [[P2]], i32* [[P3]])
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P2]]), "align"(i32* [[P2]], i64 8), "noundef"(i32* [[P3]]), "nonnull"(i32* [[P3]]) ]
-; CROSS-BLOCK-NEXT: call void @func_argattr2(i32* [[P2]], i32* [[P3]])
-; CROSS-BLOCK-NEXT: call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P1]]), "noundef"(i32* [[P]]) ]
-; CROSS-BLOCK-NEXT: call void @func(i32* noundef nonnull [[P1]], i32* noundef nonnull [[P]])
+; CROSS-BLOCK-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]])
+; CROSS-BLOCK-NEXT: call void @func(ptr [[P1]], ptr [[P]])
+; CROSS-BLOCK-NEXT: call void @func_strbool(ptr [[P1]])
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 32) ]
+; CROSS-BLOCK-NEXT: call void @func(ptr dereferenceable(32) [[P]], ptr dereferenceable(8) [[P]])
+; CROSS-BLOCK-NEXT: call void @func_many(ptr align 8 [[P1]])
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; CROSS-BLOCK-NEXT: call void @func_many(ptr noundef align 8 [[P1]])
+; CROSS-BLOCK-NEXT: call void @func_argattr(ptr [[P2]], ptr [[P3]])
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P2]]), "align"(ptr [[P2]], i64 8), "noundef"(ptr [[P3]]), "nonnull"(ptr [[P3]]) ]
+; CROSS-BLOCK-NEXT: call void @func_argattr2(ptr [[P2]], ptr [[P3]])
+; CROSS-BLOCK-NEXT: call void @func(ptr nonnull [[P1]], ptr nonnull [[P]])
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P1]]), "noundef"(ptr [[P]]) ]
+; CROSS-BLOCK-NEXT: call void @func(ptr noundef nonnull [[P1]], ptr noundef nonnull [[P]])
; CROSS-BLOCK-NEXT: ret void
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@test
-; FULL-SIMPLIFY-SAME: (i32* nonnull dereferenceable(16) [[P:%.*]], i32* [[P1:%.*]], i32* [[P2:%.*]], i32* [[P3:%.*]]) {
+; FULL-SIMPLIFY-SAME: (ptr nonnull dereferenceable(16) [[P:%.*]], ptr [[P1:%.*]], ptr [[P2:%.*]], ptr [[P3:%.*]]) {
; FULL-SIMPLIFY-NEXT: bb:
-; FULL-SIMPLIFY-NEXT: call void @func(i32* nonnull dereferenceable(16) [[P]], i32* null)
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 12) ]
-; FULL-SIMPLIFY-NEXT: call void @func(i32* dereferenceable(12) [[P1]], i32* nonnull [[P]])
+; FULL-SIMPLIFY-NEXT: call void @func(ptr nonnull dereferenceable(16) [[P]], ptr null)
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 12) ]
+; FULL-SIMPLIFY-NEXT: call void @func(ptr dereferenceable(12) [[P1]], ptr nonnull [[P]])
; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
-; FULL-SIMPLIFY-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
-; FULL-SIMPLIFY-NEXT: call void @func_cold(i32* dereferenceable(12) [[P1]])
-; FULL-SIMPLIFY-NEXT: call void @func(i32* [[P1]], i32* [[P]])
-; FULL-SIMPLIFY-NEXT: call void @func_strbool(i32* [[P1]])
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 32) ]
-; FULL-SIMPLIFY-NEXT: call void @func(i32* dereferenceable(32) [[P]], i32* dereferenceable(8) [[P]])
-; FULL-SIMPLIFY-NEXT: call void @func_many(i32* align 8 [[P1]])
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; FULL-SIMPLIFY-NEXT: call void @func_many(i32* noundef align 8 [[P1]])
-; FULL-SIMPLIFY-NEXT: call void @func_argattr(i32* [[P2]], i32* [[P3]])
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "noundef"(i32* [[P2]]), "align"(i32* [[P2]], i64 8), "noundef"(i32* [[P3]]), "nonnull"(i32* [[P3]]) ]
-; FULL-SIMPLIFY-NEXT: call void @func_argattr2(i32* [[P2]], i32* [[P3]])
-; FULL-SIMPLIFY-NEXT: call void @func(i32* nonnull [[P1]], i32* nonnull [[P]])
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P1]]), "noundef"(i32* [[P]]) ]
-; FULL-SIMPLIFY-NEXT: call void @func(i32* noundef nonnull [[P1]], i32* noundef nonnull [[P]])
+; FULL-SIMPLIFY-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]]) #[[ATTR6:[0-9]+]]
+; FULL-SIMPLIFY-NEXT: call void @func_cold(ptr dereferenceable(12) [[P1]])
+; FULL-SIMPLIFY-NEXT: call void @func(ptr [[P1]], ptr [[P]])
+; FULL-SIMPLIFY-NEXT: call void @func_strbool(ptr [[P1]])
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 32) ]
+; FULL-SIMPLIFY-NEXT: call void @func(ptr dereferenceable(32) [[P]], ptr dereferenceable(8) [[P]])
+; FULL-SIMPLIFY-NEXT: call void @func_many(ptr align 8 [[P1]])
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; FULL-SIMPLIFY-NEXT: call void @func_many(ptr noundef align 8 [[P1]])
+; FULL-SIMPLIFY-NEXT: call void @func_argattr(ptr [[P2]], ptr [[P3]])
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "noundef"(ptr [[P2]]), "align"(ptr [[P2]], i64 8), "noundef"(ptr [[P3]]), "nonnull"(ptr [[P3]]) ]
+; FULL-SIMPLIFY-NEXT: call void @func_argattr2(ptr [[P2]], ptr [[P3]])
+; FULL-SIMPLIFY-NEXT: call void @func(ptr nonnull [[P1]], ptr nonnull [[P]])
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P1]]), "noundef"(ptr [[P]]) ]
+; FULL-SIMPLIFY-NEXT: call void @func(ptr noundef nonnull [[P1]], ptr noundef nonnull [[P]])
; FULL-SIMPLIFY-NEXT: ret void
;
bb:
- call void @func(i32* nonnull dereferenceable(16) %P, i32* null)
- call void @func(i32* dereferenceable(12) %P1, i32* nonnull %P)
- call void @func_cold(i32* dereferenceable(12) %P1) #5
- call void @func_cold(i32* dereferenceable(12) %P1)
- call void @func(i32* %P1, i32* %P)
- call void @func_strbool(i32* %P1)
- call void @func(i32* dereferenceable(32) %P, i32* dereferenceable(8) %P)
- call void @func_many(i32* align 8 %P1)
- call void @func_many(i32* noundef align 8 %P1)
- call void @func_argattr(i32* %P2, i32* %P3)
- call void @func_argattr2(i32* %P2, i32* %P3)
- call void @func(i32* nonnull %P1, i32* nonnull %P)
- call void @func(i32* noundef nonnull %P1, i32* noundef nonnull %P)
+ call void @func(ptr nonnull dereferenceable(16) %P, ptr null)
+ call void @func(ptr dereferenceable(12) %P1, ptr nonnull %P)
+ call void @func_cold(ptr dereferenceable(12) %P1) #5
+ call void @func_cold(ptr dereferenceable(12) %P1)
+ call void @func(ptr %P1, ptr %P)
+ call void @func_strbool(ptr %P1)
+ call void @func(ptr dereferenceable(32) %P, ptr dereferenceable(8) %P)
+ call void @func_many(ptr align 8 %P1)
+ call void @func_many(ptr noundef align 8 %P1)
+ call void @func_argattr(ptr %P2, ptr %P3)
+ call void @func_argattr2(ptr %P2, ptr %P3)
+ call void @func(ptr nonnull %P1, ptr nonnull %P)
+ call void @func(ptr noundef nonnull %P1, ptr noundef nonnull %P)
ret void
}
-define i32 @test2(%struct.S* %arg, i32* %arg1, i8* %arg2) {
+define i32 @test2(ptr %arg, ptr %arg1, ptr %arg2) {
; BASIC-LABEL: define {{[^@]+}}@test2
-; BASIC-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) {
+; BASIC-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; BASIC-NEXT: bb:
-; BASIC-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; BASIC-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; BASIC-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; BASIC-NEXT: [[I:%.*]] = alloca ptr, align 8
+; BASIC-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; BASIC-NEXT: [[I4:%.*]] = alloca ptr, align 8
; BASIC-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; BASIC-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; BASIC-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; BASIC-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; BASIC-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; BASIC-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; BASIC-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; BASIC-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; BASIC-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; BASIC-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; BASIC-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; BASIC-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; BASIC-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; BASIC-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; BASIC-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; BASIC-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; BASIC-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
-; BASIC-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; BASIC-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; BASIC-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "nonnull"(%struct.S* [[I14]]), "align"(%struct.S* [[I14]], i64 8) ]
-; BASIC-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; BASIC-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; BASIC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I17]], i64 5), "nonnull"(%struct.S* [[I17]]), "align"(%struct.S* [[I17]], i64 4) ]
-; BASIC-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 4
+; BASIC-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; BASIC-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; BASIC-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 8
+; BASIC-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; BASIC-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; BASIC-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; BASIC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "nonnull"(ptr [[I17]]), "align"(ptr [[I17]], i64 4) ]
+; BASIC-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 4
; BASIC-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; BASIC-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; BASIC-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; BASIC-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I22]], i64 16), "nonnull"(%struct.S* [[I22]]), "align"(%struct.S* [[I22]], i64 8) ]
-; BASIC-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; BASIC-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; BASIC-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; BASIC-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I22]], i64 16), "nonnull"(ptr [[I22]]), "align"(ptr [[I22]], i64 8) ]
+; BASIC-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; BASIC-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; BASIC-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; BASIC-NEXT: ret i32 [[I26]]
;
; ALL-LABEL: define {{[^@]+}}@test2
-; ALL-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) {
+; ALL-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; ALL-NEXT: bb:
-; ALL-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; ALL-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; ALL-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; ALL-NEXT: [[I:%.*]] = alloca ptr, align 8
+; ALL-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; ALL-NEXT: [[I4:%.*]] = alloca ptr, align 8
; ALL-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; ALL-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; ALL-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; ALL-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; ALL-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; ALL-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; ALL-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; ALL-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; ALL-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; ALL-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; ALL-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; ALL-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; ALL-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; ALL-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; ALL-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; ALL-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; ALL-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
-; ALL-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; ALL-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; ALL-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "nonnull"(%struct.S* [[I14]]), "align"(%struct.S* [[I14]], i64 8) ]
-; ALL-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; ALL-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; ALL-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I17]], i64 5), "nonnull"(%struct.S* [[I17]]), "align"(%struct.S* [[I17]], i64 4) ]
-; ALL-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 4
+; ALL-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; ALL-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; ALL-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 8
+; ALL-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; ALL-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; ALL-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; ALL-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "nonnull"(ptr [[I17]]), "align"(ptr [[I17]], i64 4) ]
+; ALL-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 4
; ALL-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; ALL-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; ALL-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; ALL-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I22]], i64 16), "nonnull"(%struct.S* [[I22]]), "align"(%struct.S* [[I22]], i64 8) ]
-; ALL-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; ALL-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; ALL-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; ALL-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I22]], i64 16), "nonnull"(ptr [[I22]]), "align"(ptr [[I22]], i64 8) ]
+; ALL-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; ALL-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; ALL-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; ALL-NEXT: ret i32 [[I26]]
;
; WITH-AC-LABEL: define {{[^@]+}}@test2
-; WITH-AC-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) {
+; WITH-AC-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; WITH-AC-NEXT: bb:
-; WITH-AC-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; WITH-AC-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; WITH-AC-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; WITH-AC-NEXT: [[I:%.*]] = alloca ptr, align 8
+; WITH-AC-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; WITH-AC-NEXT: [[I4:%.*]] = alloca ptr, align 8
; WITH-AC-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; WITH-AC-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; WITH-AC-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; WITH-AC-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; WITH-AC-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; WITH-AC-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; WITH-AC-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; WITH-AC-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; WITH-AC-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; WITH-AC-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; WITH-AC-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; WITH-AC-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; WITH-AC-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; WITH-AC-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; WITH-AC-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; WITH-AC-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; WITH-AC-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
-; WITH-AC-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; WITH-AC-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; WITH-AC-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "nonnull"(%struct.S* [[I14]]), "align"(%struct.S* [[I14]], i64 8) ]
-; WITH-AC-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; WITH-AC-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; WITH-AC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I17]], i64 5), "nonnull"(%struct.S* [[I17]]), "align"(%struct.S* [[I17]], i64 4) ]
-; WITH-AC-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 4
+; WITH-AC-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; WITH-AC-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; WITH-AC-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 8
+; WITH-AC-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; WITH-AC-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; WITH-AC-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; WITH-AC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "nonnull"(ptr [[I17]]), "align"(ptr [[I17]], i64 4) ]
+; WITH-AC-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 4
; WITH-AC-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; WITH-AC-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; WITH-AC-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; WITH-AC-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I22]], i64 16), "nonnull"(%struct.S* [[I22]]), "align"(%struct.S* [[I22]], i64 8) ]
-; WITH-AC-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; WITH-AC-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; WITH-AC-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; WITH-AC-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I22]], i64 16), "nonnull"(ptr [[I22]]), "align"(ptr [[I22]], i64 8) ]
+; WITH-AC-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; WITH-AC-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; WITH-AC-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; WITH-AC-NEXT: ret i32 [[I26]]
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@test2
-; CROSS-BLOCK-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) {
+; CROSS-BLOCK-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; CROSS-BLOCK-NEXT: bb:
-; CROSS-BLOCK-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; CROSS-BLOCK-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; CROSS-BLOCK-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; CROSS-BLOCK-NEXT: [[I:%.*]] = alloca ptr, align 8
+; CROSS-BLOCK-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; CROSS-BLOCK-NEXT: [[I4:%.*]] = alloca ptr, align 8
; CROSS-BLOCK-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; CROSS-BLOCK-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; CROSS-BLOCK-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; CROSS-BLOCK-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; CROSS-BLOCK-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; CROSS-BLOCK-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; CROSS-BLOCK-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; CROSS-BLOCK-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; CROSS-BLOCK-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; CROSS-BLOCK-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; CROSS-BLOCK-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; CROSS-BLOCK-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; CROSS-BLOCK-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; CROSS-BLOCK-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
-; CROSS-BLOCK-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; CROSS-BLOCK-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "nonnull"(%struct.S* [[I14]]), "align"(%struct.S* [[I14]], i64 8) ]
-; CROSS-BLOCK-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; CROSS-BLOCK-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I17]], i64 5), "nonnull"(%struct.S* [[I17]]), "align"(%struct.S* [[I17]], i64 4) ]
-; CROSS-BLOCK-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 4
+; CROSS-BLOCK-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; CROSS-BLOCK-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; CROSS-BLOCK-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; CROSS-BLOCK-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "nonnull"(ptr [[I17]]), "align"(ptr [[I17]], i64 4) ]
+; CROSS-BLOCK-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 4
; CROSS-BLOCK-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; CROSS-BLOCK-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; CROSS-BLOCK-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I22]], i64 16), "nonnull"(%struct.S* [[I22]]), "align"(%struct.S* [[I22]], i64 8) ]
-; CROSS-BLOCK-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; CROSS-BLOCK-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; CROSS-BLOCK-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I22]], i64 16), "nonnull"(ptr [[I22]]), "align"(ptr [[I22]], i64 8) ]
+; CROSS-BLOCK-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; CROSS-BLOCK-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; CROSS-BLOCK-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; CROSS-BLOCK-NEXT: ret i32 [[I26]]
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@test2
-; FULL-SIMPLIFY-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) {
+; FULL-SIMPLIFY-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; FULL-SIMPLIFY-NEXT: bb:
-; FULL-SIMPLIFY-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; FULL-SIMPLIFY-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; FULL-SIMPLIFY-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; FULL-SIMPLIFY-NEXT: [[I:%.*]] = alloca ptr, align 8
+; FULL-SIMPLIFY-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; FULL-SIMPLIFY-NEXT: [[I4:%.*]] = alloca ptr, align 8
; FULL-SIMPLIFY-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; FULL-SIMPLIFY-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; FULL-SIMPLIFY-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; FULL-SIMPLIFY-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; FULL-SIMPLIFY-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; FULL-SIMPLIFY-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; FULL-SIMPLIFY-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; FULL-SIMPLIFY-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; FULL-SIMPLIFY-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
-; FULL-SIMPLIFY-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; FULL-SIMPLIFY-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; FULL-SIMPLIFY-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; FULL-SIMPLIFY-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; FULL-SIMPLIFY-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 4
+; FULL-SIMPLIFY-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; FULL-SIMPLIFY-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; FULL-SIMPLIFY-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; FULL-SIMPLIFY-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; FULL-SIMPLIFY-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 4
; FULL-SIMPLIFY-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; FULL-SIMPLIFY-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; FULL-SIMPLIFY-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "nonnull"(%struct.S* [[I14]]), "align"(%struct.S* [[I14]], i64 8), "dereferenceable"(%struct.S* [[I17]], i64 5), "nonnull"(%struct.S* [[I17]]), "align"(%struct.S* [[I17]], i64 4), "dereferenceable"(%struct.S* [[I22]], i64 16), "nonnull"(%struct.S* [[I22]]), "align"(%struct.S* [[I22]], i64 8) ]
-; FULL-SIMPLIFY-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; FULL-SIMPLIFY-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; FULL-SIMPLIFY-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; FULL-SIMPLIFY-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "nonnull"(ptr [[I17]]), "align"(ptr [[I17]], i64 4), "dereferenceable"(ptr [[I22]], i64 16), "nonnull"(ptr [[I22]]), "align"(ptr [[I22]], i64 8) ]
+; FULL-SIMPLIFY-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; FULL-SIMPLIFY-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; FULL-SIMPLIFY-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; FULL-SIMPLIFY-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; FULL-SIMPLIFY-NEXT: ret i32 [[I26]]
;
bb:
- %i = alloca %struct.S*, align 8
- %i3 = alloca i32*, align 8
- %i4 = alloca i8*, align 8
+ %i = alloca ptr, align 8
+ %i3 = alloca ptr, align 8
+ %i4 = alloca ptr, align 8
%i5 = alloca %struct.S, align 8
- store %struct.S* %arg, %struct.S** %i, align 8
- store i32* %arg1, i32** %i3, align 8
- store i8* %arg2, i8** %i4, align 8
- %i6 = load i32*, i32** %i3, align 8
- %i7 = load i32, i32* %i6, align 4
+ store ptr %arg, ptr %i, align 8
+ store ptr %arg1, ptr %i3, align 8
+ store ptr %arg2, ptr %i4, align 8
+ %i6 = load ptr, ptr %i3, align 8
+ %i7 = load i32, ptr %i6, align 4
%i8 = trunc i32 %i7 to i8
- %i9 = load i8*, i8** %i4, align 8
- store i8 %i8, i8* %i9, align 1
- %i10 = bitcast %struct.S* %i5 to i8*
- %i11 = load %struct.S*, %struct.S** %i, align 8
- %i12 = bitcast %struct.S* %i11 to i8*
- %i13 = bitcast %struct.S* %i5 to i8*
- %i14 = load %struct.S*, %struct.S** %i, align 8
- %i15 = getelementptr inbounds %struct.S, %struct.S* %i14, i32 0, i32 0
- %i16 = load i32, i32* %i15, align 8
- %i17 = load %struct.S*, %struct.S** %i, align 8
- %i18 = getelementptr inbounds %struct.S, %struct.S* %i17, i32 0, i32 1
- %i19 = load i8, i8* %i18, align 4
+ %i9 = load ptr, ptr %i4, align 8
+ store i8 %i8, ptr %i9, align 1
+ %i11 = load ptr, ptr %i, align 8
+ %i14 = load ptr, ptr %i, align 8
+ %i16 = load i32, ptr %i14, align 8
+ %i17 = load ptr, ptr %i, align 8
+ %i18 = getelementptr inbounds %struct.S, ptr %i17, i32 0, i32 1
+ %i19 = load i8, ptr %i18, align 4
%i20 = sext i8 %i19 to i32
%i21 = add nsw i32 %i16, %i20
- %i22 = load %struct.S*, %struct.S** %i, align 8
- %i23 = getelementptr inbounds %struct.S, %struct.S* %i22, i32 0, i32 2
- %i24 = load i32*, i32** %i23, align 8
- %i25 = load i32, i32* %i24, align 4
+ %i22 = load ptr, ptr %i, align 8
+ %i23 = getelementptr inbounds %struct.S, ptr %i22, i32 0, i32 2
+ %i24 = load ptr, ptr %i23, align 8
+ %i25 = load i32, ptr %i24, align 4
%i26 = add nsw i32 %i21, %i25
ret i32 %i26
}
-define i32 @test3(%struct.S* %arg, i32* %arg1, i8* %arg2) #4 {
+define i32 @test3(ptr %arg, ptr %arg1, ptr %arg2) #4 {
; BASIC-LABEL: define {{[^@]+}}@test3
-; BASIC-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
+; BASIC-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
; BASIC-NEXT: bb:
-; BASIC-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; BASIC-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; BASIC-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; BASIC-NEXT: [[I:%.*]] = alloca ptr, align 8
+; BASIC-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; BASIC-NEXT: [[I4:%.*]] = alloca ptr, align 8
; BASIC-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; BASIC-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; BASIC-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; BASIC-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; BASIC-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; BASIC-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; BASIC-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; BASIC-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; BASIC-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; BASIC-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; BASIC-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; BASIC-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; BASIC-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; BASIC-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; BASIC-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; BASIC-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 32
-; BASIC-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
+; BASIC-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; BASIC-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; BASIC-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 32
; BASIC-NEXT: call void @may_throw()
-; BASIC-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; BASIC-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; BASIC-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "align"(%struct.S* [[I14]], i64 8) ]
-; BASIC-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; BASIC-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; BASIC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I17]], i64 5), "align"(%struct.S* [[I17]], i64 4) ]
-; BASIC-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 8
+; BASIC-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; BASIC-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; BASIC-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; BASIC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "align"(ptr [[I17]], i64 4) ]
+; BASIC-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 8
; BASIC-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; BASIC-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; BASIC-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; BASIC-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I22]], i64 16), "align"(%struct.S* [[I22]], i64 8) ]
-; BASIC-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; BASIC-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; BASIC-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; BASIC-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I22]], i64 16), "align"(ptr [[I22]], i64 8) ]
+; BASIC-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; BASIC-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; BASIC-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; BASIC-NEXT: ret i32 [[I26]]
;
; ALL-LABEL: define {{[^@]+}}@test3
-; ALL-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
+; ALL-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
; ALL-NEXT: bb:
-; ALL-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; ALL-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; ALL-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; ALL-NEXT: [[I:%.*]] = alloca ptr, align 8
+; ALL-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; ALL-NEXT: [[I4:%.*]] = alloca ptr, align 8
; ALL-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; ALL-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; ALL-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; ALL-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; ALL-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; ALL-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; ALL-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; ALL-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; ALL-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; ALL-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; ALL-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; ALL-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; ALL-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; ALL-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; ALL-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; ALL-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 32
-; ALL-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
+; ALL-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; ALL-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; ALL-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 32
; ALL-NEXT: call void @may_throw()
-; ALL-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; ALL-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; ALL-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "align"(%struct.S* [[I14]], i64 8) ]
-; ALL-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; ALL-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; ALL-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I17]], i64 5), "align"(%struct.S* [[I17]], i64 4) ]
-; ALL-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 8
+; ALL-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; ALL-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; ALL-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; ALL-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "align"(ptr [[I17]], i64 4) ]
+; ALL-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 8
; ALL-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; ALL-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; ALL-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; ALL-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I22]], i64 16), "align"(%struct.S* [[I22]], i64 8) ]
-; ALL-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; ALL-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; ALL-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; ALL-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I22]], i64 16), "align"(ptr [[I22]], i64 8) ]
+; ALL-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; ALL-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; ALL-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; ALL-NEXT: ret i32 [[I26]]
;
; WITH-AC-LABEL: define {{[^@]+}}@test3
-; WITH-AC-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
+; WITH-AC-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
; WITH-AC-NEXT: bb:
-; WITH-AC-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; WITH-AC-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; WITH-AC-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; WITH-AC-NEXT: [[I:%.*]] = alloca ptr, align 8
+; WITH-AC-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; WITH-AC-NEXT: [[I4:%.*]] = alloca ptr, align 8
; WITH-AC-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; WITH-AC-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; WITH-AC-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; WITH-AC-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; WITH-AC-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; WITH-AC-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; WITH-AC-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; WITH-AC-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; WITH-AC-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; WITH-AC-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; WITH-AC-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; WITH-AC-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; WITH-AC-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; WITH-AC-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; WITH-AC-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; WITH-AC-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 32
-; WITH-AC-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
+; WITH-AC-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; WITH-AC-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; WITH-AC-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 32
; WITH-AC-NEXT: call void @may_throw()
-; WITH-AC-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; WITH-AC-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; WITH-AC-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "align"(%struct.S* [[I14]], i64 8) ]
-; WITH-AC-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; WITH-AC-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; WITH-AC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I17]], i64 5), "align"(%struct.S* [[I17]], i64 4) ]
-; WITH-AC-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 8
+; WITH-AC-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; WITH-AC-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; WITH-AC-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; WITH-AC-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "align"(ptr [[I17]], i64 4) ]
+; WITH-AC-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 8
; WITH-AC-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; WITH-AC-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; WITH-AC-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; WITH-AC-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I22]], i64 16), "align"(%struct.S* [[I22]], i64 8) ]
-; WITH-AC-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; WITH-AC-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; WITH-AC-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; WITH-AC-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I22]], i64 16), "align"(ptr [[I22]], i64 8) ]
+; WITH-AC-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; WITH-AC-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; WITH-AC-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; WITH-AC-NEXT: ret i32 [[I26]]
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@test3
-; CROSS-BLOCK-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
+; CROSS-BLOCK-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
; CROSS-BLOCK-NEXT: bb:
-; CROSS-BLOCK-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; CROSS-BLOCK-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; CROSS-BLOCK-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; CROSS-BLOCK-NEXT: [[I:%.*]] = alloca ptr, align 8
+; CROSS-BLOCK-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; CROSS-BLOCK-NEXT: [[I4:%.*]] = alloca ptr, align 8
; CROSS-BLOCK-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; CROSS-BLOCK-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; CROSS-BLOCK-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; CROSS-BLOCK-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; CROSS-BLOCK-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; CROSS-BLOCK-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; CROSS-BLOCK-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; CROSS-BLOCK-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; CROSS-BLOCK-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; CROSS-BLOCK-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; CROSS-BLOCK-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; CROSS-BLOCK-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; CROSS-BLOCK-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; CROSS-BLOCK-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 32
-; CROSS-BLOCK-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
+; CROSS-BLOCK-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; CROSS-BLOCK-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; CROSS-BLOCK-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 32
; CROSS-BLOCK-NEXT: call void @may_throw()
-; CROSS-BLOCK-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; CROSS-BLOCK-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "align"(%struct.S* [[I14]], i64 8) ]
-; CROSS-BLOCK-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; CROSS-BLOCK-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I17]], i64 5), "align"(%struct.S* [[I17]], i64 4) ]
-; CROSS-BLOCK-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 8
+; CROSS-BLOCK-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; CROSS-BLOCK-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "align"(ptr [[I17]], i64 4) ]
+; CROSS-BLOCK-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 8
; CROSS-BLOCK-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; CROSS-BLOCK-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; CROSS-BLOCK-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; CROSS-BLOCK-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I22]], i64 16), "align"(%struct.S* [[I22]], i64 8) ]
-; CROSS-BLOCK-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; CROSS-BLOCK-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; CROSS-BLOCK-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; CROSS-BLOCK-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I22]], i64 16), "align"(ptr [[I22]], i64 8) ]
+; CROSS-BLOCK-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; CROSS-BLOCK-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; CROSS-BLOCK-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; CROSS-BLOCK-NEXT: ret i32 [[I26]]
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@test3
-; FULL-SIMPLIFY-SAME: (%struct.S* [[ARG:%.*]], i32* [[ARG1:%.*]], i8* [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
+; FULL-SIMPLIFY-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) #[[ATTR4:[0-9]+]] {
; FULL-SIMPLIFY-NEXT: bb:
-; FULL-SIMPLIFY-NEXT: [[I:%.*]] = alloca %struct.S*, align 8
-; FULL-SIMPLIFY-NEXT: [[I3:%.*]] = alloca i32*, align 8
-; FULL-SIMPLIFY-NEXT: [[I4:%.*]] = alloca i8*, align 8
+; FULL-SIMPLIFY-NEXT: [[I:%.*]] = alloca ptr, align 8
+; FULL-SIMPLIFY-NEXT: [[I3:%.*]] = alloca ptr, align 8
+; FULL-SIMPLIFY-NEXT: [[I4:%.*]] = alloca ptr, align 8
; FULL-SIMPLIFY-NEXT: [[I5:%.*]] = alloca [[STRUCT_S:%.*]], align 8
-; FULL-SIMPLIFY-NEXT: store %struct.S* [[ARG]], %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: store i32* [[ARG1]], i32** [[I3]], align 8
-; FULL-SIMPLIFY-NEXT: store i8* [[ARG2]], i8** [[I4]], align 8
-; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = load i32*, i32** [[I3]], align 8
-; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = load i32, i32* [[I6]], align 4
+; FULL-SIMPLIFY-NEXT: store ptr [[ARG]], ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: store ptr [[ARG1]], ptr [[I3]], align 8
+; FULL-SIMPLIFY-NEXT: store ptr [[ARG2]], ptr [[I4]], align 8
+; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = load ptr, ptr [[I3]], align 8
+; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = load i32, ptr [[I6]], align 4
; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = trunc i32 [[I7]] to i8
-; FULL-SIMPLIFY-NEXT: [[I9:%.*]] = load i8*, i8** [[I4]], align 8
-; FULL-SIMPLIFY-NEXT: store i8 [[I8]], i8* [[I9]], align 1
-; FULL-SIMPLIFY-NEXT: [[I10:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; FULL-SIMPLIFY-NEXT: [[I11:%.*]] = load %struct.S*, %struct.S** [[I]], align 32
-; FULL-SIMPLIFY-NEXT: [[I12:%.*]] = bitcast %struct.S* [[I11]] to i8*
+; FULL-SIMPLIFY-NEXT: [[I9:%.*]] = load ptr, ptr [[I4]], align 8
+; FULL-SIMPLIFY-NEXT: store i8 [[I8]], ptr [[I9]], align 1
+; FULL-SIMPLIFY-NEXT: [[I11:%.*]] = load ptr, ptr [[I]], align 32
; FULL-SIMPLIFY-NEXT: call void @may_throw()
-; FULL-SIMPLIFY-NEXT: [[I13:%.*]] = bitcast %struct.S* [[I5]] to i8*
-; FULL-SIMPLIFY-NEXT: [[I14:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: [[I15:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I14]], i32 0, i32 0
-; FULL-SIMPLIFY-NEXT: [[I16:%.*]] = load i32, i32* [[I15]], align 8
-; FULL-SIMPLIFY-NEXT: [[I17:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I17]], i32 0, i32 1
-; FULL-SIMPLIFY-NEXT: [[I19:%.*]] = load i8, i8* [[I18]], align 8
+; FULL-SIMPLIFY-NEXT: [[I14:%.*]] = load ptr, ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: [[I16:%.*]] = load i32, ptr [[I14]], align 8
+; FULL-SIMPLIFY-NEXT: [[I17:%.*]] = load ptr, ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I17]], i32 0, i32 1
+; FULL-SIMPLIFY-NEXT: [[I19:%.*]] = load i8, ptr [[I18]], align 8
; FULL-SIMPLIFY-NEXT: [[I20:%.*]] = sext i8 [[I19]] to i32
; FULL-SIMPLIFY-NEXT: [[I21:%.*]] = add nsw i32 [[I16]], [[I20]]
-; FULL-SIMPLIFY-NEXT: [[I22:%.*]] = load %struct.S*, %struct.S** [[I]], align 8
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.S* [[I14]], i64 4), "align"(%struct.S* [[I14]], i64 8), "dereferenceable"(%struct.S* [[I17]], i64 5), "align"(%struct.S* [[I17]], i64 4), "dereferenceable"(%struct.S* [[I22]], i64 16), "align"(%struct.S* [[I22]], i64 8) ]
-; FULL-SIMPLIFY-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[I22]], i32 0, i32 2
-; FULL-SIMPLIFY-NEXT: [[I24:%.*]] = load i32*, i32** [[I23]], align 8
-; FULL-SIMPLIFY-NEXT: [[I25:%.*]] = load i32, i32* [[I24]], align 4
+; FULL-SIMPLIFY-NEXT: [[I22:%.*]] = load ptr, ptr [[I]], align 8
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I17]], i64 5), "align"(ptr [[I17]], i64 4), "dereferenceable"(ptr [[I22]], i64 16), "align"(ptr [[I22]], i64 8) ]
+; FULL-SIMPLIFY-NEXT: [[I23:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[I22]], i32 0, i32 2
+; FULL-SIMPLIFY-NEXT: [[I24:%.*]] = load ptr, ptr [[I23]], align 8
+; FULL-SIMPLIFY-NEXT: [[I25:%.*]] = load i32, ptr [[I24]], align 4
; FULL-SIMPLIFY-NEXT: [[I26:%.*]] = add nsw i32 [[I21]], [[I25]]
; FULL-SIMPLIFY-NEXT: ret i32 [[I26]]
;
bb:
- %i = alloca %struct.S*, align 8
- %i3 = alloca i32*, align 8
- %i4 = alloca i8*, align 8
+ %i = alloca ptr, align 8
+ %i3 = alloca ptr, align 8
+ %i4 = alloca ptr, align 8
%i5 = alloca %struct.S, align 8
- store %struct.S* %arg, %struct.S** %i, align 8
- store i32* %arg1, i32** %i3, align 8
- store i8* %arg2, i8** %i4, align 8
- %i6 = load i32*, i32** %i3, align 8
- %i7 = load i32, i32* %i6, align 4
+ store ptr %arg, ptr %i, align 8
+ store ptr %arg1, ptr %i3, align 8
+ store ptr %arg2, ptr %i4, align 8
+ %i6 = load ptr, ptr %i3, align 8
+ %i7 = load i32, ptr %i6, align 4
%i8 = trunc i32 %i7 to i8
- %i9 = load i8*, i8** %i4, align 8
- store i8 %i8, i8* %i9, align 1
- %i10 = bitcast %struct.S* %i5 to i8*
- %i11 = load %struct.S*, %struct.S** %i, align 32
- %i12 = bitcast %struct.S* %i11 to i8*
+ %i9 = load ptr, ptr %i4, align 8
+ store i8 %i8, ptr %i9, align 1
+ %i11 = load ptr, ptr %i, align 32
call void @may_throw()
- %i13 = bitcast %struct.S* %i5 to i8*
- %i14 = load %struct.S*, %struct.S** %i, align 8
- %i15 = getelementptr inbounds %struct.S, %struct.S* %i14, i32 0, i32 0
- %i16 = load i32, i32* %i15, align 8
- %i17 = load %struct.S*, %struct.S** %i, align 8
- %i18 = getelementptr inbounds %struct.S, %struct.S* %i17, i32 0, i32 1
- %i19 = load i8, i8* %i18, align 8
+ %i14 = load ptr, ptr %i, align 8
+ %i16 = load i32, ptr %i14, align 8
+ %i17 = load ptr, ptr %i, align 8
+ %i18 = getelementptr inbounds %struct.S, ptr %i17, i32 0, i32 1
+ %i19 = load i8, ptr %i18, align 8
%i20 = sext i8 %i19 to i32
%i21 = add nsw i32 %i16, %i20
- %i22 = load %struct.S*, %struct.S** %i, align 8
- %i23 = getelementptr inbounds %struct.S, %struct.S* %i22, i32 0, i32 2
- %i24 = load i32*, i32** %i23, align 8
- %i25 = load i32, i32* %i24, align 4
+ %i22 = load ptr, ptr %i, align 8
+ %i23 = getelementptr inbounds %struct.S, ptr %i22, i32 0, i32 2
+ %i24 = load ptr, ptr %i23, align 8
+ %i25 = load i32, ptr %i24, align 4
%i26 = add nsw i32 %i21, %i25
ret i32 %i26
}
-define dso_local i32 @_Z6squarePi(i32* %P, i32* %P1, i1 %cond) {
+define dso_local i32 @_Z6squarePi(ptr %P, ptr %P1, i1 %cond) {
; BASIC-LABEL: define {{[^@]+}}@_Z6squarePi
-; BASIC-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i1 [[COND:%.*]]) {
+; BASIC-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], i1 [[COND:%.*]]) {
; BASIC-NEXT: bb:
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 4) ]
-; BASIC-NEXT: store i32 0, i32* [[P]], align 4
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; BASIC-NEXT: store i32 0, i32* [[P1]], align 8
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 4) ]
+; BASIC-NEXT: store i32 0, ptr [[P]], align 4
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; BASIC-NEXT: store i32 0, ptr [[P1]], align 8
; BASIC-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; BASIC: A:
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 8) ]
-; BASIC-NEXT: store i32 0, i32* [[P]], align 8
-; BASIC-NEXT: store i32 0, i32* [[P1]], align 4
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 8) ]
+; BASIC-NEXT: store i32 0, ptr [[P]], align 8
+; BASIC-NEXT: store i32 0, ptr [[P1]], align 4
; BASIC-NEXT: br i1 [[COND]], label [[C:%.*]], label [[B]]
; BASIC: B:
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 8) ]
-; BASIC-NEXT: store i32 0, i32* [[P]], align 8
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; BASIC-NEXT: store i32 0, i32* [[P1]], align 8
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 8) ]
+; BASIC-NEXT: store i32 0, ptr [[P]], align 8
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; BASIC-NEXT: store i32 0, ptr [[P1]], align 8
; BASIC-NEXT: br label [[C]]
; BASIC: C:
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 32) ]
-; BASIC-NEXT: store i32 0, i32* [[P]], align 32
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 4) ]
-; BASIC-NEXT: store i32 0, i32* [[P1]], align 4
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 32) ]
+; BASIC-NEXT: store i32 0, ptr [[P]], align 32
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 4) ]
+; BASIC-NEXT: store i32 0, ptr [[P1]], align 4
; BASIC-NEXT: ret i32 0
;
; ALL-LABEL: define {{[^@]+}}@_Z6squarePi
-; ALL-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i1 [[COND:%.*]]) {
+; ALL-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], i1 [[COND:%.*]]) {
; ALL-NEXT: bb:
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 4) ]
-; ALL-NEXT: store i32 0, i32* [[P]], align 4
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; ALL-NEXT: store i32 0, i32* [[P1]], align 8
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 4) ]
+; ALL-NEXT: store i32 0, ptr [[P]], align 4
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; ALL-NEXT: store i32 0, ptr [[P1]], align 8
; ALL-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; ALL: A:
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 8) ]
-; ALL-NEXT: store i32 0, i32* [[P]], align 8
-; ALL-NEXT: store i32 0, i32* [[P1]], align 4
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 8) ]
+; ALL-NEXT: store i32 0, ptr [[P]], align 8
+; ALL-NEXT: store i32 0, ptr [[P1]], align 4
; ALL-NEXT: br i1 [[COND]], label [[C:%.*]], label [[B]]
; ALL: B:
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 8) ]
-; ALL-NEXT: store i32 0, i32* [[P]], align 8
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; ALL-NEXT: store i32 0, i32* [[P1]], align 8
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 8) ]
+; ALL-NEXT: store i32 0, ptr [[P]], align 8
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; ALL-NEXT: store i32 0, ptr [[P1]], align 8
; ALL-NEXT: br label [[C]]
; ALL: C:
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 32) ]
-; ALL-NEXT: store i32 0, i32* [[P]], align 32
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 4) ]
-; ALL-NEXT: store i32 0, i32* [[P1]], align 4
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 32) ]
+; ALL-NEXT: store i32 0, ptr [[P]], align 32
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 4) ]
+; ALL-NEXT: store i32 0, ptr [[P1]], align 4
; ALL-NEXT: ret i32 0
;
; WITH-AC-LABEL: define {{[^@]+}}@_Z6squarePi
-; WITH-AC-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i1 [[COND:%.*]]) {
+; WITH-AC-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], i1 [[COND:%.*]]) {
; WITH-AC-NEXT: bb:
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 4) ]
-; WITH-AC-NEXT: store i32 0, i32* [[P]], align 4
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; WITH-AC-NEXT: store i32 0, i32* [[P1]], align 8
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 4) ]
+; WITH-AC-NEXT: store i32 0, ptr [[P]], align 4
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; WITH-AC-NEXT: store i32 0, ptr [[P1]], align 8
; WITH-AC-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; WITH-AC: A:
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 8) ]
-; WITH-AC-NEXT: store i32 0, i32* [[P]], align 8
-; WITH-AC-NEXT: store i32 0, i32* [[P1]], align 4
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 8) ]
+; WITH-AC-NEXT: store i32 0, ptr [[P]], align 8
+; WITH-AC-NEXT: store i32 0, ptr [[P1]], align 4
; WITH-AC-NEXT: br i1 [[COND]], label [[C:%.*]], label [[B]]
; WITH-AC: B:
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 8) ]
-; WITH-AC-NEXT: store i32 0, i32* [[P]], align 8
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; WITH-AC-NEXT: store i32 0, i32* [[P1]], align 8
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 8) ]
+; WITH-AC-NEXT: store i32 0, ptr [[P]], align 8
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; WITH-AC-NEXT: store i32 0, ptr [[P1]], align 8
; WITH-AC-NEXT: br label [[C]]
; WITH-AC: C:
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 32) ]
-; WITH-AC-NEXT: store i32 0, i32* [[P]], align 32
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 4) ]
-; WITH-AC-NEXT: store i32 0, i32* [[P1]], align 4
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 32) ]
+; WITH-AC-NEXT: store i32 0, ptr [[P]], align 32
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 4) ]
+; WITH-AC-NEXT: store i32 0, ptr [[P1]], align 4
; WITH-AC-NEXT: ret i32 0
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@_Z6squarePi
-; CROSS-BLOCK-SAME: (i32* [[P:%.*]], i32* [[P1:%.*]], i1 [[COND:%.*]]) {
+; CROSS-BLOCK-SAME: (ptr [[P:%.*]], ptr [[P1:%.*]], i1 [[COND:%.*]]) {
; CROSS-BLOCK-NEXT: bb:
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P]], i64 4), "nonnull"(i32* [[P]]), "align"(i32* [[P]], i64 4) ]
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[P]], align 4
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[P1]], i64 4), "nonnull"(i32* [[P1]]), "align"(i32* [[P1]], i64 8) ]
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[P1]], align 8
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 4), "nonnull"(ptr [[P]]), "align"(ptr [[P]], i64 4) ]
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[P]], align 4
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P1]], i64 4), "nonnull"(ptr [[P1]]), "align"(ptr [[P1]], i64 8) ]
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[P1]], align 8
; CROSS-BLOCK-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; CROSS-BLOCK: A:
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 8) ]
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[P]], align 8
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[P1]], align 4
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 8) ]
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[P]], align 8
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[P1]], align 4
; CROSS-BLOCK-NEXT: br i1 [[COND]], label [[C:%.*]], label [[B]]
; CROSS-BLOCK: B:
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 8) ]
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[P]], align 8
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[P1]], align 8
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 8) ]
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[P]], align 8
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[P1]], align 8
; CROSS-BLOCK-NEXT: br label [[C]]
; CROSS-BLOCK: C:
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 32) ]
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[P]], align 32
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[P1]], align 4
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 32) ]
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[P]], align 32
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[P1]], align 4
; CROSS-BLOCK-NEXT: ret i32 0
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@_Z6squarePi
-; FULL-SIMPLIFY-SAME: (i32* nonnull align 4 dereferenceable(4) [[P:%.*]], i32* nonnull align 8 dereferenceable(4) [[P1:%.*]], i1 [[COND:%.*]]) {
+; FULL-SIMPLIFY-SAME: (ptr nonnull align 4 dereferenceable(4) [[P:%.*]], ptr nonnull align 8 dereferenceable(4) [[P1:%.*]], i1 [[COND:%.*]]) {
; FULL-SIMPLIFY-NEXT: bb:
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[P]], align 4
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[P1]], align 8
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[P]], align 4
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[P1]], align 8
; FULL-SIMPLIFY-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; FULL-SIMPLIFY: A:
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[P]], i64 8) ]
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[P]], align 8
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[P1]], align 4
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 8) ]
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[P]], align 8
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[P1]], align 4
; FULL-SIMPLIFY-NEXT: br i1 [[COND]], label [[C:%.*]], label [[B]]
; FULL-SIMPLIFY: B:
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "ignore"(i32* undef, i64 4), "ignore"(i32* undef), "align"(i32* [[P]], i64 8) ]
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[P]], align 8
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[P1]], align 8
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "ignore"(ptr undef, i64 4), "ignore"(ptr undef), "align"(ptr [[P]], i64 8) ]
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[P]], align 8
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[P1]], align 8
; FULL-SIMPLIFY-NEXT: br label [[C]]
; FULL-SIMPLIFY: C:
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "ignore"(i32* undef, i64 4), "ignore"(i32* undef), "align"(i32* [[P]], i64 32) ]
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[P]], align 32
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[P1]], align 4
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "ignore"(ptr undef, i64 4), "ignore"(ptr undef), "align"(ptr [[P]], i64 32) ]
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[P]], align 32
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[P1]], align 4
; FULL-SIMPLIFY-NEXT: ret i32 0
;
bb:
- store i32 0, i32* %P, align 4
- store i32 0, i32* %P1, align 8
+ store i32 0, ptr %P, align 4
+ store i32 0, ptr %P1, align 8
br i1 %cond, label %A, label %B
A: ; preds = %bb
- store i32 0, i32* %P, align 8
- store i32 0, i32* %P1, align 4
+ store i32 0, ptr %P, align 8
+ store i32 0, ptr %P1, align 4
br i1 %cond, label %C, label %B
B: ; preds = %A, %bb
- store i32 0, i32* %P, align 8
- store i32 0, i32* %P1, align 8
+ store i32 0, ptr %P, align 8
+ store i32 0, ptr %P1, align 8
br label %C
C: ; preds = %B, %A
- store i32 0, i32* %P, align 32
- store i32 0, i32* %P1, align 4
+ store i32 0, ptr %P, align 32
+ store i32 0, ptr %P1, align 4
ret i32 0
}
-define dso_local i32 @test4A(i32* %arg, i32* %arg1, i32 %arg2, i32 %arg3) {
+define dso_local i32 @test4A(ptr %arg, ptr %arg1, i32 %arg2, i32 %arg3) {
; BASIC-LABEL: define {{[^@]+}}@test4A
-; BASIC-SAME: (i32* [[ARG:%.*]], i32* [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
+; BASIC-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
; BASIC-NEXT: bb:
-; BASIC-NEXT: [[I:%.*]] = icmp ne i32* [[ARG1]], null
+; BASIC-NEXT: [[I:%.*]] = icmp ne ptr [[ARG1]], null
; BASIC-NEXT: br i1 [[I]], label [[BB4:%.*]], label [[BB10:%.*]]
; BASIC: bb4:
; BASIC-NEXT: [[I5:%.*]] = add nsw i32 [[ARG3]], [[ARG2]]
; BASIC-NEXT: call void @may_throw()
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG]], i64 4), "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4) ]
-; BASIC-NEXT: [[I6:%.*]] = load i32, i32* [[ARG]], align 4
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 4), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4) ]
+; BASIC-NEXT: [[I6:%.*]] = load i32, ptr [[ARG]], align 4
; BASIC-NEXT: [[I7:%.*]] = add nsw i32 [[I5]], [[I6]]
-; BASIC-NEXT: store i32 0, i32* [[ARG]], align 4
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG1]], i64 4), "nonnull"(i32* [[ARG1]]), "align"(i32* [[ARG1]], i64 4) ]
-; BASIC-NEXT: [[I8:%.*]] = load i32, i32* [[ARG1]], align 4
+; BASIC-NEXT: store i32 0, ptr [[ARG]], align 4
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG1]], i64 4), "nonnull"(ptr [[ARG1]]), "align"(ptr [[ARG1]], i64 4) ]
+; BASIC-NEXT: [[I8:%.*]] = load i32, ptr [[ARG1]], align 4
; BASIC-NEXT: [[I9:%.*]] = add nsw i32 [[I7]], [[I8]]
; BASIC-NEXT: call void @may_throw()
-; BASIC-NEXT: store i32 [[I9]], i32* [[ARG1]], align 4
+; BASIC-NEXT: store i32 [[I9]], ptr [[ARG1]], align 4
; BASIC-NEXT: br label [[BB10]]
; BASIC: bb10:
; BASIC-NEXT: ret i32 0
;
; ALL-LABEL: define {{[^@]+}}@test4A
-; ALL-SAME: (i32* [[ARG:%.*]], i32* [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
+; ALL-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
; ALL-NEXT: bb:
-; ALL-NEXT: [[I:%.*]] = icmp ne i32* [[ARG1]], null
+; ALL-NEXT: [[I:%.*]] = icmp ne ptr [[ARG1]], null
; ALL-NEXT: br i1 [[I]], label [[BB4:%.*]], label [[BB10:%.*]]
; ALL: bb4:
; ALL-NEXT: [[I5:%.*]] = add nsw i32 [[ARG3]], [[ARG2]]
; ALL-NEXT: call void @may_throw()
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG]], i64 4), "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4) ]
-; ALL-NEXT: [[I6:%.*]] = load i32, i32* [[ARG]], align 4
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 4), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4) ]
+; ALL-NEXT: [[I6:%.*]] = load i32, ptr [[ARG]], align 4
; ALL-NEXT: [[I7:%.*]] = add nsw i32 [[I5]], [[I6]]
-; ALL-NEXT: store i32 0, i32* [[ARG]], align 4
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG1]], i64 4), "nonnull"(i32* [[ARG1]]), "align"(i32* [[ARG1]], i64 4) ]
-; ALL-NEXT: [[I8:%.*]] = load i32, i32* [[ARG1]], align 4
+; ALL-NEXT: store i32 0, ptr [[ARG]], align 4
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG1]], i64 4), "nonnull"(ptr [[ARG1]]), "align"(ptr [[ARG1]], i64 4) ]
+; ALL-NEXT: [[I8:%.*]] = load i32, ptr [[ARG1]], align 4
; ALL-NEXT: [[I9:%.*]] = add nsw i32 [[I7]], [[I8]]
; ALL-NEXT: call void @may_throw()
-; ALL-NEXT: store i32 [[I9]], i32* [[ARG1]], align 4
+; ALL-NEXT: store i32 [[I9]], ptr [[ARG1]], align 4
; ALL-NEXT: br label [[BB10]]
; ALL: bb10:
; ALL-NEXT: ret i32 0
;
; WITH-AC-LABEL: define {{[^@]+}}@test4A
-; WITH-AC-SAME: (i32* [[ARG:%.*]], i32* [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
+; WITH-AC-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
; WITH-AC-NEXT: bb:
-; WITH-AC-NEXT: [[I:%.*]] = icmp ne i32* [[ARG1]], null
+; WITH-AC-NEXT: [[I:%.*]] = icmp ne ptr [[ARG1]], null
; WITH-AC-NEXT: br i1 [[I]], label [[BB4:%.*]], label [[BB10:%.*]]
; WITH-AC: bb4:
; WITH-AC-NEXT: [[I5:%.*]] = add nsw i32 [[ARG3]], [[ARG2]]
; WITH-AC-NEXT: call void @may_throw()
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG]], i64 4), "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4) ]
-; WITH-AC-NEXT: [[I6:%.*]] = load i32, i32* [[ARG]], align 4
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 4), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4) ]
+; WITH-AC-NEXT: [[I6:%.*]] = load i32, ptr [[ARG]], align 4
; WITH-AC-NEXT: [[I7:%.*]] = add nsw i32 [[I5]], [[I6]]
-; WITH-AC-NEXT: store i32 0, i32* [[ARG]], align 4
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG1]], i64 4), "nonnull"(i32* [[ARG1]]), "align"(i32* [[ARG1]], i64 4) ]
-; WITH-AC-NEXT: [[I8:%.*]] = load i32, i32* [[ARG1]], align 4
+; WITH-AC-NEXT: store i32 0, ptr [[ARG]], align 4
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG1]], i64 4), "nonnull"(ptr [[ARG1]]), "align"(ptr [[ARG1]], i64 4) ]
+; WITH-AC-NEXT: [[I8:%.*]] = load i32, ptr [[ARG1]], align 4
; WITH-AC-NEXT: [[I9:%.*]] = add nsw i32 [[I7]], [[I8]]
; WITH-AC-NEXT: call void @may_throw()
-; WITH-AC-NEXT: store i32 [[I9]], i32* [[ARG1]], align 4
+; WITH-AC-NEXT: store i32 [[I9]], ptr [[ARG1]], align 4
; WITH-AC-NEXT: br label [[BB10]]
; WITH-AC: bb10:
; WITH-AC-NEXT: ret i32 0
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@test4A
-; CROSS-BLOCK-SAME: (i32* [[ARG:%.*]], i32* [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
+; CROSS-BLOCK-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
; CROSS-BLOCK-NEXT: bb:
-; CROSS-BLOCK-NEXT: [[I:%.*]] = icmp ne i32* [[ARG1]], null
+; CROSS-BLOCK-NEXT: [[I:%.*]] = icmp ne ptr [[ARG1]], null
; CROSS-BLOCK-NEXT: br i1 [[I]], label [[BB4:%.*]], label [[BB10:%.*]]
; CROSS-BLOCK: bb4:
; CROSS-BLOCK-NEXT: [[I5:%.*]] = add nsw i32 [[ARG3]], [[ARG2]]
; CROSS-BLOCK-NEXT: call void @may_throw()
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG]], i64 4), "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4) ]
-; CROSS-BLOCK-NEXT: [[I6:%.*]] = load i32, i32* [[ARG]], align 4
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 4), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4) ]
+; CROSS-BLOCK-NEXT: [[I6:%.*]] = load i32, ptr [[ARG]], align 4
; CROSS-BLOCK-NEXT: [[I7:%.*]] = add nsw i32 [[I5]], [[I6]]
-; CROSS-BLOCK-NEXT: store i32 0, i32* [[ARG]], align 4
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG1]], i64 4), "nonnull"(i32* [[ARG1]]), "align"(i32* [[ARG1]], i64 4) ]
-; CROSS-BLOCK-NEXT: [[I8:%.*]] = load i32, i32* [[ARG1]], align 4
+; CROSS-BLOCK-NEXT: store i32 0, ptr [[ARG]], align 4
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG1]], i64 4), "nonnull"(ptr [[ARG1]]), "align"(ptr [[ARG1]], i64 4) ]
+; CROSS-BLOCK-NEXT: [[I8:%.*]] = load i32, ptr [[ARG1]], align 4
; CROSS-BLOCK-NEXT: [[I9:%.*]] = add nsw i32 [[I7]], [[I8]]
; CROSS-BLOCK-NEXT: call void @may_throw()
-; CROSS-BLOCK-NEXT: store i32 [[I9]], i32* [[ARG1]], align 4
+; CROSS-BLOCK-NEXT: store i32 [[I9]], ptr [[ARG1]], align 4
; CROSS-BLOCK-NEXT: br label [[BB10]]
; CROSS-BLOCK: bb10:
; CROSS-BLOCK-NEXT: ret i32 0
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@test4A
-; FULL-SIMPLIFY-SAME: (i32* [[ARG:%.*]], i32* [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
+; FULL-SIMPLIFY-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
; FULL-SIMPLIFY-NEXT: bb:
-; FULL-SIMPLIFY-NEXT: [[I:%.*]] = icmp ne i32* [[ARG1]], null
+; FULL-SIMPLIFY-NEXT: [[I:%.*]] = icmp ne ptr [[ARG1]], null
; FULL-SIMPLIFY-NEXT: br i1 [[I]], label [[BB4:%.*]], label [[BB10:%.*]]
; FULL-SIMPLIFY: bb4:
; FULL-SIMPLIFY-NEXT: [[I5:%.*]] = add nsw i32 [[ARG3]], [[ARG2]]
; FULL-SIMPLIFY-NEXT: call void @may_throw()
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG]], i64 4), "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4), "dereferenceable"(i32* [[ARG1]], i64 4), "nonnull"(i32* [[ARG1]]), "align"(i32* [[ARG1]], i64 4) ]
-; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = load i32, i32* [[ARG]], align 4
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 4), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4), "dereferenceable"(ptr [[ARG1]], i64 4), "nonnull"(ptr [[ARG1]]), "align"(ptr [[ARG1]], i64 4) ]
+; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = load i32, ptr [[ARG]], align 4
; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = add nsw i32 [[I5]], [[I6]]
-; FULL-SIMPLIFY-NEXT: store i32 0, i32* [[ARG]], align 4
-; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = load i32, i32* [[ARG1]], align 4
+; FULL-SIMPLIFY-NEXT: store i32 0, ptr [[ARG]], align 4
+; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = load i32, ptr [[ARG1]], align 4
; FULL-SIMPLIFY-NEXT: [[I9:%.*]] = add nsw i32 [[I7]], [[I8]]
; FULL-SIMPLIFY-NEXT: call void @may_throw()
-; FULL-SIMPLIFY-NEXT: store i32 [[I9]], i32* [[ARG1]], align 4
+; FULL-SIMPLIFY-NEXT: store i32 [[I9]], ptr [[ARG1]], align 4
; FULL-SIMPLIFY-NEXT: br label [[BB10]]
; FULL-SIMPLIFY: bb10:
; FULL-SIMPLIFY-NEXT: ret i32 0
;
bb:
- %i = icmp ne i32* %arg1, null
+ %i = icmp ne ptr %arg1, null
br i1 %i, label %bb4, label %bb10
bb4: ; preds = %bb
%i5 = add nsw i32 %arg3, %arg2
call void @may_throw()
- %i6 = load i32, i32* %arg, align 4
+ %i6 = load i32, ptr %arg, align 4
%i7 = add nsw i32 %i5, %i6
- store i32 0, i32* %arg, align 4
- %i8 = load i32, i32* %arg1, align 4
+ store i32 0, ptr %arg, align 4
+ %i8 = load i32, ptr %arg1, align 4
%i9 = add nsw i32 %i7, %i8
call void @may_throw()
- store i32 %i9, i32* %arg1, align 4
+ store i32 %i9, ptr %arg1, align 4
br label %bb10
bb10: ; preds = %bb4, %bb
ret i32 0
}
-declare void @may_throwv2(i32*)
+declare void @may_throwv2(ptr)
-define dso_local i32 @terminator(i32* %P) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define dso_local i32 @terminator(ptr %P) personality ptr @__gxx_personality_v0 {
; BASIC-LABEL: define {{[^@]+}}@terminator
-; BASIC-SAME: (i32* [[P:%.*]]) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+; BASIC-SAME: (ptr [[P:%.*]]) personality ptr @__gxx_personality_v0 {
; BASIC-NEXT: bb:
-; BASIC-NEXT: invoke void @may_throwv2(i32* nonnull [[P]])
+; BASIC-NEXT: invoke void @may_throwv2(ptr nonnull [[P]])
; BASIC-NEXT: to label [[EXIT:%.*]] unwind label [[CATCH:%.*]]
; BASIC: Catch:
-; BASIC-NEXT: [[V:%.*]] = landingpad { i8*, i32 }
-; BASIC-NEXT: catch i8* null
+; BASIC-NEXT: [[V:%.*]] = landingpad { ptr, i32 }
+; BASIC-NEXT: catch ptr null
; BASIC-NEXT: br label [[EXIT]]
; BASIC: Exit:
; BASIC-NEXT: [[DOT0:%.*]] = phi i32 [ 1, [[BB:%.*]] ], [ 0, [[CATCH]] ]
; BASIC-NEXT: ret i32 [[DOT0]]
;
; ALL-LABEL: define {{[^@]+}}@terminator
-; ALL-SAME: (i32* [[P:%.*]]) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+; ALL-SAME: (ptr [[P:%.*]]) personality ptr @__gxx_personality_v0 {
; ALL-NEXT: bb:
-; ALL-NEXT: invoke void @may_throwv2(i32* nonnull [[P]])
+; ALL-NEXT: invoke void @may_throwv2(ptr nonnull [[P]])
; ALL-NEXT: to label [[EXIT:%.*]] unwind label [[CATCH:%.*]]
; ALL: Catch:
-; ALL-NEXT: [[V:%.*]] = landingpad { i8*, i32 }
-; ALL-NEXT: catch i8* null
+; ALL-NEXT: [[V:%.*]] = landingpad { ptr, i32 }
+; ALL-NEXT: catch ptr null
; ALL-NEXT: br label [[EXIT]]
; ALL: Exit:
; ALL-NEXT: [[DOT0:%.*]] = phi i32 [ 1, [[BB:%.*]] ], [ 0, [[CATCH]] ]
; ALL-NEXT: ret i32 [[DOT0]]
;
; WITH-AC-LABEL: define {{[^@]+}}@terminator
-; WITH-AC-SAME: (i32* [[P:%.*]]) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+; WITH-AC-SAME: (ptr [[P:%.*]]) personality ptr @__gxx_personality_v0 {
; WITH-AC-NEXT: bb:
-; WITH-AC-NEXT: invoke void @may_throwv2(i32* nonnull [[P]])
+; WITH-AC-NEXT: invoke void @may_throwv2(ptr nonnull [[P]])
; WITH-AC-NEXT: to label [[EXIT:%.*]] unwind label [[CATCH:%.*]]
; WITH-AC: Catch:
-; WITH-AC-NEXT: [[V:%.*]] = landingpad { i8*, i32 }
-; WITH-AC-NEXT: catch i8* null
+; WITH-AC-NEXT: [[V:%.*]] = landingpad { ptr, i32 }
+; WITH-AC-NEXT: catch ptr null
; WITH-AC-NEXT: br label [[EXIT]]
; WITH-AC: Exit:
; WITH-AC-NEXT: [[DOT0:%.*]] = phi i32 [ 1, [[BB:%.*]] ], [ 0, [[CATCH]] ]
; WITH-AC-NEXT: ret i32 [[DOT0]]
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@terminator
-; CROSS-BLOCK-SAME: (i32* [[P:%.*]]) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+; CROSS-BLOCK-SAME: (ptr [[P:%.*]]) personality ptr @__gxx_personality_v0 {
; CROSS-BLOCK-NEXT: bb:
-; CROSS-BLOCK-NEXT: invoke void @may_throwv2(i32* nonnull [[P]])
+; CROSS-BLOCK-NEXT: invoke void @may_throwv2(ptr nonnull [[P]])
; CROSS-BLOCK-NEXT: to label [[EXIT:%.*]] unwind label [[CATCH:%.*]]
; CROSS-BLOCK: Catch:
-; CROSS-BLOCK-NEXT: [[V:%.*]] = landingpad { i8*, i32 }
-; CROSS-BLOCK-NEXT: catch i8* null
+; CROSS-BLOCK-NEXT: [[V:%.*]] = landingpad { ptr, i32 }
+; CROSS-BLOCK-NEXT: catch ptr null
; CROSS-BLOCK-NEXT: br label [[EXIT]]
; CROSS-BLOCK: Exit:
; CROSS-BLOCK-NEXT: [[DOT0:%.*]] = phi i32 [ 1, [[BB:%.*]] ], [ 0, [[CATCH]] ]
; CROSS-BLOCK-NEXT: ret i32 [[DOT0]]
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@terminator
-; FULL-SIMPLIFY-SAME: (i32* [[P:%.*]]) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+; FULL-SIMPLIFY-SAME: (ptr [[P:%.*]]) personality ptr @__gxx_personality_v0 {
; FULL-SIMPLIFY-NEXT: bb:
-; FULL-SIMPLIFY-NEXT: invoke void @may_throwv2(i32* nonnull [[P]])
+; FULL-SIMPLIFY-NEXT: invoke void @may_throwv2(ptr nonnull [[P]])
; FULL-SIMPLIFY-NEXT: to label [[EXIT:%.*]] unwind label [[CATCH:%.*]]
; FULL-SIMPLIFY: Catch:
-; FULL-SIMPLIFY-NEXT: [[V:%.*]] = landingpad { i8*, i32 }
-; FULL-SIMPLIFY-NEXT: catch i8* null
+; FULL-SIMPLIFY-NEXT: [[V:%.*]] = landingpad { ptr, i32 }
+; FULL-SIMPLIFY-NEXT: catch ptr null
; FULL-SIMPLIFY-NEXT: br label [[EXIT]]
; FULL-SIMPLIFY: Exit:
; FULL-SIMPLIFY-NEXT: [[DOT0:%.*]] = phi i32 [ 1, [[BB:%.*]] ], [ 0, [[CATCH]] ]
; FULL-SIMPLIFY-NEXT: ret i32 [[DOT0]]
;
bb:
- invoke void @may_throwv2(i32* nonnull %P)
+ invoke void @may_throwv2(ptr nonnull %P)
to label %Exit unwind label %Catch
Catch: ; preds = %bb
- %v = landingpad { i8*, i32 }
- catch i8* null
+ %v = landingpad { ptr, i32 }
+ catch ptr null
br label %Exit
Exit: ; preds = %Catch, %bb
@@ -963,114 +907,102 @@ Exit: ; preds = %Catch, %bb
declare dso_local i32 @__gxx_personality_v0(...)
-define dso_local i32 @test5(i8* %arg, i32 %arg1) {
+define dso_local i32 @test5(ptr %arg, i32 %arg1) {
; BASIC-LABEL: define {{[^@]+}}@test5
-; BASIC-SAME: (i8* [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; BASIC-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; BASIC-NEXT: bb:
-; BASIC-NEXT: [[I:%.*]] = bitcast i8* [[ARG]] to i64*
-; BASIC-NEXT: [[I2:%.*]] = bitcast i8* [[ARG]] to i16*
; BASIC-NEXT: [[I3:%.*]] = sext i32 [[ARG1]] to i64
-; BASIC-NEXT: [[I4:%.*]] = getelementptr inbounds i16, i16* [[I2]], i64 [[I3]]
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i16* [[I4]], i64 2), "nonnull"(i8* [[ARG]]), "align"(i8* [[ARG]], i64 8) ]
-; BASIC-NEXT: [[I5:%.*]] = load i16, i16* [[I4]], align 2
-; BASIC-NEXT: [[A:%.*]] = load i16, i16* [[I4]], align 4
+; BASIC-NEXT: [[I4:%.*]] = getelementptr inbounds i16, ptr [[ARG]], i64 [[I3]]
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I4]], i64 2), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 8) ]
+; BASIC-NEXT: [[I5:%.*]] = load i16, ptr [[I4]], align 2
+; BASIC-NEXT: [[A:%.*]] = load i16, ptr [[I4]], align 4
; BASIC-NEXT: [[I6:%.*]] = sext i16 [[I5]] to i64
-; BASIC-NEXT: [[I7:%.*]] = getelementptr inbounds i64, i64* [[I]], i64 [[I6]]
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I7]], i64 8) ]
-; BASIC-NEXT: [[I8:%.*]] = load i64, i64* [[I7]], align 16
-; BASIC-NEXT: [[B:%.*]] = load i64, i64* [[I7]], align 32
+; BASIC-NEXT: [[I7:%.*]] = getelementptr inbounds i64, ptr [[ARG]], i64 [[I6]]
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I7]], i64 8) ]
+; BASIC-NEXT: [[I8:%.*]] = load i64, ptr [[I7]], align 16
+; BASIC-NEXT: [[B:%.*]] = load i64, ptr [[I7]], align 32
; BASIC-NEXT: [[I9:%.*]] = trunc i64 [[I8]] to i32
; BASIC-NEXT: ret i32 [[I9]]
;
; ALL-LABEL: define {{[^@]+}}@test5
-; ALL-SAME: (i8* [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; ALL-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; ALL-NEXT: bb:
-; ALL-NEXT: [[I:%.*]] = bitcast i8* [[ARG]] to i64*
-; ALL-NEXT: [[I2:%.*]] = bitcast i8* [[ARG]] to i16*
; ALL-NEXT: [[I3:%.*]] = sext i32 [[ARG1]] to i64
-; ALL-NEXT: [[I4:%.*]] = getelementptr inbounds i16, i16* [[I2]], i64 [[I3]]
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i16* [[I4]], i64 2), "nonnull"(i8* [[ARG]]), "align"(i8* [[ARG]], i64 8) ]
-; ALL-NEXT: [[I5:%.*]] = load i16, i16* [[I4]], align 2
-; ALL-NEXT: [[A:%.*]] = load i16, i16* [[I4]], align 4
+; ALL-NEXT: [[I4:%.*]] = getelementptr inbounds i16, ptr [[ARG]], i64 [[I3]]
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I4]], i64 2), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 8) ]
+; ALL-NEXT: [[I5:%.*]] = load i16, ptr [[I4]], align 2
+; ALL-NEXT: [[A:%.*]] = load i16, ptr [[I4]], align 4
; ALL-NEXT: [[I6:%.*]] = sext i16 [[I5]] to i64
-; ALL-NEXT: [[I7:%.*]] = getelementptr inbounds i64, i64* [[I]], i64 [[I6]]
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I7]], i64 8) ]
-; ALL-NEXT: [[I8:%.*]] = load i64, i64* [[I7]], align 16
-; ALL-NEXT: [[B:%.*]] = load i64, i64* [[I7]], align 32
+; ALL-NEXT: [[I7:%.*]] = getelementptr inbounds i64, ptr [[ARG]], i64 [[I6]]
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I7]], i64 8) ]
+; ALL-NEXT: [[I8:%.*]] = load i64, ptr [[I7]], align 16
+; ALL-NEXT: [[B:%.*]] = load i64, ptr [[I7]], align 32
; ALL-NEXT: [[I9:%.*]] = trunc i64 [[I8]] to i32
; ALL-NEXT: ret i32 [[I9]]
;
; WITH-AC-LABEL: define {{[^@]+}}@test5
-; WITH-AC-SAME: (i8* [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; WITH-AC-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; WITH-AC-NEXT: bb:
-; WITH-AC-NEXT: [[I:%.*]] = bitcast i8* [[ARG]] to i64*
-; WITH-AC-NEXT: [[I2:%.*]] = bitcast i8* [[ARG]] to i16*
; WITH-AC-NEXT: [[I3:%.*]] = sext i32 [[ARG1]] to i64
-; WITH-AC-NEXT: [[I4:%.*]] = getelementptr inbounds i16, i16* [[I2]], i64 [[I3]]
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i16* [[I4]], i64 2), "nonnull"(i8* [[ARG]]), "align"(i8* [[ARG]], i64 8) ]
-; WITH-AC-NEXT: [[I5:%.*]] = load i16, i16* [[I4]], align 2
-; WITH-AC-NEXT: [[A:%.*]] = load i16, i16* [[I4]], align 4
+; WITH-AC-NEXT: [[I4:%.*]] = getelementptr inbounds i16, ptr [[ARG]], i64 [[I3]]
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I4]], i64 2), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 8) ]
+; WITH-AC-NEXT: [[I5:%.*]] = load i16, ptr [[I4]], align 2
+; WITH-AC-NEXT: [[A:%.*]] = load i16, ptr [[I4]], align 4
; WITH-AC-NEXT: [[I6:%.*]] = sext i16 [[I5]] to i64
-; WITH-AC-NEXT: [[I7:%.*]] = getelementptr inbounds i64, i64* [[I]], i64 [[I6]]
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I7]], i64 8) ]
-; WITH-AC-NEXT: [[I8:%.*]] = load i64, i64* [[I7]], align 16
-; WITH-AC-NEXT: [[B:%.*]] = load i64, i64* [[I7]], align 32
+; WITH-AC-NEXT: [[I7:%.*]] = getelementptr inbounds i64, ptr [[ARG]], i64 [[I6]]
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I7]], i64 8) ]
+; WITH-AC-NEXT: [[I8:%.*]] = load i64, ptr [[I7]], align 16
+; WITH-AC-NEXT: [[B:%.*]] = load i64, ptr [[I7]], align 32
; WITH-AC-NEXT: [[I9:%.*]] = trunc i64 [[I8]] to i32
; WITH-AC-NEXT: ret i32 [[I9]]
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@test5
-; CROSS-BLOCK-SAME: (i8* [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; CROSS-BLOCK-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; CROSS-BLOCK-NEXT: bb:
-; CROSS-BLOCK-NEXT: [[I:%.*]] = bitcast i8* [[ARG]] to i64*
-; CROSS-BLOCK-NEXT: [[I2:%.*]] = bitcast i8* [[ARG]] to i16*
; CROSS-BLOCK-NEXT: [[I3:%.*]] = sext i32 [[ARG1]] to i64
-; CROSS-BLOCK-NEXT: [[I4:%.*]] = getelementptr inbounds i16, i16* [[I2]], i64 [[I3]]
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i16* [[I4]], i64 2), "nonnull"(i8* [[ARG]]), "align"(i8* [[ARG]], i64 8) ]
-; CROSS-BLOCK-NEXT: [[I5:%.*]] = load i16, i16* [[I4]], align 2
-; CROSS-BLOCK-NEXT: [[A:%.*]] = load i16, i16* [[I4]], align 4
+; CROSS-BLOCK-NEXT: [[I4:%.*]] = getelementptr inbounds i16, ptr [[ARG]], i64 [[I3]]
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I4]], i64 2), "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 8) ]
+; CROSS-BLOCK-NEXT: [[I5:%.*]] = load i16, ptr [[I4]], align 2
+; CROSS-BLOCK-NEXT: [[A:%.*]] = load i16, ptr [[I4]], align 4
; CROSS-BLOCK-NEXT: [[I6:%.*]] = sext i16 [[I5]] to i64
-; CROSS-BLOCK-NEXT: [[I7:%.*]] = getelementptr inbounds i64, i64* [[I]], i64 [[I6]]
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I7]], i64 8) ]
-; CROSS-BLOCK-NEXT: [[I8:%.*]] = load i64, i64* [[I7]], align 16
-; CROSS-BLOCK-NEXT: [[B:%.*]] = load i64, i64* [[I7]], align 32
+; CROSS-BLOCK-NEXT: [[I7:%.*]] = getelementptr inbounds i64, ptr [[ARG]], i64 [[I6]]
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I7]], i64 8) ]
+; CROSS-BLOCK-NEXT: [[I8:%.*]] = load i64, ptr [[I7]], align 16
+; CROSS-BLOCK-NEXT: [[B:%.*]] = load i64, ptr [[I7]], align 32
; CROSS-BLOCK-NEXT: [[I9:%.*]] = trunc i64 [[I8]] to i32
; CROSS-BLOCK-NEXT: ret i32 [[I9]]
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@test5
-; FULL-SIMPLIFY-SAME: (i8* nonnull align 8 [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; FULL-SIMPLIFY-SAME: (ptr nonnull align 8 [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; FULL-SIMPLIFY-NEXT: bb:
-; FULL-SIMPLIFY-NEXT: [[I:%.*]] = bitcast i8* [[ARG]] to i64*
-; FULL-SIMPLIFY-NEXT: [[I2:%.*]] = bitcast i8* [[ARG]] to i16*
; FULL-SIMPLIFY-NEXT: [[I3:%.*]] = sext i32 [[ARG1]] to i64
-; FULL-SIMPLIFY-NEXT: [[I4:%.*]] = getelementptr inbounds i16, i16* [[I2]], i64 [[I3]]
-; FULL-SIMPLIFY-NEXT: [[I5:%.*]] = load i16, i16* [[I4]], align 2
-; FULL-SIMPLIFY-NEXT: [[A:%.*]] = load i16, i16* [[I4]], align 4
+; FULL-SIMPLIFY-NEXT: [[I4:%.*]] = getelementptr inbounds i16, ptr [[ARG]], i64 [[I3]]
+; FULL-SIMPLIFY-NEXT: [[I5:%.*]] = load i16, ptr [[I4]], align 2
+; FULL-SIMPLIFY-NEXT: [[A:%.*]] = load i16, ptr [[I4]], align 4
; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = sext i16 [[I5]] to i64
-; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = getelementptr inbounds i64, i64* [[I]], i64 [[I6]]
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i16* [[I4]], i64 2), "dereferenceable"(i64* [[I7]], i64 8) ]
-; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = load i64, i64* [[I7]], align 16
-; FULL-SIMPLIFY-NEXT: [[B:%.*]] = load i64, i64* [[I7]], align 32
+; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = getelementptr inbounds i64, ptr [[ARG]], i64 [[I6]]
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I4]], i64 2), "dereferenceable"(ptr [[I7]], i64 8) ]
+; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = load i64, ptr [[I7]], align 16
+; FULL-SIMPLIFY-NEXT: [[B:%.*]] = load i64, ptr [[I7]], align 32
; FULL-SIMPLIFY-NEXT: [[I9:%.*]] = trunc i64 [[I8]] to i32
; FULL-SIMPLIFY-NEXT: ret i32 [[I9]]
;
bb:
- %i = bitcast i8* %arg to i64*
- %i2 = bitcast i8* %arg to i16*
%i3 = sext i32 %arg1 to i64
- %i4 = getelementptr inbounds i16, i16* %i2, i64 %i3
- %i5 = load i16, i16* %i4, align 2
- %A = load i16, i16* %i4, align 4
+ %i4 = getelementptr inbounds i16, ptr %arg, i64 %i3
+ %i5 = load i16, ptr %i4, align 2
+ %A = load i16, ptr %i4, align 4
%i6 = sext i16 %i5 to i64
- %i7 = getelementptr inbounds i64, i64* %i, i64 %i6
- %i8 = load i64, i64* %i7, align 16
- %B = load i64, i64* %i7, align 32
+ %i7 = getelementptr inbounds i64, ptr %arg, i64 %i6
+ %i8 = load i64, ptr %i7, align 16
+ %B = load i64, ptr %i7, align 32
%i9 = trunc i64 %i8 to i32
ret i32 %i9
}
-define i32 @test6(i32* %arg, i32 %arg1, i32* %arg2) {
+define i32 @test6(ptr %arg, i32 %arg1, ptr %arg2) {
; BASIC-LABEL: define {{[^@]+}}@test6
-; BASIC-SAME: (i32* [[ARG:%.*]], i32 [[ARG1:%.*]], i32* [[ARG2:%.*]]) {
+; BASIC-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; BASIC-NEXT: bb:
; BASIC-NEXT: br label [[BB3:%.*]]
; BASIC: bb3:
@@ -1080,27 +1012,27 @@ define i32 @test6(i32* %arg, i32 %arg1, i32* %arg2) {
; BASIC: bb4:
; BASIC-NEXT: [[I5:%.*]] = add nsw i32 [[ARG1]], [[DOT0]]
; BASIC-NEXT: [[I6:%.*]] = sext i32 [[I5]] to i64
-; BASIC-NEXT: [[I7:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I6]]
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4) ]
-; BASIC-NEXT: [[I8:%.*]] = load i32, i32* [[I7]], align 4
+; BASIC-NEXT: [[I7:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I6]]
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4) ]
+; BASIC-NEXT: [[I8:%.*]] = load i32, ptr [[I7]], align 4
; BASIC-NEXT: [[I9:%.*]] = mul nsw i32 [[DOT0]], [[I8]]
; BASIC-NEXT: [[I10:%.*]] = sext i32 [[DOT0]] to i64
-; BASIC-NEXT: [[I11:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I10]]
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[I11]], i64 4) ]
-; BASIC-NEXT: [[I12:%.*]] = load i32, i32* [[I11]], align 4
+; BASIC-NEXT: [[I11:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I10]]
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I11]], i64 4) ]
+; BASIC-NEXT: [[I12:%.*]] = load i32, ptr [[I11]], align 4
; BASIC-NEXT: [[I13:%.*]] = add nsw i32 [[I12]], [[I9]]
-; BASIC-NEXT: store i32 [[I13]], i32* [[I11]], align 4
+; BASIC-NEXT: store i32 [[I13]], ptr [[I11]], align 4
; BASIC-NEXT: [[I14]] = add nsw i32 [[DOT0]], 1
; BASIC-NEXT: br label [[BB3]]
; BASIC: bb15:
; BASIC-NEXT: [[I16:%.*]] = sext i32 [[ARG1]] to i64
-; BASIC-NEXT: [[I17:%.*]] = getelementptr inbounds i32, i32* [[ARG2]], i64 [[I16]]
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG2]]), "align"(i32* [[ARG2]], i64 4) ]
-; BASIC-NEXT: [[I18:%.*]] = load i32, i32* [[I17]], align 4
+; BASIC-NEXT: [[I17:%.*]] = getelementptr inbounds i32, ptr [[ARG2]], i64 [[I16]]
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG2]]), "align"(ptr [[ARG2]], i64 4) ]
+; BASIC-NEXT: [[I18:%.*]] = load i32, ptr [[I17]], align 4
; BASIC-NEXT: ret i32 [[I18]]
;
; ALL-LABEL: define {{[^@]+}}@test6
-; ALL-SAME: (i32* [[ARG:%.*]], i32 [[ARG1:%.*]], i32* [[ARG2:%.*]]) {
+; ALL-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; ALL-NEXT: bb:
; ALL-NEXT: br label [[BB3:%.*]]
; ALL: bb3:
@@ -1110,27 +1042,27 @@ define i32 @test6(i32* %arg, i32 %arg1, i32* %arg2) {
; ALL: bb4:
; ALL-NEXT: [[I5:%.*]] = add nsw i32 [[ARG1]], [[DOT0]]
; ALL-NEXT: [[I6:%.*]] = sext i32 [[I5]] to i64
-; ALL-NEXT: [[I7:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I6]]
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4) ]
-; ALL-NEXT: [[I8:%.*]] = load i32, i32* [[I7]], align 4
+; ALL-NEXT: [[I7:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I6]]
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4) ]
+; ALL-NEXT: [[I8:%.*]] = load i32, ptr [[I7]], align 4
; ALL-NEXT: [[I9:%.*]] = mul nsw i32 [[DOT0]], [[I8]]
; ALL-NEXT: [[I10:%.*]] = sext i32 [[DOT0]] to i64
-; ALL-NEXT: [[I11:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I10]]
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[I11]], i64 4) ]
-; ALL-NEXT: [[I12:%.*]] = load i32, i32* [[I11]], align 4
+; ALL-NEXT: [[I11:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I10]]
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I11]], i64 4) ]
+; ALL-NEXT: [[I12:%.*]] = load i32, ptr [[I11]], align 4
; ALL-NEXT: [[I13:%.*]] = add nsw i32 [[I12]], [[I9]]
-; ALL-NEXT: store i32 [[I13]], i32* [[I11]], align 4
+; ALL-NEXT: store i32 [[I13]], ptr [[I11]], align 4
; ALL-NEXT: [[I14]] = add nsw i32 [[DOT0]], 1
; ALL-NEXT: br label [[BB3]]
; ALL: bb15:
; ALL-NEXT: [[I16:%.*]] = sext i32 [[ARG1]] to i64
-; ALL-NEXT: [[I17:%.*]] = getelementptr inbounds i32, i32* [[ARG2]], i64 [[I16]]
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG2]]), "align"(i32* [[ARG2]], i64 4) ]
-; ALL-NEXT: [[I18:%.*]] = load i32, i32* [[I17]], align 4
+; ALL-NEXT: [[I17:%.*]] = getelementptr inbounds i32, ptr [[ARG2]], i64 [[I16]]
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG2]]), "align"(ptr [[ARG2]], i64 4) ]
+; ALL-NEXT: [[I18:%.*]] = load i32, ptr [[I17]], align 4
; ALL-NEXT: ret i32 [[I18]]
;
; WITH-AC-LABEL: define {{[^@]+}}@test6
-; WITH-AC-SAME: (i32* [[ARG:%.*]], i32 [[ARG1:%.*]], i32* [[ARG2:%.*]]) {
+; WITH-AC-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; WITH-AC-NEXT: bb:
; WITH-AC-NEXT: br label [[BB3:%.*]]
; WITH-AC: bb3:
@@ -1140,27 +1072,27 @@ define i32 @test6(i32* %arg, i32 %arg1, i32* %arg2) {
; WITH-AC: bb4:
; WITH-AC-NEXT: [[I5:%.*]] = add nsw i32 [[ARG1]], [[DOT0]]
; WITH-AC-NEXT: [[I6:%.*]] = sext i32 [[I5]] to i64
-; WITH-AC-NEXT: [[I7:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I6]]
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4) ]
-; WITH-AC-NEXT: [[I8:%.*]] = load i32, i32* [[I7]], align 4
+; WITH-AC-NEXT: [[I7:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I6]]
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4) ]
+; WITH-AC-NEXT: [[I8:%.*]] = load i32, ptr [[I7]], align 4
; WITH-AC-NEXT: [[I9:%.*]] = mul nsw i32 [[DOT0]], [[I8]]
; WITH-AC-NEXT: [[I10:%.*]] = sext i32 [[DOT0]] to i64
-; WITH-AC-NEXT: [[I11:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I10]]
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[I11]], i64 4) ]
-; WITH-AC-NEXT: [[I12:%.*]] = load i32, i32* [[I11]], align 4
+; WITH-AC-NEXT: [[I11:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I10]]
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I11]], i64 4) ]
+; WITH-AC-NEXT: [[I12:%.*]] = load i32, ptr [[I11]], align 4
; WITH-AC-NEXT: [[I13:%.*]] = add nsw i32 [[I12]], [[I9]]
-; WITH-AC-NEXT: store i32 [[I13]], i32* [[I11]], align 4
+; WITH-AC-NEXT: store i32 [[I13]], ptr [[I11]], align 4
; WITH-AC-NEXT: [[I14]] = add nsw i32 [[DOT0]], 1
; WITH-AC-NEXT: br label [[BB3]]
; WITH-AC: bb15:
; WITH-AC-NEXT: [[I16:%.*]] = sext i32 [[ARG1]] to i64
-; WITH-AC-NEXT: [[I17:%.*]] = getelementptr inbounds i32, i32* [[ARG2]], i64 [[I16]]
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG2]]), "align"(i32* [[ARG2]], i64 4) ]
-; WITH-AC-NEXT: [[I18:%.*]] = load i32, i32* [[I17]], align 4
+; WITH-AC-NEXT: [[I17:%.*]] = getelementptr inbounds i32, ptr [[ARG2]], i64 [[I16]]
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG2]]), "align"(ptr [[ARG2]], i64 4) ]
+; WITH-AC-NEXT: [[I18:%.*]] = load i32, ptr [[I17]], align 4
; WITH-AC-NEXT: ret i32 [[I18]]
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@test6
-; CROSS-BLOCK-SAME: (i32* [[ARG:%.*]], i32 [[ARG1:%.*]], i32* [[ARG2:%.*]]) {
+; CROSS-BLOCK-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; CROSS-BLOCK-NEXT: bb:
; CROSS-BLOCK-NEXT: br label [[BB3:%.*]]
; CROSS-BLOCK: bb3:
@@ -1170,27 +1102,27 @@ define i32 @test6(i32* %arg, i32 %arg1, i32* %arg2) {
; CROSS-BLOCK: bb4:
; CROSS-BLOCK-NEXT: [[I5:%.*]] = add nsw i32 [[ARG1]], [[DOT0]]
; CROSS-BLOCK-NEXT: [[I6:%.*]] = sext i32 [[I5]] to i64
-; CROSS-BLOCK-NEXT: [[I7:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I6]]
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4) ]
-; CROSS-BLOCK-NEXT: [[I8:%.*]] = load i32, i32* [[I7]], align 4
+; CROSS-BLOCK-NEXT: [[I7:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I6]]
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4) ]
+; CROSS-BLOCK-NEXT: [[I8:%.*]] = load i32, ptr [[I7]], align 4
; CROSS-BLOCK-NEXT: [[I9:%.*]] = mul nsw i32 [[DOT0]], [[I8]]
; CROSS-BLOCK-NEXT: [[I10:%.*]] = sext i32 [[DOT0]] to i64
-; CROSS-BLOCK-NEXT: [[I11:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I10]]
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[I11]], i64 4) ]
-; CROSS-BLOCK-NEXT: [[I12:%.*]] = load i32, i32* [[I11]], align 4
+; CROSS-BLOCK-NEXT: [[I11:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I10]]
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I11]], i64 4) ]
+; CROSS-BLOCK-NEXT: [[I12:%.*]] = load i32, ptr [[I11]], align 4
; CROSS-BLOCK-NEXT: [[I13:%.*]] = add nsw i32 [[I12]], [[I9]]
-; CROSS-BLOCK-NEXT: store i32 [[I13]], i32* [[I11]], align 4
+; CROSS-BLOCK-NEXT: store i32 [[I13]], ptr [[I11]], align 4
; CROSS-BLOCK-NEXT: [[I14]] = add nsw i32 [[DOT0]], 1
; CROSS-BLOCK-NEXT: br label [[BB3]]
; CROSS-BLOCK: bb15:
; CROSS-BLOCK-NEXT: [[I16:%.*]] = sext i32 [[ARG1]] to i64
-; CROSS-BLOCK-NEXT: [[I17:%.*]] = getelementptr inbounds i32, i32* [[ARG2]], i64 [[I16]]
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG2]]), "align"(i32* [[ARG2]], i64 4) ]
-; CROSS-BLOCK-NEXT: [[I18:%.*]] = load i32, i32* [[I17]], align 4
+; CROSS-BLOCK-NEXT: [[I17:%.*]] = getelementptr inbounds i32, ptr [[ARG2]], i64 [[I16]]
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG2]]), "align"(ptr [[ARG2]], i64 4) ]
+; CROSS-BLOCK-NEXT: [[I18:%.*]] = load i32, ptr [[I17]], align 4
; CROSS-BLOCK-NEXT: ret i32 [[I18]]
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@test6
-; FULL-SIMPLIFY-SAME: (i32* [[ARG:%.*]], i32 [[ARG1:%.*]], i32* [[ARG2:%.*]]) {
+; FULL-SIMPLIFY-SAME: (ptr [[ARG:%.*]], i32 [[ARG1:%.*]], ptr [[ARG2:%.*]]) {
; FULL-SIMPLIFY-NEXT: bb:
; FULL-SIMPLIFY-NEXT: br label [[BB3:%.*]]
; FULL-SIMPLIFY: bb3:
@@ -1200,22 +1132,22 @@ define i32 @test6(i32* %arg, i32 %arg1, i32* %arg2) {
; FULL-SIMPLIFY: bb4:
; FULL-SIMPLIFY-NEXT: [[I5:%.*]] = add nsw i32 [[ARG1]], [[DOT0]]
; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = sext i32 [[I5]] to i64
-; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I6]]
-; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = load i32, i32* [[I7]], align 4
+; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I6]]
+; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = load i32, ptr [[I7]], align 4
; FULL-SIMPLIFY-NEXT: [[I9:%.*]] = mul nsw i32 [[DOT0]], [[I8]]
; FULL-SIMPLIFY-NEXT: [[I10:%.*]] = sext i32 [[DOT0]] to i64
-; FULL-SIMPLIFY-NEXT: [[I11:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 [[I10]]
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG]]), "align"(i32* [[ARG]], i64 4), "dereferenceable"(i32* [[I11]], i64 4) ]
-; FULL-SIMPLIFY-NEXT: [[I12:%.*]] = load i32, i32* [[I11]], align 4
+; FULL-SIMPLIFY-NEXT: [[I11:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 [[I10]]
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG]]), "align"(ptr [[ARG]], i64 4), "dereferenceable"(ptr [[I11]], i64 4) ]
+; FULL-SIMPLIFY-NEXT: [[I12:%.*]] = load i32, ptr [[I11]], align 4
; FULL-SIMPLIFY-NEXT: [[I13:%.*]] = add nsw i32 [[I12]], [[I9]]
-; FULL-SIMPLIFY-NEXT: store i32 [[I13]], i32* [[I11]], align 4
+; FULL-SIMPLIFY-NEXT: store i32 [[I13]], ptr [[I11]], align 4
; FULL-SIMPLIFY-NEXT: [[I14]] = add nsw i32 [[DOT0]], 1
; FULL-SIMPLIFY-NEXT: br label [[BB3]]
; FULL-SIMPLIFY: bb15:
; FULL-SIMPLIFY-NEXT: [[I16:%.*]] = sext i32 [[ARG1]] to i64
-; FULL-SIMPLIFY-NEXT: [[I17:%.*]] = getelementptr inbounds i32, i32* [[ARG2]], i64 [[I16]]
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[ARG2]]), "align"(i32* [[ARG2]], i64 4) ]
-; FULL-SIMPLIFY-NEXT: [[I18:%.*]] = load i32, i32* [[I17]], align 4
+; FULL-SIMPLIFY-NEXT: [[I17:%.*]] = getelementptr inbounds i32, ptr [[ARG2]], i64 [[I16]]
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[ARG2]]), "align"(ptr [[ARG2]], i64 4) ]
+; FULL-SIMPLIFY-NEXT: [[I18:%.*]] = load i32, ptr [[I17]], align 4
; FULL-SIMPLIFY-NEXT: ret i32 [[I18]]
;
bb:
@@ -1229,138 +1161,132 @@ bb3: ; preds = %bb4, %bb
bb4: ; preds = %bb3
%i5 = add nsw i32 %arg1, %.0
%i6 = sext i32 %i5 to i64
- %i7 = getelementptr inbounds i32, i32* %arg, i64 %i6
- %i8 = load i32, i32* %i7, align 4
+ %i7 = getelementptr inbounds i32, ptr %arg, i64 %i6
+ %i8 = load i32, ptr %i7, align 4
%i9 = mul nsw i32 %.0, %i8
%i10 = sext i32 %.0 to i64
- %i11 = getelementptr inbounds i32, i32* %arg, i64 %i10
- %i12 = load i32, i32* %i11, align 4
+ %i11 = getelementptr inbounds i32, ptr %arg, i64 %i10
+ %i12 = load i32, ptr %i11, align 4
%i13 = add nsw i32 %i12, %i9
- store i32 %i13, i32* %i11, align 4
+ store i32 %i13, ptr %i11, align 4
%i14 = add nsw i32 %.0, 1
br label %bb3
bb15: ; preds = %bb3
%i16 = sext i32 %arg1 to i64
- %i17 = getelementptr inbounds i32, i32* %arg2, i64 %i16
- %i18 = load i32, i32* %i17, align 4
+ %i17 = getelementptr inbounds i32, ptr %arg2, i64 %i16
+ %i18 = load i32, ptr %i17, align 4
ret i32 %i18
}
-define i32 @test7(%struct.A* nonnull %arg, i32 %arg1) {
+define i32 @test7(ptr nonnull %arg, i32 %arg1) {
; BASIC-LABEL: define {{[^@]+}}@test7
-; BASIC-SAME: (%struct.A* nonnull [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; BASIC-SAME: (ptr nonnull [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; BASIC-NEXT: bb:
; BASIC-NEXT: [[I:%.*]] = sext i32 [[ARG1]] to i64
-; BASIC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], %struct.A* [[ARG]], i64 0, i32 3
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.A* [[ARG]], i64 280), "align"(%struct.A* [[ARG]], i64 16) ]
-; BASIC-NEXT: [[I3:%.*]] = load i64, i64* [[I2]], align 8
-; BASIC-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
-; BASIC-NEXT: [[I5:%.*]] = load i64, i64* [[I4]], align 32
-; BASIC-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 1
-; BASIC-NEXT: [[I7:%.*]] = load i64*, i64** [[I6]], align 8
-; BASIC-NEXT: [[I8:%.*]] = getelementptr inbounds i64, i64* [[I7]], i64 [[I3]]
-; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I8]], i64 8), "nonnull"(i64* [[I7]]), "align"(i64* [[I7]], i64 8) ]
-; BASIC-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; BASIC-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; BASIC-NEXT: [[I9:%.*]] = bitcast %struct.A* [[ARG]] to i32**
-; BASIC-NEXT: [[I10:%.*]] = load i32*, i32** [[I9]], align 8
-; BASIC-NEXT: [[I11:%.*]] = load i32, i32* [[I10]], align 4
+; BASIC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], ptr [[ARG]], i64 0, i32 3
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 280), "align"(ptr [[ARG]], i64 16) ]
+; BASIC-NEXT: [[I3:%.*]] = load i64, ptr [[I2]], align 8
+; BASIC-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
+; BASIC-NEXT: [[I5:%.*]] = load i64, ptr [[I4]], align 32
+; BASIC-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 1
+; BASIC-NEXT: [[I7:%.*]] = load ptr, ptr [[I6]], align 8
+; BASIC-NEXT: [[I8:%.*]] = getelementptr inbounds i64, ptr [[I7]], i64 [[I3]]
+; BASIC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I8]], i64 8), "nonnull"(ptr [[I7]]), "align"(ptr [[I7]], i64 8) ]
+; BASIC-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; BASIC-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; BASIC-NEXT: [[I10:%.*]] = load ptr, ptr [[ARG]], align 8
+; BASIC-NEXT: [[I11:%.*]] = load i32, ptr [[I10]], align 4
; BASIC-NEXT: ret i32 [[I11]]
;
; ALL-LABEL: define {{[^@]+}}@test7
-; ALL-SAME: (%struct.A* nonnull [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; ALL-SAME: (ptr nonnull [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; ALL-NEXT: bb:
; ALL-NEXT: [[I:%.*]] = sext i32 [[ARG1]] to i64
-; ALL-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], %struct.A* [[ARG]], i64 0, i32 3
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.A* [[ARG]], i64 280), "align"(%struct.A* [[ARG]], i64 16) ]
-; ALL-NEXT: [[I3:%.*]] = load i64, i64* [[I2]], align 8
-; ALL-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
-; ALL-NEXT: [[I5:%.*]] = load i64, i64* [[I4]], align 32
-; ALL-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 1
-; ALL-NEXT: [[I7:%.*]] = load i64*, i64** [[I6]], align 8
-; ALL-NEXT: [[I8:%.*]] = getelementptr inbounds i64, i64* [[I7]], i64 [[I3]]
-; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I8]], i64 8), "nonnull"(i64* [[I7]]), "align"(i64* [[I7]], i64 8) ]
-; ALL-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; ALL-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; ALL-NEXT: [[I9:%.*]] = bitcast %struct.A* [[ARG]] to i32**
-; ALL-NEXT: [[I10:%.*]] = load i32*, i32** [[I9]], align 8
-; ALL-NEXT: [[I11:%.*]] = load i32, i32* [[I10]], align 4
+; ALL-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], ptr [[ARG]], i64 0, i32 3
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 280), "align"(ptr [[ARG]], i64 16) ]
+; ALL-NEXT: [[I3:%.*]] = load i64, ptr [[I2]], align 8
+; ALL-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
+; ALL-NEXT: [[I5:%.*]] = load i64, ptr [[I4]], align 32
+; ALL-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 1
+; ALL-NEXT: [[I7:%.*]] = load ptr, ptr [[I6]], align 8
+; ALL-NEXT: [[I8:%.*]] = getelementptr inbounds i64, ptr [[I7]], i64 [[I3]]
+; ALL-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I8]], i64 8), "nonnull"(ptr [[I7]]), "align"(ptr [[I7]], i64 8) ]
+; ALL-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; ALL-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; ALL-NEXT: [[I10:%.*]] = load ptr, ptr [[ARG]], align 8
+; ALL-NEXT: [[I11:%.*]] = load i32, ptr [[I10]], align 4
; ALL-NEXT: ret i32 [[I11]]
;
; WITH-AC-LABEL: define {{[^@]+}}@test7
-; WITH-AC-SAME: (%struct.A* nonnull [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; WITH-AC-SAME: (ptr nonnull [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; WITH-AC-NEXT: bb:
; WITH-AC-NEXT: [[I:%.*]] = sext i32 [[ARG1]] to i64
-; WITH-AC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], %struct.A* [[ARG]], i64 0, i32 3
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.A* [[ARG]], i64 280), "align"(%struct.A* [[ARG]], i64 16) ]
-; WITH-AC-NEXT: [[I3:%.*]] = load i64, i64* [[I2]], align 8
-; WITH-AC-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
-; WITH-AC-NEXT: [[I5:%.*]] = load i64, i64* [[I4]], align 32
-; WITH-AC-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 1
-; WITH-AC-NEXT: [[I7:%.*]] = load i64*, i64** [[I6]], align 8
-; WITH-AC-NEXT: [[I8:%.*]] = getelementptr inbounds i64, i64* [[I7]], i64 [[I3]]
-; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I8]], i64 8), "nonnull"(i64* [[I7]]), "align"(i64* [[I7]], i64 8) ]
-; WITH-AC-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; WITH-AC-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; WITH-AC-NEXT: [[I9:%.*]] = bitcast %struct.A* [[ARG]] to i32**
-; WITH-AC-NEXT: [[I10:%.*]] = load i32*, i32** [[I9]], align 8
-; WITH-AC-NEXT: [[I11:%.*]] = load i32, i32* [[I10]], align 4
+; WITH-AC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], ptr [[ARG]], i64 0, i32 3
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 280), "align"(ptr [[ARG]], i64 16) ]
+; WITH-AC-NEXT: [[I3:%.*]] = load i64, ptr [[I2]], align 8
+; WITH-AC-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
+; WITH-AC-NEXT: [[I5:%.*]] = load i64, ptr [[I4]], align 32
+; WITH-AC-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 1
+; WITH-AC-NEXT: [[I7:%.*]] = load ptr, ptr [[I6]], align 8
+; WITH-AC-NEXT: [[I8:%.*]] = getelementptr inbounds i64, ptr [[I7]], i64 [[I3]]
+; WITH-AC-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I8]], i64 8), "nonnull"(ptr [[I7]]), "align"(ptr [[I7]], i64 8) ]
+; WITH-AC-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; WITH-AC-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; WITH-AC-NEXT: [[I10:%.*]] = load ptr, ptr [[ARG]], align 8
+; WITH-AC-NEXT: [[I11:%.*]] = load i32, ptr [[I10]], align 4
; WITH-AC-NEXT: ret i32 [[I11]]
;
; CROSS-BLOCK-LABEL: define {{[^@]+}}@test7
-; CROSS-BLOCK-SAME: (%struct.A* nonnull [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; CROSS-BLOCK-SAME: (ptr nonnull [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; CROSS-BLOCK-NEXT: bb:
; CROSS-BLOCK-NEXT: [[I:%.*]] = sext i32 [[ARG1]] to i64
-; CROSS-BLOCK-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], %struct.A* [[ARG]], i64 0, i32 3
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(%struct.A* [[ARG]], i64 280), "align"(%struct.A* [[ARG]], i64 16) ]
-; CROSS-BLOCK-NEXT: [[I3:%.*]] = load i64, i64* [[I2]], align 8
-; CROSS-BLOCK-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
-; CROSS-BLOCK-NEXT: [[I5:%.*]] = load i64, i64* [[I4]], align 32
-; CROSS-BLOCK-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 1
-; CROSS-BLOCK-NEXT: [[I7:%.*]] = load i64*, i64** [[I6]], align 8
-; CROSS-BLOCK-NEXT: [[I8:%.*]] = getelementptr inbounds i64, i64* [[I7]], i64 [[I3]]
-; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I8]], i64 8), "nonnull"(i64* [[I7]]), "align"(i64* [[I7]], i64 8) ]
-; CROSS-BLOCK-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; CROSS-BLOCK-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; CROSS-BLOCK-NEXT: [[I9:%.*]] = bitcast %struct.A* [[ARG]] to i32**
-; CROSS-BLOCK-NEXT: [[I10:%.*]] = load i32*, i32** [[I9]], align 8
-; CROSS-BLOCK-NEXT: [[I11:%.*]] = load i32, i32* [[I10]], align 4
+; CROSS-BLOCK-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], ptr [[ARG]], i64 0, i32 3
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG]], i64 280), "align"(ptr [[ARG]], i64 16) ]
+; CROSS-BLOCK-NEXT: [[I3:%.*]] = load i64, ptr [[I2]], align 8
+; CROSS-BLOCK-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
+; CROSS-BLOCK-NEXT: [[I5:%.*]] = load i64, ptr [[I4]], align 32
+; CROSS-BLOCK-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 1
+; CROSS-BLOCK-NEXT: [[I7:%.*]] = load ptr, ptr [[I6]], align 8
+; CROSS-BLOCK-NEXT: [[I8:%.*]] = getelementptr inbounds i64, ptr [[I7]], i64 [[I3]]
+; CROSS-BLOCK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I8]], i64 8), "nonnull"(ptr [[I7]]), "align"(ptr [[I7]], i64 8) ]
+; CROSS-BLOCK-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; CROSS-BLOCK-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; CROSS-BLOCK-NEXT: [[I10:%.*]] = load ptr, ptr [[ARG]], align 8
+; CROSS-BLOCK-NEXT: [[I11:%.*]] = load i32, ptr [[I10]], align 4
; CROSS-BLOCK-NEXT: ret i32 [[I11]]
;
; FULL-SIMPLIFY-LABEL: define {{[^@]+}}@test7
-; FULL-SIMPLIFY-SAME: (%struct.A* nonnull align 16 dereferenceable(280) [[ARG:%.*]], i32 [[ARG1:%.*]]) {
+; FULL-SIMPLIFY-SAME: (ptr nonnull align 16 dereferenceable(280) [[ARG:%.*]], i32 [[ARG1:%.*]]) {
; FULL-SIMPLIFY-NEXT: bb:
; FULL-SIMPLIFY-NEXT: [[I:%.*]] = sext i32 [[ARG1]] to i64
-; FULL-SIMPLIFY-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], %struct.A* [[ARG]], i64 0, i32 3
-; FULL-SIMPLIFY-NEXT: [[I3:%.*]] = load i64, i64* [[I2]], align 8
-; FULL-SIMPLIFY-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
-; FULL-SIMPLIFY-NEXT: [[I5:%.*]] = load i64, i64* [[I4]], align 32
-; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], %struct.A* [[ARG]], i64 0, i32 1
-; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = load i64*, i64** [[I6]], align 8
-; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = getelementptr inbounds i64, i64* [[I7]], i64 [[I3]]
-; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i64* [[I8]], i64 8), "nonnull"(i64* [[I7]]), "align"(i64* [[I7]], i64 8) ]
-; FULL-SIMPLIFY-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; FULL-SIMPLIFY-NEXT: store i64 [[I5]], i64* [[I8]], align 8
-; FULL-SIMPLIFY-NEXT: [[I9:%.*]] = bitcast %struct.A* [[ARG]] to i32**
-; FULL-SIMPLIFY-NEXT: [[I10:%.*]] = load i32*, i32** [[I9]], align 8
-; FULL-SIMPLIFY-NEXT: [[I11:%.*]] = load i32, i32* [[I10]], align 4
+; FULL-SIMPLIFY-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_A:%.*]], ptr [[ARG]], i64 0, i32 3
+; FULL-SIMPLIFY-NEXT: [[I3:%.*]] = load i64, ptr [[I2]], align 8
+; FULL-SIMPLIFY-NEXT: [[I4:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 2, i64 [[I]], i64 [[I3]], i32 0
+; FULL-SIMPLIFY-NEXT: [[I5:%.*]] = load i64, ptr [[I4]], align 32
+; FULL-SIMPLIFY-NEXT: [[I6:%.*]] = getelementptr inbounds [[STRUCT_A]], ptr [[ARG]], i64 0, i32 1
+; FULL-SIMPLIFY-NEXT: [[I7:%.*]] = load ptr, ptr [[I6]], align 8
+; FULL-SIMPLIFY-NEXT: [[I8:%.*]] = getelementptr inbounds i64, ptr [[I7]], i64 [[I3]]
+; FULL-SIMPLIFY-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[I8]], i64 8), "nonnull"(ptr [[I7]]), "align"(ptr [[I7]], i64 8) ]
+; FULL-SIMPLIFY-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; FULL-SIMPLIFY-NEXT: store i64 [[I5]], ptr [[I8]], align 8
+; FULL-SIMPLIFY-NEXT: [[I10:%.*]] = load ptr, ptr [[ARG]], align 8
+; FULL-SIMPLIFY-NEXT: [[I11:%.*]] = load i32, ptr [[I10]], align 4
; FULL-SIMPLIFY-NEXT: ret i32 [[I11]]
;
bb:
%i = sext i32 %arg1 to i64
- %i2 = getelementptr inbounds %struct.A, %struct.A* %arg, i64 0, i32 3
- %i3 = load i64, i64* %i2, align 8
- %i4 = getelementptr inbounds %struct.A, %struct.A* %arg, i64 0, i32 2, i64 %i, i64 %i3, i32 0
- %i5 = load i64, i64* %i4, align 32
- %i6 = getelementptr inbounds %struct.A, %struct.A* %arg, i64 0, i32 1
- %i7 = load i64*, i64** %i6, align 8
- %i8 = getelementptr inbounds i64, i64* %i7, i64 %i3
- store i64 %i5, i64* %i8, align 8
- store i64 %i5, i64* %i8, align 8
- %i9 = bitcast %struct.A* %arg to i32**
- %i10 = load i32*, i32** %i9, align 8
- %i11 = load i32, i32* %i10, align 4
+ %i2 = getelementptr inbounds %struct.A, ptr %arg, i64 0, i32 3
+ %i3 = load i64, ptr %i2, align 8
+ %i4 = getelementptr inbounds %struct.A, ptr %arg, i64 0, i32 2, i64 %i, i64 %i3, i32 0
+ %i5 = load i64, ptr %i4, align 32
+ %i6 = getelementptr inbounds %struct.A, ptr %arg, i64 0, i32 1
+ %i7 = load ptr, ptr %i6, align 8
+ %i8 = getelementptr inbounds i64, ptr %i7, i64 %i3
+ store i64 %i5, ptr %i8, align 8
+ store i64 %i5, ptr %i8, align 8
+ %i10 = load ptr, ptr %arg, align 8
+ %i11 = load i32, ptr %i10, align 4
ret i32 %i11
}
diff --git a/llvm/test/Transforms/Util/assume-simplify.ll b/llvm/test/Transforms/Util/assume-simplify.ll
index ba6f68be290cb..1fd807429d642 100644
--- a/llvm/test/Transforms/Util/assume-simplify.ll
+++ b/llvm/test/Transforms/Util/assume-simplify.ll
@@ -7,106 +7,100 @@ declare void @may_throw()
declare void @llvm.assume(i1 noundef) #0
-define i32 @test1(i32* %arg, i32* %arg1, i32 %arg2, i32 %arg3) {
+define i32 @test1(ptr %arg, ptr %arg1, i32 %arg2, i32 %arg3) {
; CHECK-LABEL: define {{[^@]+}}@test1
-; CHECK-SAME: (i32* nonnull dereferenceable(4) [[ARG:%.*]], i32* [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
+; CHECK-SAME: (ptr nonnull dereferenceable(4) [[ARG:%.*]], ptr [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[I:%.*]] = icmp ne i32 [[ARG2]], 4
; CHECK-NEXT: br i1 [[I]], label [[BB4:%.*]], label [[A:%.*]]
; CHECK: bb4:
; CHECK-NEXT: [[I5:%.*]] = add nsw i32 [[ARG3]], [[ARG2]]
; CHECK-NEXT: call void @may_throw()
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[ARG]], i64 4), "align"(i32* [[ARG1]], i64 4), "nonnull"(i32* [[ARG1]]) ]
-; CHECK-NEXT: [[I6:%.*]] = load i32, i32* [[ARG]], align 4
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARG]], i64 4), "align"(ptr [[ARG1]], i64 4), "nonnull"(ptr [[ARG1]]) ]
+; CHECK-NEXT: [[I6:%.*]] = load i32, ptr [[ARG]], align 4
; CHECK-NEXT: [[I7:%.*]] = add nsw i32 [[I5]], [[I6]]
-; CHECK-NEXT: store i32 0, i32* [[ARG]], align 4
-; CHECK-NEXT: [[I8:%.*]] = load i32, i32* [[ARG1]], align 4
+; CHECK-NEXT: store i32 0, ptr [[ARG]], align 4
+; CHECK-NEXT: [[I8:%.*]] = load i32, ptr [[ARG1]], align 4
; CHECK-NEXT: [[I9:%.*]] = add nsw i32 [[I7]], [[I8]]
; CHECK-NEXT: call void @may_throw()
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG1]], i64 4), "ignore"(i32* undef) ]
-; CHECK-NEXT: store i32 [[I9]], i32* [[ARG1]], align 4
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG1]], i64 4), "ignore"(ptr undef) ]
+; CHECK-NEXT: store i32 [[I9]], ptr [[ARG1]], align 4
; CHECK-NEXT: br label [[B:%.*]]
; CHECK: A:
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[ARG]], i64 4), "ignore"(i32* undef, i64 4), "ignore"(i32* undef) ]
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARG]], i64 4), "ignore"(ptr undef, i64 4), "ignore"(ptr undef) ]
; CHECK-NEXT: br label [[B]]
; CHECK: B:
; CHECK-NEXT: ret i32 0
;
bb:
%i = icmp ne i32 %arg2, 4
- call void @llvm.assume(i1 true) [ "dereferenceable"(i32* %arg, i64 4), "nonnull"(i32* %arg) ]
+ call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %arg, i64 4), "nonnull"(ptr %arg) ]
br i1 %i, label %bb4, label %A
bb4: ; preds = %bb
%i5 = add nsw i32 %arg3, %arg2
call void @may_throw()
- %i6 = load i32, i32* %arg, align 4
+ %i6 = load i32, ptr %arg, align 4
%i7 = add nsw i32 %i5, %i6
- store i32 0, i32* %arg, align 4
- call void @llvm.assume(i1 true) [ "align"(i32* %arg, i64 4), "dereferenceable"(i32* %arg, i64 4) ]
- %i8 = load i32, i32* %arg1, align 4
+ store i32 0, ptr %arg, align 4
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg, i64 4), "dereferenceable"(ptr %arg, i64 4) ]
+ %i8 = load i32, ptr %arg1, align 4
%i9 = add nsw i32 %i7, %i8
- call void @llvm.assume(i1 true) [ "align"(i32* %arg1, i64 4), "nonnull"(i32* %arg1) ]
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg1, i64 4), "nonnull"(ptr %arg1) ]
call void @may_throw()
- call void @llvm.assume(i1 true) [ "dereferenceable"(i32* %arg1, i64 4), "nonnull"(i32* %arg1) ]
- store i32 %i9, i32* %arg1, align 4
+ call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %arg1, i64 4), "nonnull"(ptr %arg1) ]
+ store i32 %i9, ptr %arg1, align 4
br label %B
A: ; preds = %bb
- call void @llvm.assume(i1 true) [ "align"(i32* %arg, i64 4), "dereferenceable"(i32* %arg, i64 4), "nonnull"(i32* %arg) ]
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg, i64 4), "dereferenceable"(ptr %arg, i64 4), "nonnull"(ptr %arg) ]
br label %B
B: ; preds = %A, %bb4
ret i32 0
}
-define i32 @test2(i32** %arg, i32* %arg1, i32 %arg2, i32 %arg3) {
+define i32 @test2(ptr %arg, ptr %arg1, i32 %arg2, i32 %arg3) {
; CHECK-LABEL: define {{[^@]+}}@test2
-; CHECK-SAME: (i32** [[ARG:%.*]], i32* nonnull align 4 dereferenceable(4) [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
+; CHECK-SAME: (ptr [[ARG:%.*]], ptr nonnull align 4 dereferenceable(4) [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) {
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[I:%.*]] = getelementptr inbounds i32, i32* [[ARG1]], i64 0
-; CHECK-NEXT: [[I4:%.*]] = load i32, i32* [[I]], align 4
+; CHECK-NEXT: [[I4:%.*]] = load i32, ptr [[ARG1]], align 4
; CHECK-NEXT: [[I5:%.*]] = icmp ne i32 [[I4]], 0
-; CHECK-NEXT: [[I6:%.*]] = getelementptr inbounds i32, i32* [[ARG1]], i64 0
; CHECK-NEXT: br i1 [[I5]], label [[BB7:%.*]], label [[BB17:%.*]]
; CHECK: bb7:
; CHECK-NEXT: call void @may_throw()
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32* [[I6]], i64 4), "dereferenceable"(i32* [[I6]], i64 4), "nonnull"(i32* [[I6]]) ]
-; CHECK-NEXT: [[I8:%.*]] = load i32, i32* [[I6]], align 4
-; CHECK-NEXT: [[I9:%.*]] = getelementptr inbounds i32, i32* [[ARG1]], i64 2
-; CHECK-NEXT: store i32 [[I8]], i32* [[I9]], align 4
+; CHECK-NEXT: [[I8:%.*]] = load i32, ptr [[ARG1]], align 4
+; CHECK-NEXT: [[I9:%.*]] = getelementptr inbounds i32, ptr [[ARG1]], i64 2
+; CHECK-NEXT: store i32 [[I8]], ptr [[I9]], align 4
; CHECK-NEXT: call void @may_throw()
; CHECK-NEXT: call void @may_throw()
-; CHECK-NEXT: [[I10:%.*]] = getelementptr inbounds i32*, i32** [[ARG]], i64 1
-; CHECK-NEXT: [[I11:%.*]] = load i32*, i32** [[I10]], align 8
-; CHECK-NEXT: [[I12:%.*]] = getelementptr inbounds i32, i32* [[I11]], i64 0
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(i32* [[ARG1]], i64 12), "align"(i32* [[I11]], i64 4), "dereferenceable"(i32* [[I11]], i64 4), "nonnull"(i32* [[I11]]) ]
-; CHECK-NEXT: [[I13:%.*]] = load i32, i32* [[I12]], align 4
-; CHECK-NEXT: [[I14:%.*]] = getelementptr inbounds i32*, i32** [[ARG]], i64 1
-; CHECK-NEXT: [[I15:%.*]] = load i32*, i32** [[I14]], align 8
-; CHECK-NEXT: [[I16:%.*]] = getelementptr inbounds i32, i32* [[I15]], i64 2
-; CHECK-NEXT: store i32 [[I13]], i32* [[I16]], align 4
+; CHECK-NEXT: [[I10:%.*]] = getelementptr inbounds ptr, ptr [[ARG]], i64 1
+; CHECK-NEXT: [[I11:%.*]] = load ptr, ptr [[I10]], align 8
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[ARG1]], i64 12), "align"(ptr [[I11]], i64 4), "dereferenceable"(ptr [[I11]], i64 4), "nonnull"(ptr [[I11]]) ]
+; CHECK-NEXT: [[I13:%.*]] = load i32, ptr [[I11]], align 4
+; CHECK-NEXT: [[I14:%.*]] = getelementptr inbounds ptr, ptr [[ARG]], i64 1
+; CHECK-NEXT: [[I15:%.*]] = load ptr, ptr [[I14]], align 8
+; CHECK-NEXT: [[I16:%.*]] = getelementptr inbounds i32, ptr [[I15]], i64 2
+; CHECK-NEXT: store i32 [[I13]], ptr [[I16]], align 4
; CHECK-NEXT: call void @may_throw()
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32** [[ARG]], i64 4), "dereferenceable"(i32** [[ARG]], i64 4), "nonnull"(i32** [[ARG]]) ]
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARG]], i64 4), "dereferenceable"(ptr [[ARG]], i64 4), "nonnull"(ptr [[ARG]]) ]
; CHECK-NEXT: br label [[BB33:%.*]]
; CHECK: bb17:
-; CHECK-NEXT: [[I18:%.*]] = getelementptr inbounds i32*, i32** [[ARG]], i64 7
-; CHECK-NEXT: [[I19:%.*]] = load i32*, i32** [[I18]], align 8
-; CHECK-NEXT: [[I20:%.*]] = getelementptr inbounds i32, i32* [[I19]], i64 0
-; CHECK-NEXT: [[I21:%.*]] = load i32, i32* [[I20]], align 4
+; CHECK-NEXT: [[I18:%.*]] = getelementptr inbounds ptr, ptr [[ARG]], i64 7
+; CHECK-NEXT: [[I19:%.*]] = load ptr, ptr [[I18]], align 8
+; CHECK-NEXT: [[I21:%.*]] = load i32, ptr [[I19]], align 4
; CHECK-NEXT: [[I22:%.*]] = icmp ne i32 [[I21]], 0
; CHECK-NEXT: br i1 [[I22]], label [[BB23:%.*]], label [[BB31:%.*]]
; CHECK: bb23:
; CHECK-NEXT: call void @may_throw()
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32** [[ARG]], i64 4), "dereferenceable"(i32** [[ARG]], i64 4), "nonnull"(i32** [[ARG]]) ]
-; CHECK-NEXT: [[I24:%.*]] = getelementptr inbounds i32*, i32** [[ARG]], i64 2
-; CHECK-NEXT: [[I25:%.*]] = load i32*, i32** [[I24]], align 8
-; CHECK-NEXT: [[I26:%.*]] = getelementptr inbounds i32, i32* [[I25]], i64 0
-; CHECK-NEXT: [[I27:%.*]] = load i32, i32* [[I26]], align 4
-; CHECK-NEXT: [[I28:%.*]] = getelementptr inbounds i32*, i32** [[ARG]], i64 2
-; CHECK-NEXT: [[I29:%.*]] = load i32*, i32** [[I28]], align 8
-; CHECK-NEXT: [[I30:%.*]] = getelementptr inbounds i32, i32* [[I29]], i64 2
-; CHECK-NEXT: store i32 [[I27]], i32* [[I30]], align 4
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARG]], i64 4), "dereferenceable"(ptr [[ARG]], i64 4), "nonnull"(ptr [[ARG]]) ]
+; CHECK-NEXT: [[I24:%.*]] = getelementptr inbounds ptr, ptr [[ARG]], i64 2
+; CHECK-NEXT: [[I25:%.*]] = load ptr, ptr [[I24]], align 8
+; CHECK-NEXT: [[I27:%.*]] = load i32, ptr [[I25]], align 4
+; CHECK-NEXT: [[I28:%.*]] = getelementptr inbounds ptr, ptr [[ARG]], i64 2
+; CHECK-NEXT: [[I29:%.*]] = load ptr, ptr [[I28]], align 8
+; CHECK-NEXT: [[I30:%.*]] = getelementptr inbounds i32, ptr [[I29]], i64 2
+; CHECK-NEXT: store i32 [[I27]], ptr [[I30]], align 4
; CHECK-NEXT: call void @may_throw()
; CHECK-NEXT: br label [[BB31]]
; CHECK: bb31:
@@ -114,59 +108,54 @@ define i32 @test2(i32** %arg, i32* %arg1, i32 %arg2, i32 %arg3) {
; CHECK: bb32:
; CHECK-NEXT: br label [[BB33]]
; CHECK: bb33:
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i32** [[ARG]], i64 4), "dereferenceable"(i32** [[ARG]], i64 4), "nonnull"(i32** [[ARG]]) ]
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARG]], i64 4), "dereferenceable"(ptr [[ARG]], i64 4), "nonnull"(ptr [[ARG]]) ]
; CHECK-NEXT: ret i32 0
;
bb:
- %i = getelementptr inbounds i32, i32* %arg1, i64 0
- %i4 = load i32, i32* %i, align 4
+ %i4 = load i32, ptr %arg1, align 4
%i5 = icmp ne i32 %i4, 0
- call void @llvm.assume(i1 true) [ "align"(i32* %arg1, i64 4), "dereferenceable"(i32* %arg1, i64 4) ]
- call void @llvm.assume(i1 true) [ "align"(i32* %arg1, i64 4), "nonnull"(i32* %arg1) ]
- %i6 = getelementptr inbounds i32, i32* %arg1, i64 0
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg1, i64 4), "dereferenceable"(ptr %arg1, i64 4) ]
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg1, i64 4), "nonnull"(ptr %arg1) ]
br i1 %i5, label %bb7, label %bb17
bb7: ; preds = %bb
call void @may_throw()
- call void @llvm.assume(i1 true) [ "align"(i32* %i6, i64 4), "dereferenceable"(i32* %i6, i64 4), "nonnull"(i32* %i6) ]
- %i8 = load i32, i32* %i6, align 4
- %i9 = getelementptr inbounds i32, i32* %arg1, i64 2
- store i32 %i8, i32* %i9, align 4
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg1, i64 4), "dereferenceable"(ptr %arg1, i64 4), "nonnull"(ptr %arg1) ]
+ %i8 = load i32, ptr %arg1, align 4
+ %i9 = getelementptr inbounds i32, ptr %arg1, i64 2
+ store i32 %i8, ptr %i9, align 4
call void @may_throw()
call void @may_throw()
- call void @llvm.assume(i1 true) [ "align"(i32* %i9, i64 4), "dereferenceable"(i32* %i9, i64 4), "nonnull"(i32* %i9) ]
- %i10 = getelementptr inbounds i32*, i32** %arg, i64 1
- %i11 = load i32*, i32** %i10, align 8
- %i12 = getelementptr inbounds i32, i32* %i11, i64 0
- %i13 = load i32, i32* %i12, align 4
- call void @llvm.assume(i1 true) [ "align"(i32* %i12, i64 4), "dereferenceable"(i32* %i12, i64 4), "nonnull"(i32* %i12) ]
- %i14 = getelementptr inbounds i32*, i32** %arg, i64 1
- %i15 = load i32*, i32** %i14, align 8
- %i16 = getelementptr inbounds i32, i32* %i15, i64 2
- store i32 %i13, i32* %i16, align 4
+ call void @llvm.assume(i1 true) [ "align"(ptr %i9, i64 4), "dereferenceable"(ptr %i9, i64 4), "nonnull"(ptr %i9) ]
+ %i10 = getelementptr inbounds ptr, ptr %arg, i64 1
+ %i11 = load ptr, ptr %i10, align 8
+ %i13 = load i32, ptr %i11, align 4
+ call void @llvm.assume(i1 true) [ "align"(ptr %i11, i64 4), "dereferenceable"(ptr %i11, i64 4), "nonnull"(ptr %i11) ]
+ %i14 = getelementptr inbounds ptr, ptr %arg, i64 1
+ %i15 = load ptr, ptr %i14, align 8
+ %i16 = getelementptr inbounds i32, ptr %i15, i64 2
+ store i32 %i13, ptr %i16, align 4
call void @may_throw()
- call void @llvm.assume(i1 true) [ "align"(i32** %arg, i64 4), "dereferenceable"(i32** %arg, i64 4), "nonnull"(i32** %arg) ]
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg, i64 4), "dereferenceable"(ptr %arg, i64 4), "nonnull"(ptr %arg) ]
br label %bb33
bb17: ; preds = %bb
- %i18 = getelementptr inbounds i32*, i32** %arg, i64 7
- %i19 = load i32*, i32** %i18, align 8
- %i20 = getelementptr inbounds i32, i32* %i19, i64 0
- %i21 = load i32, i32* %i20, align 4
+ %i18 = getelementptr inbounds ptr, ptr %arg, i64 7
+ %i19 = load ptr, ptr %i18, align 8
+ %i21 = load i32, ptr %i19, align 4
%i22 = icmp ne i32 %i21, 0
br i1 %i22, label %bb23, label %bb31
bb23: ; preds = %bb17
call void @may_throw()
- call void @llvm.assume(i1 true) [ "align"(i32** %arg, i64 4), "dereferenceable"(i32** %arg, i64 4), "nonnull"(i32** %arg) ]
- %i24 = getelementptr inbounds i32*, i32** %arg, i64 2
- %i25 = load i32*, i32** %i24, align 8
- %i26 = getelementptr inbounds i32, i32* %i25, i64 0
- %i27 = load i32, i32* %i26, align 4
- %i28 = getelementptr inbounds i32*, i32** %arg, i64 2
- %i29 = load i32*, i32** %i28, align 8
- %i30 = getelementptr inbounds i32, i32* %i29, i64 2
- store i32 %i27, i32* %i30, align 4
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg, i64 4), "dereferenceable"(ptr %arg, i64 4), "nonnull"(ptr %arg) ]
+ %i24 = getelementptr inbounds ptr, ptr %arg, i64 2
+ %i25 = load ptr, ptr %i24, align 8
+ %i27 = load i32, ptr %i25, align 4
+ %i28 = getelementptr inbounds ptr, ptr %arg, i64 2
+ %i29 = load ptr, ptr %i28, align 8
+ %i30 = getelementptr inbounds i32, ptr %i29, i64 2
+ store i32 %i27, ptr %i30, align 4
call void @may_throw()
br label %bb31
@@ -177,136 +166,136 @@ bb32: ; preds = %bb31
br label %bb33
bb33: ; preds = %bb32, %bb7
- call void @llvm.assume(i1 true) [ "align"(i32** %arg, i64 4), "dereferenceable"(i32** %arg, i64 4), "nonnull"(i32** %arg) ]
+ call void @llvm.assume(i1 true) [ "align"(ptr %arg, i64 4), "dereferenceable"(ptr %arg, i64 4), "nonnull"(ptr %arg) ]
ret i32 0
}
-define i32 @test3(i32* nonnull %p, i32 %i) {
+define i32 @test3(ptr nonnull %p, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test3
-; CHECK-SAME: (i32* nonnull [[P:%.*]], i32 [[I:%.*]]) {
+; CHECK-SAME: (ptr nonnull [[P:%.*]], i32 [[I:%.*]]) {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[COND:%.*]] = icmp ne i32 [[I]], 0
; CHECK-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: ret i32 0
; CHECK: B:
-; CHECK-NEXT: [[RET:%.*]] = load i32, i32* [[P]], align 4
+; CHECK-NEXT: [[RET:%.*]] = load i32, ptr [[P]], align 4
; CHECK-NEXT: ret i32 [[RET]]
;
bb:
%cond = icmp ne i32 %i, 0
- call void @llvm.assume(i1 true) [ "nonnull"(i32* %p) ]
+ call void @llvm.assume(i1 true) [ "nonnull"(ptr %p) ]
br i1 %cond, label %A, label %B
A: ; preds = %bb
ret i32 0
B: ; preds = %bb
- %ret = load i32, i32* %p, align 4
+ %ret = load i32, ptr %p, align 4
ret i32 %ret
}
-define i32 @test4(i32* %p, i32 %i) {
+define i32 @test4(ptr %p, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test4
-; CHECK-SAME: (i32* nonnull dereferenceable(32) [[P:%.*]], i32 [[I:%.*]]) {
+; CHECK-SAME: (ptr nonnull dereferenceable(32) [[P:%.*]], i32 [[I:%.*]]) {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[COND:%.*]] = icmp ne i32 [[I]], 0
; CHECK-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: ret i32 0
; CHECK: B:
-; CHECK-NEXT: [[RET:%.*]] = load i32, i32* [[P]], align 4
+; CHECK-NEXT: [[RET:%.*]] = load i32, ptr [[P]], align 4
; CHECK-NEXT: ret i32 [[RET]]
;
bb:
%cond = icmp ne i32 %i, 0
- call void @llvm.assume(i1 true) [ "nonnull"(i32* %p), "dereferenceable"(i32* %p, i32 32) ]
+ call void @llvm.assume(i1 true) [ "nonnull"(ptr %p), "dereferenceable"(ptr %p, i32 32) ]
br i1 %cond, label %A, label %B
A: ; preds = %bb
ret i32 0
B: ; preds = %bb
- %ret = load i32, i32* %p, align 4
+ %ret = load i32, ptr %p, align 4
ret i32 %ret
}
-define i32 @test4A(i32* %p, i32 %i) {
+define i32 @test4A(ptr %p, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test4A
-; CHECK-SAME: (i32* [[P:%.*]], i32 [[I:%.*]]) {
+; CHECK-SAME: (ptr [[P:%.*]], i32 [[I:%.*]]) {
; CHECK-NEXT: bb:
; CHECK-NEXT: call void @may_throw()
; CHECK-NEXT: [[COND:%.*]] = icmp ne i32 [[I]], 0
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(i32* [[P]]), "dereferenceable"(i32* [[P]], i32 32) ]
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P]]), "dereferenceable"(ptr [[P]], i32 32) ]
; CHECK-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: ret i32 0
; CHECK: B:
-; CHECK-NEXT: [[RET:%.*]] = load i32, i32* [[P]], align 4
+; CHECK-NEXT: [[RET:%.*]] = load i32, ptr [[P]], align 4
; CHECK-NEXT: ret i32 [[RET]]
;
bb:
call void @may_throw()
%cond = icmp ne i32 %i, 0
- call void @llvm.assume(i1 true) [ "nonnull"(i32* %p), "dereferenceable"(i32* %p, i32 32) ]
+ call void @llvm.assume(i1 true) [ "nonnull"(ptr %p), "dereferenceable"(ptr %p, i32 32) ]
br i1 %cond, label %A, label %B
A: ; preds = %bb
ret i32 0
B: ; preds = %bb
- %ret = load i32, i32* %p, align 4
+ %ret = load i32, ptr %p, align 4
ret i32 %ret
}
-define i32 @test5(i32* dereferenceable(64) %p, i32 %i) {
+define i32 @test5(ptr dereferenceable(64) %p, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test5
-; CHECK-SAME: (i32* nonnull dereferenceable(64) [[P:%.*]], i32 [[I:%.*]]) {
+; CHECK-SAME: (ptr nonnull dereferenceable(64) [[P:%.*]], i32 [[I:%.*]]) {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[COND:%.*]] = icmp ne i32 [[I]], 0
; CHECK-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: ret i32 0
; CHECK: B:
-; CHECK-NEXT: [[RET:%.*]] = load i32, i32* [[P]], align 4
+; CHECK-NEXT: [[RET:%.*]] = load i32, ptr [[P]], align 4
; CHECK-NEXT: ret i32 [[RET]]
;
bb:
%cond = icmp ne i32 %i, 0
- call void @llvm.assume(i1 true) [ "nonnull"(i32* %p), "dereferenceable"(i32* %p, i32 32) ]
+ call void @llvm.assume(i1 true) [ "nonnull"(ptr %p), "dereferenceable"(ptr %p, i32 32) ]
br i1 %cond, label %A, label %B
A: ; preds = %bb
ret i32 0
B: ; preds = %bb
- %ret = load i32, i32* %p, align 4
+ %ret = load i32, ptr %p, align 4
ret i32 %ret
}
-define i32 @test5A(i32* dereferenceable(8) %p, i32 %i) {
+define i32 @test5A(ptr dereferenceable(8) %p, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test5A
-; CHECK-SAME: (i32* dereferenceable(32) [[P:%.*]], i32 [[I:%.*]]) {
+; CHECK-SAME: (ptr dereferenceable(32) [[P:%.*]], i32 [[I:%.*]]) {
; CHECK-NEXT: bb:
; CHECK-NEXT: [[COND:%.*]] = icmp ne i32 [[I]], 0
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "cold"(), "ignore"(i32* undef, i32 32) ]
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "cold"(), "ignore"(ptr undef, i32 32) ]
; CHECK-NEXT: br i1 [[COND]], label [[A:%.*]], label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: ret i32 0
; CHECK: B:
-; CHECK-NEXT: [[RET:%.*]] = load i32, i32* [[P]], align 4
+; CHECK-NEXT: [[RET:%.*]] = load i32, ptr [[P]], align 4
; CHECK-NEXT: ret i32 [[RET]]
;
bb:
%cond = icmp ne i32 %i, 0
- call void @llvm.assume(i1 true) [ "cold"(), "dereferenceable"(i32* %p, i32 32) ]
+ call void @llvm.assume(i1 true) [ "cold"(), "dereferenceable"(ptr %p, i32 32) ]
br i1 %cond, label %A, label %B
A: ; preds = %bb
ret i32 0
B: ; preds = %bb
- %ret = load i32, i32* %p, align 4
+ %ret = load i32, ptr %p, align 4
ret i32 %ret
}
@@ -325,20 +314,18 @@ bb:
ret i32 0
}
-define i32 @test7(i32* %p) {
+define i32 @test7(ptr %p) {
; CHECK-LABEL: define {{[^@]+}}@test7
-; CHECK-SAME: (i32* align 4 dereferenceable(4) [[P:%.*]]) {
+; CHECK-SAME: (ptr nonnull align 4 dereferenceable(4) [[P:%.*]]) {
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[P1:%.*]] = bitcast i32* [[P]] to i8*
-; CHECK-NEXT: call void @llvm.assume(i1 true) [ "cold"(), "nonnull"(i32* [[P]]) ]
+; CHECK-NEXT: call void @llvm.assume(i1 true) [ "cold"() ]
; CHECK-NEXT: ret i32 0
;
bb:
- %p1 = bitcast i32* %p to i8*
call void @llvm.assume(i1 true) [ "cold"() ]
- call void @llvm.assume(i1 true) [ "align"(i32* %p, i32 4) ]
- call void @llvm.assume(i1 true) [ "dereferenceable"(i32* %p, i32 4) ]
- call void @llvm.assume(i1 true) [ "align"(i8* %p1, i32 4), "nonnull"(i8* %p1) ]
+ call void @llvm.assume(i1 true) [ "align"(ptr %p, i32 4) ]
+ call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %p, i32 4) ]
+ call void @llvm.assume(i1 true) [ "align"(ptr %p, i32 4), "nonnull"(ptr %p) ]
ret i32 0
}
diff --git a/llvm/test/Transforms/Util/trivial-auto-var-init-crash-20210521.ll b/llvm/test/Transforms/Util/trivial-auto-var-init-crash-20210521.ll
index c19352f8e8ce2..916cca733b09d 100644
--- a/llvm/test/Transforms/Util/trivial-auto-var-init-crash-20210521.ll
+++ b/llvm/test/Transforms/Util/trivial-auto-var-init-crash-20210521.ll
@@ -1,23 +1,21 @@
-; RUN: opt < %s -annotation-remarks -pass-remarks-missed=annotation-remarks -S -o /dev/null 2>&1 | FileCheck %s
+; RUN: opt -annotation-remarks -pass-remarks-missed=annotation-remarks -disable-output < %s 2>&1 | FileCheck %s
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "test.ll"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios14.4.0"
-%struct.frop = type { i8* }
+%struct.frop = type { ptr }
; Function Attrs: argmemonly nofree nosync nounwind willreturn
-declare void @llvm.memset.p0i8.i64(i8* noalias nocapture writeonly, i8, i64, i1 immarg) #0
+declare void @llvm.memset.p0.i64(ptr noalias nocapture writeonly, i8, i64, i1 immarg) #0
define void @spam() local_unnamed_addr #1 !dbg !3 {
bb:
- call void @llvm.dbg.value(metadata %struct.frop* null, metadata !21, metadata !DIExpression()) #3, !dbg !28
- %tmp = getelementptr inbounds %struct.frop, %struct.frop* null, i64 0, i32 0
- %tmp1 = bitcast i8** %tmp to i8*
+ call void @llvm.dbg.value(metadata ptr null, metadata !21, metadata !DIExpression()) #3, !dbg !28
; CHECK: remark: :1:0: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 0 bytes.
- tail call void @llvm.memset.p0i8.i64(i8* %tmp1, i8 0, i64 0, i1 false), !annotation !33, !dbg !28
+ tail call void @llvm.memset.p0.i64(ptr null, i8 0, i64 0, i1 false), !annotation !33, !dbg !28
ret void
}
More information about the llvm-commits
mailing list