[PATCH] D106017: [InstCombine] Look through invariant group intrinsics when removing malloc
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 15 09:03:01 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG04b75c05b033: [InstCombine] Look through invariant group intrinsics when removing malloc (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106017/new/
https://reviews.llvm.org/D106017
Files:
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/malloc-free-delete.ll
Index: llvm/test/Transforms/InstCombine/malloc-free-delete.ll
===================================================================
--- llvm/test/Transforms/InstCombine/malloc-free-delete.ll
+++ llvm/test/Transforms/InstCombine/malloc-free-delete.ll
@@ -440,11 +440,6 @@
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
Index: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -2600,6 +2600,11 @@
case Intrinsic::objectsize:
Users.emplace_back(I);
continue;
+ case Intrinsic::launder_invariant_group:
+ case Intrinsic::strip_invariant_group:
+ Users.emplace_back(I);
+ Worklist.push_back(I);
+ continue;
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106017.359003.patch
Type: text/x-patch
Size: 1385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210715/269a5f0d/attachment.bin>
More information about the llvm-commits
mailing list