summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-10-28 11:17:59 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-10-28 11:17:59 +0000
commit39c1ce4dc15446a25ad73e6aad95b97dfd2f0f67 (patch)
tree4f09c1bd8e84d6c69011e5aedad691c5c65be17d /llvm/test/CodeGen/SystemZ
parentd0cdc67caa8e495fe17e2d8e31ae245766fb8cce (diff)
downloadbcm5719-llvm-39c1ce4dc15446a25ad73e6aad95b97dfd2f0f67.tar.gz
bcm5719-llvm-39c1ce4dc15446a25ad73e6aad95b97dfd2f0f67.zip
Keep TBAA info when rewriting SelectionDAG loads and stores
Most SelectionDAG code drops the TBAA info when creating a new form of a load and store (e.g. during legalization, or when converting a plain load to an extending one). This patch tries to catch all cases where the TBAA information can legitimately be carried over. The patch adds alternative forms of getLoad() and getExtLoad() that take a MachineMemOperand instead of individual fields. (The corresponding getTruncStore() already exists.) The idea is to use the MachineMemOperand forms when all fields are carried over (size, pointer info, isVolatile, isNonTemporal, alignment and TBAA info). If some adjustment is being made, e.g. to narrow the load, then we still pass the individual fields but also pass the TBAA info. llvm-svn: 193517
Diffstat (limited to 'llvm/test/CodeGen/SystemZ')
-rw-r--r--llvm/test/CodeGen/SystemZ/alias-01.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/alias-01.ll b/llvm/test/CodeGen/SystemZ/alias-01.ll
new file mode 100644
index 00000000000..e00d3c8b0a5
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/alias-01.ll
@@ -0,0 +1,20 @@
+; Test 32-bit ANDs in which the second operand is variable.
+;
+; RUN: llc < %s -mtriple=s390x-linux-gnu -combiner-alias-analysis \
+; RUN: -combiner-global-alias-analysis | FileCheck %s
+
+; Check that there are no spills.
+define void @f1(<16 x i32> *%src1, <16 x float> *%dest) {
+; CHECK-LABEL: f1:
+; CHECK-NOT: %r15
+; CHECK: br %r14
+ %val = load <16 x i32> *%src1, !tbaa !1
+ %add = add <16 x i32> %val, %val
+ %res = bitcast <16 x i32> %add to <16 x float>
+ store <16 x float> %res, <16 x float> *%dest, !tbaa !2
+ ret void
+}
+
+!0 = metadata !{ metadata !"root" }
+!1 = metadata !{ metadata !"set1", metadata !0 }
+!2 = metadata !{ metadata !"set2", metadata !0 }
OpenPOWER on IntegriCloud