summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-08-29 19:50:15 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-08-29 19:50:15 +0000
commit354832e585723dad6bf2a60e74efe2f5c0368748 (patch)
tree4f145f75fe6e2b7aa61489d603cb46af9cd23b0f
parent44c35e80b165cbd193a39966b7ba434b676071c0 (diff)
downloadbcm5719-llvm-354832e585723dad6bf2a60e74efe2f5c0368748.tar.gz
bcm5719-llvm-354832e585723dad6bf2a60e74efe2f5c0368748.zip
Propagate TBAA info in SelectionDAG::getIndexedLoad
Patch by Pranav Bhandarkar. llvm-svn: 279998
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp3
-rw-r--r--llvm/test/CodeGen/Hexagon/post-inc-aa-metadata.ll37
2 files changed, 39 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 5c0aa3930ca..6cefa820c20 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5146,7 +5146,8 @@ SDValue SelectionDAG::getIndexedLoad(SDValue OrigLoad, const SDLoc &dl,
LD->getMemOperand()->getFlags() & ~MachineMemOperand::MOInvariant;
return getLoad(AM, LD->getExtensionType(), OrigLoad.getValueType(), dl,
LD->getChain(), Base, Offset, LD->getPointerInfo(),
- LD->getMemoryVT(), LD->getAlignment(), MMOFlags);
+ LD->getMemoryVT(), LD->getAlignment(), MMOFlags,
+ LD->getAAInfo());
}
SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
diff --git a/llvm/test/CodeGen/Hexagon/post-inc-aa-metadata.ll b/llvm/test/CodeGen/Hexagon/post-inc-aa-metadata.ll
new file mode 100644
index 00000000000..fb2f038e6e5
--- /dev/null
+++ b/llvm/test/CodeGen/Hexagon/post-inc-aa-metadata.ll
@@ -0,0 +1,37 @@
+; RUN: llc -march=hexagon -debug-only=isel < %s 2>&1 | FileCheck %s
+; REQUIRES: asserts
+
+; Check that the generated post-increment load has TBAA information.
+; CHECK-LABEL: Machine code for function fred:
+; CHECK: = V6_vL32b_pi %vreg{{[0-9]+}}<tied1>, 64; mem:LD64[{{.*}}](tbaa=
+
+target triple = "hexagon"
+
+; Function Attrs: norecurse nounwind
+define void @fred(<16 x i32>* nocapture %p, <16 x i32>* nocapture readonly %q, i32 %n) local_unnamed_addr #0 {
+entry:
+ %tobool2 = icmp eq i32 %n, 0
+ br i1 %tobool2, label %while.end, label %while.body
+
+while.body: ; preds = %entry, %while.body
+ %n.addr.05 = phi i32 [ %dec, %while.body ], [ %n, %entry ]
+ %q.addr.04 = phi <16 x i32>* [ %incdec.ptr, %while.body ], [ %q, %entry ]
+ %p.addr.03 = phi <16 x i32>* [ %incdec.ptr1, %while.body ], [ %p, %entry ]
+ %dec = add i32 %n.addr.05, -1
+ %incdec.ptr = getelementptr inbounds <16 x i32>, <16 x i32>* %q.addr.04, i32 1
+ %0 = load <16 x i32>, <16 x i32>* %q.addr.04, align 64, !tbaa !1
+ %incdec.ptr1 = getelementptr inbounds <16 x i32>, <16 x i32>* %p.addr.03, i32 1
+ store <16 x i32> %0, <16 x i32>* %p.addr.03, align 64, !tbaa !1
+ %tobool = icmp eq i32 %dec, 0
+ br i1 %tobool, label %while.end, label %while.body
+
+while.end: ; preds = %while.body, %entry
+ ret void
+}
+
+attributes #0 = { norecurse nounwind "target-cpu"="hexagonv60" "target-features"="+hvx,-hvx-double" }
+
+
+!1 = !{!2, !2, i64 0}
+!2 = !{!"omnipotent char", !3, i64 0}
+!3 = !{!"Simple C/C++ TBAA"}
OpenPOWER on IntegriCloud