diff options
| author | David Green <david.green@arm.com> | 2019-02-12 15:02:57 +0000 |
|---|---|---|
| committer | David Green <david.green@arm.com> | 2019-02-12 15:02:57 +0000 |
| commit | c93c6f32744ab19da07ee764793afe5b5c24be9e (patch) | |
| tree | adf621945903f131e74fb0833864a6a5738c6706 /llvm/test/CodeGen/Thumb | |
| parent | 4b78d4f3470dcbe4978457e4b1347bc0be150ca7 (diff) | |
| download | bcm5719-llvm-c93c6f32744ab19da07ee764793afe5b5c24be9e.tar.gz bcm5719-llvm-c93c6f32744ab19da07ee764793afe5b5c24be9e.zip | |
[Codegen] Make sure kill flags are not incorrect from removed machine phi's
We need to clear the kill flags on both SingleValReg and OldReg, to ensure they remain
conservatively correct.
Differential Revision: https://reviews.llvm.org/D58114
llvm-svn: 353847
Diffstat (limited to 'llvm/test/CodeGen/Thumb')
| -rw-r--r-- | llvm/test/CodeGen/Thumb/opt-phis.mir | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Thumb/opt-phis.mir b/llvm/test/CodeGen/Thumb/opt-phis.mir new file mode 100644 index 00000000000..e3d0a8bb1f7 --- /dev/null +++ b/llvm/test/CodeGen/Thumb/opt-phis.mir @@ -0,0 +1,38 @@ +# RUN: llc -mtriple thumbv6m-none-eabi -run-pass=opt-phis -verify-machineinstrs -o - %s | FileCheck %s +--- | + target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" + target triple = "thumbv6m-arm-none-eabi" + + define i32 @funca() { unreachable } + +... +--- +name: funca +tracksRegLiveness: true +body: | + bb.0: + successors: %bb.2(0x40000000), %bb.3(0x40000000) + + %0:tgpr, dead $cpsr = tMOVi8 255, 14, $noreg + %1:tgpr, dead $cpsr = tMOVi8 128, 14, $noreg + tCMPi8 %0, 0, 14, $noreg, implicit-def $cpsr + tBcc %bb.3, 1, $cpsr + + bb.2: + successors: %bb.3(0x80000000) + + bb.3: + successors: %bb.0(0x80000000) + + %2:tgpr = PHI %0, %bb.2, %0, %bb.0 + %3:tgpr, $cpsr = tSUBrr %1, killed %2, 14, $noreg + %4:tgpr, $cpsr = tADDrr killed %3, killed %0, 14, $noreg + tB %bb.0, 14, $noreg + +# Make sure the kill flags are not incorrect +# CHECK-LABEL: name: funca +# CHECK-NOT: PHI +# CHECK: tSUBrr %1, %0 +# CHECK: tADDrr killed %3, %0 + +... |

