[PATCH] D23076: Support for lifetime begin/end markers in the use optimizer

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 15:02:56 PDT 2016


george.burgess.iv accepted this revision.
george.burgess.iv added a comment.
This revision is now accepted and ready to land.

LGTM with nits; thanks!


================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:180
@@ +179,3 @@
+      case Intrinsic::lifetime_end:
+        {
+        if (AA.isMustAlias(MemoryLocation(II->getArgOperand(1)), Loc))
----------------
Please kill these brackets

================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:181
@@ +180,3 @@
+        {
+        if (AA.isMustAlias(MemoryLocation(II->getArgOperand(1)), Loc))
+          return true;
----------------
`return AA.isMustAlias(...);`?

================
Comment at: test/Transforms/Util/MemorySSA/lifetime-simple.ll:2
@@ +1,3 @@
+; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
+define i8 @test(i8* %P, i8* %Q) {
----------------
Please add a newline after this line

================
Comment at: test/Transforms/Util/MemorySSA/lifetime-simple.ll:10
@@ +9,3 @@
+  call void @llvm.lifetime.start(i64 32, i8* %P)
+; CHECK-DAG:  MemoryUse(liveOnEntry)
+  %0 = load i8, i8* %P
----------------
Is there a reason these aren't vanilla CHECKs?

(If not, please also add the `; CHECK-NEXT: %0 = load ...` after each check for MemoryDef/MemoryUse, for consistency with the other tests)


https://reviews.llvm.org/D23076





More information about the llvm-commits mailing list