[llvm] r285227 - Revert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory."
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 27 11:39:42 PDT 2016
Hi Chad,
It still might be good to recommit this, but only handling @llvm.assume. It only "writes" to memory to prevent the call itself from being hoisted, and changes to the AST won't affect that.
Thanks again,
Hal
----- Original Message -----
> From: "Chad Rosier via llvm-commits" <llvm-commits at lists.llvm.org>
> To: llvm-commits at lists.llvm.org
> Sent: Wednesday, October 26, 2016 2:18:19 PM
> Subject: [llvm] r285227 - Revert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect
> memory."
>
> Author: mcrosier
> Date: Wed Oct 26 14:18:19 2016
> New Revision: 285227
>
> URL: http://llvm.org/viewvc/llvm-project?rev=285227&view=rev
> Log:
> Revert "[AliasSetTracker] Make AST smarter about intrinsics that
> don't actually affect memory."
>
> This reverts commit r285191.
>
> LICM appears to rely on the Alias Set Tracker hitting lifetime
> markers to prevent
> code from being moved outside of the original scope.
>
> Removed:
> llvm/trunk/test/Analysis/AliasSet/intrinsics.ll
> Modified:
> llvm/trunk/lib/Analysis/AliasSetTracker.cpp
>
> Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=285227&r1=285226&r2=285227&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original)
> +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Wed Oct 26 14:18:19
> 2016
> @@ -413,21 +413,6 @@ void AliasSetTracker::add(MemTransferIns
> void AliasSetTracker::addUnknown(Instruction *Inst) {
> if (isa<DbgInfoIntrinsic>(Inst))
> return; // Ignore DbgInfo Intrinsics.
> -
> - if (auto *II = dyn_cast<IntrinsicInst>(Inst)) {
> - // These intrinsics will show up as affecting memory, but they
> are just
> - // markers.
> - switch (II->getIntrinsicID()) {
> - default:
> - break;
> - case Intrinsic::lifetime_start:
> - case Intrinsic::lifetime_end:
> - case Intrinsic::invariant_start:
> - case Intrinsic::invariant_end:
> - case Intrinsic::assume:
> - return;
> - }
> - }
> if (!Inst->mayReadOrWriteMemory())
> return; // doesn't alias anything
>
>
> Removed: llvm/trunk/test/Analysis/AliasSet/intrinsics.ll
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/AliasSet/intrinsics.ll?rev=285226&view=auto
> ==============================================================================
> --- llvm/trunk/test/Analysis/AliasSet/intrinsics.ll (original)
> +++ llvm/trunk/test/Analysis/AliasSet/intrinsics.ll (removed)
> @@ -1,54 +0,0 @@
> -; RUN: opt -basicaa -print-alias-sets -S -o - < %s 2>&1 | FileCheck
> %s
> -
> -; CHECK: Alias sets for function 'test1':
> -; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
> -; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod
> Pointers: (i8* %a, 1)
> -; CHECK-NOT: 1 Unknown instruction
> -; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod
> Pointers: (i8* %b, 1)
> -define void @test1(i32 %c) {
> -entry:
> - %a = alloca i8, align 1
> - %b = alloca i8, align 1
> - store i8 1, i8* %a, align 1
> - %cond1 = icmp ne i32 %c, 0
> - call void @llvm.assume(i1 %cond1)
> - store i8 1, i8* %b, align 1
> - ret void
> -}
> -
> -; CHECK: Alias sets for function 'test2':
> -; CHECK: Alias Set Tracker: 2 alias sets for 2 pointer values.
> -; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod
> Pointers: (i8* %a, 1)
> -; CHECK-NOT: 2 Unknown instructions
> -; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod
> Pointers: (i8* %b, 1)
> -; CHECK-NOT: 2 Unknown instructions
> -define void @test2(i8* %ptr) {
> -entry:
> - %a = alloca i8, align 1
> - call void @llvm.lifetime.start(i64 1, i8* %a)
> - %b = alloca i8, align 1
> - call void @llvm.lifetime.start(i64 1, i8* %b)
> - store i8 1, i8* %a, align 1
> - call void @llvm.lifetime.end(i64 1, i8* %a)
> - store i8 1, i8* %b, align 1
> - call void @llvm.lifetime.end(i64 1, i8* %b)
> - ret void
> -}
> -
> -; CHECK: Alias sets for function 'test3':
> -; CHECK: Alias Set Tracker: 1 alias sets for 1 pointer values.
> -; CHECK: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod
> Pointers: (i8* %ptr, 1)
> -; CHECK-NOT: 2 Unknown instructions
> -define void @test3(i8* %ptr) {
> - store i8 5, i8* %ptr
> - %i = call {}* @llvm.invariant.start.p0i8(i64 1, i8* %ptr)
> - call void @llvm.invariant.end.p0i8({}* %i, i64 1, i8* %ptr)
> - store i8 6, i8* %ptr
> - ret void
> -}
> -
> -declare void @llvm.assume(i1)
> -declare void @llvm.lifetime.start(i64, i8* nocapture)
> -declare void @llvm.lifetime.end(i64, i8* nocapture)
> -declare {}* @llvm.invariant.start.p0i8(i64, i8* nocapture) nounwind
> readonly
> -declare void @llvm.invariant.end.p0i8({}*, i64, i8* nocapture)
> nounwind
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
More information about the llvm-commits
mailing list