[llvm] d3816ef - Precommit test for D106017
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 14 14:15:37 PDT 2021
Author: Arthur Eubanks
Date: 2021-07-14T14:14:49-07:00
New Revision: d3816ef042d7506e154fb708456147a11264895c
URL: https://github.com/llvm/llvm-project/commit/d3816ef042d7506e154fb708456147a11264895c
DIFF: https://github.com/llvm/llvm-project/commit/d3816ef042d7506e154fb708456147a11264895c.diff
LOG: Precommit test for D106017
Added:
Modified:
llvm/test/Transforms/InstCombine/malloc-free-delete.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/malloc-free-delete.ll b/llvm/test/Transforms/InstCombine/malloc-free-delete.ll
index ee7341424607..646b9e0efa9f 100644
--- a/llvm/test/Transforms/InstCombine/malloc-free-delete.ll
+++ b/llvm/test/Transforms/InstCombine/malloc-free-delete.ll
@@ -149,7 +149,7 @@ define void @test6a(i8* %foo) minsize {
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i8* [[FOO:%.*]], null
; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: tail call void @_ZdlPv(i8* [[FOO]]) #[[ATTR8:[0-9]+]]
+; CHECK-NEXT: tail call void @_ZdlPv(i8* [[FOO]]) #[[ATTR10:[0-9]+]]
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
; CHECK-NEXT: ret void
@@ -352,7 +352,7 @@ define void @test10() {
define void @test11() {
; CHECK-LABEL: @test11(
-; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable(8) i8* @_Znwm(i64 8) #[[ATTR8]]
+; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable(8) i8* @_Znwm(i64 8) #[[ATTR10]]
; CHECK-NEXT: call void @_ZdlPv(i8* nonnull [[CALL]])
; CHECK-NEXT: ret void
;
@@ -418,7 +418,7 @@ define void @test14(i8* %foo) nofree {
; TODO: free call marked no-free -> %foo must be null
define void @test15(i8* %foo) {
; CHECK-LABEL: @test15(
-; CHECK-NEXT: call void @free(i8* [[FOO:%.*]]) #[[ATTR6:[0-9]+]]
+; CHECK-NEXT: call void @free(i8* [[FOO:%.*]]) #[[ATTR7:[0-9]+]]
; CHECK-NEXT: ret void
;
call void @free(i8* %foo) nofree
@@ -434,3 +434,23 @@ define void @test16(i8* nonnull nofree %foo) {
call void @free(i8* %foo)
ret void
}
+
+declare i8* @llvm.launder.invariant.group(i8*)
+declare i8* @llvm.strip.invariant.group(i8*)
+
+define void @test17() {
+; CHECK-LABEL: @test17(
+; CHECK-NEXT: [[NW1:%.*]] = call dereferenceable(32) i8* @_Znwm(i64 32) #[[ATTR10]]
+; CHECK-NEXT: [[NW2:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nonnull [[NW1]])
+; CHECK-NEXT: [[TMP1:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* nonnull [[NW1]])
+; CHECK-NEXT: store i8 1, i8* [[TMP1]], align 1
+; CHECK-NEXT: call void @_ZdlPv(i8* [[NW2]]) #[[ATTR10]]
+; CHECK-NEXT: ret void
+;
+ %nw1 = call i8* @_Znwm(i64 32) builtin
+ %nw2 = call i8* @llvm.launder.invariant.group(i8* %nw1)
+ %nw3 = call i8* @llvm.strip.invariant.group(i8* %nw2)
+ store i8 1, i8* %nw3
+ call void @_ZdlPv(i8* %nw2) builtin
+ ret void
+}
More information about the llvm-commits
mailing list