[PATCH] D68496: [PATCH 13/38] [noalias] D9380: llvm.noalias - CodeGen support
Jeroen Dobbelaere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 4 14:40:18 PDT 2019
jeroen.dobbelaere created this revision.
jeroen.dobbelaere added reviewers: hfinkel, jdoerfert.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
This is part of the series started by D68484 <https://reviews.llvm.org/D68484>.
Rebase of D9380 <https://reviews.llvm.org/D9380>
https://reviews.llvm.org/D68496
Files:
llvm/lib/CodeGen/IntrinsicLowering.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/Generic/noalias.ll
Index: llvm/test/CodeGen/Generic/noalias.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/Generic/noalias.ll
@@ -0,0 +1,12 @@
+; RUN: llc < %s
+
+define i8* @main(i8* %p) {
+ %v = call i8* @llvm.noalias.p0i8(i8* %p, metadata !1)
+ ret i8* %v
+}
+
+declare i8* @llvm.noalias.p0i8(i8*, metadata) nounwind
+
+!0 = !{!0, !"some domain"}
+!1 = !{!1, !0, !"some scope"}
+
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6409,6 +6409,7 @@
case Intrinsic::annotation:
case Intrinsic::ptr_annotation:
+ case Intrinsic::noalias:
case Intrinsic::launder_invariant_group:
case Intrinsic::strip_invariant_group:
// Drop the intrinsic, but forward the value
Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
===================================================================
--- llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp
@@ -371,6 +371,11 @@
case Intrinsic::var_annotation:
break; // Strip out these intrinsics
+ case Intrinsic::noalias:
+ // Just forward the value
+ CI->replaceAllUsesWith(CI->getOperand(0));
+ break;
+
case Intrinsic::memcpy: {
Type *IntPtr = DL.getIntPtrType(Context);
Value *Size = Builder.CreateIntCast(CI->getArgOperand(2), IntPtr,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68496.223296.patch
Type: text/x-patch
Size: 1495 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191004/30b1da90/attachment.bin>
More information about the llvm-commits
mailing list