[PATCH] D68492: [PATCH 09/38] [noalias] D9376: llvm.noalias - handling of dead intrinsics

Andrei Elovikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 10:23:08 PDT 2019


a.elovikov added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:5156
+    if (isa<UndefValue>(Arg0) ||
+        (isa<ConstantPointerNull>(Arg0) &&
+         Arg0->getType()->getPointerAddressSpace() == 0))
----------------
What if we have

  %i = ptr2int %p
  %null = sub %i, %i
  %nullptr = int2ptr %null
  %scope = call @llvm.noalias(%nullptr) ; introduce the scope
  %null2 = ptr2int %scope
  %i2 = add %null2, %i
  %same.as.orig.p = int2ptr %i2

Why don't we want `%same.as.orig.p` to have the scope?


================
Comment at: llvm/test/Transforms/InstSimplify/noalias.ll:8
+; CHECK-LABEL: @test1
+; CHECK-NOT: llvm.noalias.p0i8
+; CHECK: ret void
----------------
Simplify to `CHECK-NEXT: ret void`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68492/new/

https://reviews.llvm.org/D68492





More information about the llvm-commits mailing list