diff options
author | Alex Coplan <alex.coplan@arm.com> | 2024-01-16 21:20:45 +0000 |
---|---|---|
committer | Alex Coplan <alex.coplan@arm.com> | 2024-01-23 16:49:13 +0000 |
commit | 3d82ebb696f50f02c6519c368118a019a460fa9e (patch) | |
tree | 972f93855b7d4e10447a12f8ceb2d8fb471a4be2 /gcc/testsuite/gcc.c-torture | |
parent | 49bfda6017e105df46fa8d12d7f067da423a1d3c (diff) | |
download | gcc-3d82ebb696f50f02c6519c368118a019a460fa9e.zip gcc-3d82ebb696f50f02c6519c368118a019a460fa9e.tar.gz gcc-3d82ebb696f50f02c6519c368118a019a460fa9e.tar.bz2 |
aarch64: Fix up debug uses in ldp/stp pass [PR113089]
As the PR shows, we were missing code to update debug uses in the
load/store pair fusion pass. This patch fixes that.
The patch tries to give a complete treatment of the debug uses that will
be affected by the changes we make, and in particular makes an effort to
preserve debug info where possible, e.g. when re-ordering an update of
a base register by a constant over a debug use of that register. When
re-ordering loads over a debug use of a transfer register, we reset the
debug insn. Likewise when re-ordering stores over debug uses of mem.
While doing this I noticed that try_promote_writeback used a strange
choice of move_range for the pair insn, in that it chose the previous
nondebug insn instead of the insn itself. Since the insn is being
changed, these move ranges are equivalent (at least in terms of nondebug
insn placement as far as RTL-SSA is concerned), but I think it is more
natural to choose the pair insn itself. This is needed to avoid
incorrectly updating some debug uses.
gcc/ChangeLog:
PR target/113089
* config/aarch64/aarch64-ldp-fusion.cc (reset_debug_use): New.
(fixup_debug_use): New.
(fixup_debug_uses_trailing_add): New.
(fixup_debug_uses): New. Use it ...
(ldp_bb_info::fuse_pair): ... here.
(try_promote_writeback): Call fixup_debug_uses_trailing_add to
fix up debug uses of the base register that are affected by
folding in the trailing add insn.
gcc/testsuite/ChangeLog:
PR target/113089
* gcc.c-torture/compile/pr113089.c: New test.
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr113089.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr113089.c b/gcc/testsuite/gcc.c-torture/compile/pr113089.c new file mode 100644 index 0000000..70c71f2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr113089.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-g -funroll-loops" } */ + +typedef unsigned short uint16; + +void intrapred_chroma_plane(uint16 ***mb_preds, int* max_imgpel_values, int crx, int cry, int px) { + for (int uv = 0; uv < 2; uv++) { + uint16 **mb_pred = mb_preds[uv + 1]; + uint16 **predU2 = &mb_pred[px - 2]; + uint16 *upPred = &mb_pred[px][px]; + int max_imgpel_value = max_imgpel_values[uv]; + + int ih = upPred[crx - 1]; + for (int i = 0; i < crx*3; ++i) + ih += upPred[crx*3]; + + int iv = (mb_pred[cry - 1][px+1]); + for (int i = 0; i < cry - 1; ++i) { + iv += (i + 1) * (*(mb_preds[uv][0]) - *(*predU2--)); + } + + for (int j = 0; j < cry; ++j) + for (int i = 0; i < crx; ++i) + mb_pred[j][i] = (uint16) (max_imgpel_value * ((i * ih + iv))); + } +} |