From f63ad39e7da18dd3502036b9b4f1203750bd9ea9 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Thu, 22 Jun 2017 15:53:31 +0000 Subject: [Hexagon] Handle a global operand to A2_addi when creating duplexes llvm-svn: 306012 --- .../CodeGen/Hexagon/duplex-addi-global-imm.mir | 22 ++++++++++++++++++++++ llvm/test/MC/Hexagon/duplex-addi-global-imm.s | 15 +++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 llvm/test/CodeGen/Hexagon/duplex-addi-global-imm.mir create mode 100644 llvm/test/MC/Hexagon/duplex-addi-global-imm.s (limited to 'llvm/test') diff --git a/llvm/test/CodeGen/Hexagon/duplex-addi-global-imm.mir b/llvm/test/CodeGen/Hexagon/duplex-addi-global-imm.mir new file mode 100644 index 00000000000..be86abb9508 --- /dev/null +++ b/llvm/test/CodeGen/Hexagon/duplex-addi-global-imm.mir @@ -0,0 +1,22 @@ +# RUN: llc -march=hexagon -start-after if-converter %s -o - | FileCheck %s +# This used to crash. +# CHECK: add(r0,##g0) + +--- | + @g = global i32 0 + define void @fred() { + ret void + } +... + +--- +name: fred +tracksRegLiveness: true + +body: | + bb.0: + liveins: %r0 + %r0 = A2_addi %r0, @g + %r1 = A2_tfrsi 0 +... + diff --git a/llvm/test/MC/Hexagon/duplex-addi-global-imm.s b/llvm/test/MC/Hexagon/duplex-addi-global-imm.s new file mode 100644 index 00000000000..e8e338c6a58 --- /dev/null +++ b/llvm/test/MC/Hexagon/duplex-addi-global-imm.s @@ -0,0 +1,15 @@ +# RUN: llvm-mc -arch=hexagon -show-encoding %s | FileCheck %s +# Check that we generate a duplex for this packet. +# CHECK: encoding: [A,0x40'A',A,A,0x01'B',0x28'B',B,0x20'B'] + +.data +g: +.long 0 + +.text + { + r0 = add(r0,##g) + r1 = #0 + } + + -- cgit v1.2.3