summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/MIR
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-17 22:05:15 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-17 22:05:15 +0000
commita617c9162dcc23e1b974c7e30509ef4e303fce33 (patch)
tree8092334818f2afc9894269449bf4138bb0324e7e /llvm/test/CodeGen/MIR
parent05ddbffbf3eba8ef2cac067b0cf8e9c53b78855e (diff)
downloadbcm5719-llvm-a617c9162dcc23e1b974c7e30509ef4e303fce33.tar.gz
bcm5719-llvm-a617c9162dcc23e1b974c7e30509ef4e303fce33.zip
MIR Serialization: Serialize the memory operand's TBAA metadata node.
llvm-svn: 245244
Diffstat (limited to 'llvm/test/CodeGen/MIR')
-rw-r--r--llvm/test/CodeGen/MIR/X86/memory-operands.mir34
-rw-r--r--llvm/test/CodeGen/MIR/X86/unknown-metadata-keyword.mir25
2 files changed, 59 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/MIR/X86/memory-operands.mir b/llvm/test/CodeGen/MIR/X86/memory-operands.mir
index 7b4d60b0044..0a3f13a9ab8 100644
--- a/llvm/test/CodeGen/MIR/X86/memory-operands.mir
+++ b/llvm/test/CodeGen/MIR/X86/memory-operands.mir
@@ -111,6 +111,27 @@
ret i32 8
}
+ %struct.XXH_state64_t = type { i32, i32, i64, i64, i64 }
+
+ @a = common global i32 0, align 4
+
+ define i32 @tbaa_metadata() {
+ entry:
+ %0 = load i32, i32* @a, align 4, !tbaa !2
+ %1 = inttoptr i32 %0 to %struct.XXH_state64_t*
+ %total_len2 = bitcast %struct.XXH_state64_t* %1 to i32*
+ %2 = load i32, i32* %total_len2, align 4, !tbaa !6
+ ret i32 %2
+ }
+
+ !2 = !{!3, !3, i64 0}
+ !3 = !{!"int", !4, i64 0}
+ !4 = !{!"omnipotent char", !5, i64 0}
+ !5 = !{!"Simple C/C++ TBAA"}
+ !6 = !{!7, !3, i64 0}
+ !7 = !{!"XXH_state64_t", !3, i64 0, !3, i64 4, !8, i64 8, !8, i64 16, !8, i64 24}
+ !8 = !{!"long long", !4, i64 0}
+
...
---
name: test
@@ -338,3 +359,16 @@ body: |
%eax = MOV32ri 8
RETQ %eax
...
+---
+name: tbaa_metadata
+tracksRegLiveness: true
+body: |
+ bb.0.entry:
+ %rax = MOV64rm %rip, 1, _, @a, _ :: (load 8 from got)
+ ; CHECK-LABEL: name: tbaa_metadata
+ ; CHECK: %eax = MOV32rm killed %rax, 1, _, 0, _, implicit-def %rax :: (load 4 from %ir.a, !tbaa !2)
+ ; CHECK-NEXT: %eax = MOV32rm killed %rax, 1, _, 0, _ :: (load 4 from %ir.total_len2, !tbaa !6)
+ %eax = MOV32rm killed %rax, 1, _, 0, _, implicit-def %rax :: (load 4 from %ir.a, !tbaa !2)
+ %eax = MOV32rm killed %rax, 1, _, 0, _ :: (load 4 from %ir.total_len2, !tbaa !6)
+ RETQ %eax
+...
diff --git a/llvm/test/CodeGen/MIR/X86/unknown-metadata-keyword.mir b/llvm/test/CodeGen/MIR/X86/unknown-metadata-keyword.mir
new file mode 100644
index 00000000000..c58c38ab132
--- /dev/null
+++ b/llvm/test/CodeGen/MIR/X86/unknown-metadata-keyword.mir
@@ -0,0 +1,25 @@
+# RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s
+
+--- |
+ define i32 @inc(i32* %x) {
+ entry:
+ %0 = load i32, i32* %x
+ %1 = add i32 %0, 1
+ store i32 %1, i32* %x
+ ret i32 %1
+ }
+...
+---
+name: inc
+tracksRegLiveness: true
+liveins:
+ - { reg: '%rdi' }
+body: |
+ bb.0.entry:
+ liveins: %rdi
+ ; CHECK: [[@LINE+1]]:60: use of unknown metadata keyword '!tba'
+ %eax = MOV32rm %rdi, 1, _, 0, _ :: (load 4 from %ir.x, !tba !0)
+ %eax = INC32r killed %eax, implicit-def dead %eflags
+ MOV32mr killed %rdi, 1, _, 0, _, %eax :: (store 4 into %ir.x)
+ RETQ %eax
+...
OpenPOWER on IntegriCloud