[PATCH] D9380: llvm.noalias - CodeGen support
Hal Finkel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 14 19:52:58 PDT 2017
hfinkel updated this revision to Diff 111119.
hfinkel added a comment.
Rebased.
https://reviews.llvm.org/D9380
Files:
lib/CodeGen/IntrinsicLowering.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/Generic/noalias.ll
Index: test/CodeGen/Generic/noalias.ll
===================================================================
--- /dev/null
+++ 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: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5621,6 +5621,7 @@
case Intrinsic::annotation:
case Intrinsic::ptr_annotation:
case Intrinsic::invariant_group_barrier:
+ case Intrinsic::noalias:
// Drop the intrinsic, but forward the value
setValue(&I, getValue(I.getOperand(0)));
return nullptr;
Index: lib/CodeGen/IntrinsicLowering.cpp
===================================================================
--- lib/CodeGen/IntrinsicLowering.cpp
+++ lib/CodeGen/IntrinsicLowering.cpp
@@ -475,6 +475,11 @@
case Intrinsic::assume:
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9380.111119.patch
Type: text/x-patch
Size: 1435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170815/c5ffec28/attachment.bin>
More information about the llvm-commits
mailing list