Skip to content

[MCP] Use MCRegUnit as the key type of CopyTracker::Copies map. NFC. #98277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

bzEq
Copy link
Collaborator

@bzEq bzEq commented Jul 10, 2024

CopyTracker is in fact tracking at RegUnit level, not MCRegister.

@bzEq bzEq requested review from arsenm and qcolombet July 10, 2024 06:59
@llvmbot
Copy link
Member

llvmbot commented Jul 10, 2024

@llvm/pr-subscribers-llvm-regalloc

Author: Kai Luo (bzEq)

Changes

CopyTracker is indeed tracking at RegUnit level, not MCRegister.


Full diff: https://github.com/llvm/llvm-project/pull/98277.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/MachineCopyPropagation.cpp (+1-1)
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index bdc17e99d1fb0..6adec4adf6c2d 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -112,7 +112,7 @@ class CopyTracker {
     bool Avail;
   };
 
-  DenseMap<MCRegister, CopyInfo> Copies;
+  DenseMap<MCRegUnit, CopyInfo> Copies;
 
 public:
   /// Mark all of the given registers and their subregisters as unavailable for

@spaits spaits self-requested a review July 10, 2024 08:07
Copy link
Contributor

@spaits spaits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it has worked with MCRegister it is better to have the correct type. The changes look good to me. I don't know if my approval is enough or we should also wait for an approval from @qcolombet .

@bzEq
Copy link
Collaborator Author

bzEq commented Jul 10, 2024

Thanks for quick review, I'll leave it open for a couple of days.

@bzEq bzEq merged commit e274d5f into llvm:main Jul 11, 2024
7 checks passed
@bzEq bzEq deleted the key-regunit branch July 11, 2024 00:43
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 11, 2024

LLVM Buildbot has detected a new failure on builder lld-x86_64-ubuntu-fast running on as-builder-4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/432

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=riscv32 -mattr=+m,+d,+zfh,+v,+zvfh      -verify-machineinstrs < /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll | /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll      -check-prefixes=CHECK,CHECK-RV32
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll -check-prefixes=CHECK,CHECK-RV32
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=riscv32 -mattr=+m,+d,+zfh,+v,+zvfh -verify-machineinstrs
RUN: at line 5: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=riscv64 -mattr=+m,+d,+zfh,+v,+zvfh      -verify-machineinstrs < /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll | /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll      -check-prefixes=CHECK,CHECK-RV64,CHECK-OPT
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/FileCheck /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll -check-prefixes=CHECK,CHECK-RV64,CHECK-OPT
+ /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/build/bin/llc -mtriple=riscv64 -mattr=+m,+d,+zfh,+v,+zvfh -verify-machineinstrs
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll:640:19: error: CHECK-OPT-NEXT: is not on the line after the previous match
; CHECK-OPT-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
                  ^
<stdin>:688:2: note: 'next' match was here
 vsetivli zero, 4, e8, mf4, ta, ma
 ^
<stdin>:686:9: note: previous match ended here
# %bb.0:
        ^
<stdin>:687:1: note: non-matching line after previous match is here
 lbu a0, 0(a0)
^
/home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll:658:19: error: CHECK-OPT-NEXT: is not on the line after the previous match
; CHECK-OPT-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
                  ^
<stdin>:703:2: note: 'next' match was here
 vsetivli zero, 4, e16, mf2, ta, ma
 ^
<stdin>:701:9: note: previous match ended here
# %bb.0:
        ^
<stdin>:702:1: note: non-matching line after previous match is here
 flh fa5, 0(a0)
^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-4/ramdisk/lld-x86_64/llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        683:  .variant_cc zero_strided_unmasked_vpload_4i8_i8 
        684: zero_strided_unmasked_vpload_4i8_i8: # @zero_strided_unmasked_vpload_4i8_i8 
        685:  .cfi_startproc 
        686: # %bb.0: 
...

aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
…lvm#98277)

`CopyTracker` is in fact tracking at RegUnit level, not MCRegister.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants