summaryrefslogtreecommitdiff
path: root/test/CodeGen/SystemZ/alias-01.ll
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
commit66589dcc8fb5dcf0894a9a80a8dee890a4f3a379 (patch)
tree958d99bb4d3324f285793579819e2f929f816462 /test/CodeGen/SystemZ/alias-01.ll
parent188545867dbcd0a6870b19c6b06d49610e7cda93 (diff)
downloadllvm-66589dcc8fb5dcf0894a9a80a8dee890a4f3a379.tar.gz
llvm-66589dcc8fb5dcf0894a9a80a8dee890a4f3a379.tar.bz2
llvm-66589dcc8fb5dcf0894a9a80a8dee890a4f3a379.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ/alias-01.ll')
-rw-r--r--test/CodeGen/SystemZ/alias-01.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/alias-01.ll b/test/CodeGen/SystemZ/alias-01.ll
new file mode 100644
index 0000000000..e00d3c8b0a
--- /dev/null
+++ b/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 }