mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-22 04:22:57 +02:00
a2d7c39420
Work towards the unification of MIR and debug output by refactoring the interfaces. For MachineOperand::print, keep a simple version that can be easily called from `dump()`, and a more complex one which will be called from both the MIRPrinter and MachineInstr::print. Add extra checks inside MachineOperand for detached operands (operands with getParent() == nullptr). https://reviews.llvm.org/D40836 * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+)<def> ([^ ]+)/kill: \1 def \2 \3/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: \1 \2 def \3/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: def ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: def \1 \2 def \3/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/<def>//g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<kill>/killed \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use,kill>/implicit killed \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<dead>/dead \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<def[ ]*,[ ]*dead>/dead \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def[ ]*,[ ]*dead>/implicit-def dead \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def>/implicit-def \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use>/implicit \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<internal>/internal \1/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<undef>/undef \1/g' llvm-svn: 320022
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
# RUN: llc -march=hexagon -run-pass branch-folder -run-pass if-converter -verify-machineinstrs %s -o - | FileCheck %s
|
|
|
|
# The hoisting of common instructions from successors could cause registers
|
|
# to no longer be live-in in the successor blocks. The liveness was updated
|
|
# to include potential new live-in registres, but not to remove registers
|
|
# that were no longer live-in.
|
|
# This could cause if-converter to generate incorrect code.
|
|
#
|
|
# In this testcase, the "r1 = A2_sxth killed r0" was hoisted, and since r0
|
|
# was killed, it was no longer live-in in either successor. The if-converter
|
|
# then created code, where the first predicated instruction has incorrect
|
|
# implicit use of r0:
|
|
#
|
|
# %bb.0:
|
|
# Live Ins: %R0
|
|
# %R1 = A2_sxth killed %R0 ; hoisted, kills r0
|
|
# A2_nop implicit-def %P0
|
|
# %R0 = C2_cmoveit %P0, 2, implicit %R0 ; predicated A2_tfrsi
|
|
# %R0 = C2_cmoveif killed %P0, 1, implicit %R0 ; predicated A2_tfrsi
|
|
# %R0 = A2_add killed %R0, killed %R1
|
|
# J2_jumpr %R31, implicit dead %PC
|
|
#
|
|
|
|
# CHECK: %r1 = A2_sxth killed %r0
|
|
# CHECK: %r0 = C2_cmoveit %p0, 2
|
|
# CHECK-NOT: implicit-def %r0
|
|
# CHECK: %r0 = C2_cmoveif killed %p0, 1, implicit killed %r0
|
|
|
|
---
|
|
name: fred
|
|
tracksRegLiveness: true
|
|
|
|
body: |
|
|
bb.0:
|
|
liveins: %r0
|
|
successors: %bb.1, %bb.2
|
|
|
|
A2_nop implicit-def %p0
|
|
J2_jumpt killed %p0, %bb.2, implicit-def dead %pc
|
|
|
|
bb.1:
|
|
successors: %bb.3
|
|
liveins: %r0
|
|
%r1 = A2_sxth killed %r0
|
|
%r0 = A2_tfrsi 1
|
|
J2_jump %bb.3, implicit-def %pc
|
|
|
|
bb.2:
|
|
successors: %bb.3
|
|
liveins: %r0
|
|
%r1 = A2_sxth killed %r0
|
|
%r0 = A2_tfrsi 2
|
|
|
|
bb.3:
|
|
liveins: %r0, %r1
|
|
%r0 = A2_add killed %r0, killed %r1
|
|
J2_jumpr %r31, implicit-def dead %pc
|
|
...
|
|
|