Skip to content

PeepholeOpt: Immediately check if a reg_sequence compose supports a subregister #128279

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

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Feb 22, 2025

This is a quick fix for EXPENSIVE_CHECKS bot failures. I still think we could
defer looking for a compatible subregister further up the use-def chain, and
should be able to check compatibilty with the ultimate found source.

…ubregister

This is a quick fix for EXPENSIVE_CHECKS bot failures. I still think we could
defer looking for a compatible subregister further up the use-def chain, and
should be able to check compatibilty with the ultimate found source.
Copy link
Contributor Author

arsenm commented Feb 22, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@arsenm
Copy link
Contributor Author

arsenm commented Feb 24, 2025

ping

// TODO: Should we modify the register class to support the index?
const TargetRegisterClass *SrcRC = MRI.getRegClass(RegSeqInput.Reg);
const TargetRegisterClass *SrcWithSubRC =
TRI->getSubClassWithSubReg(SrcRC, ComposedDefInSrcReg1);
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the return in the test case given?
Is it null -- is the comparison with the SrcRC important?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the class matters:

Here it's SrcWithSubRC: DPR_VFP2 SrcRC: DPR. We would need to restrict the register class to the subclass with the subreg

@arsenm arsenm merged commit c53eb93 into main Feb 26, 2025
15 checks passed
@arsenm arsenm deleted the users/arsenm/peephole-opt-check-regclass-supports-subreg-fix-expensive-checks branch February 26, 2025 03:15
@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 26, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-bootstrap-ubsan running on sanitizer-buildbot4 while building llvm at step 2 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89281 tests, 88 workers --
Testing:  0.. 10.. 20.
FAIL: Extra Tools Unit Tests :: clang-include-fixer/./ClangIncludeFixerTests/3/15 (23849 of 89281)
******************** TEST 'Extra Tools Unit Tests :: clang-include-fixer/./ClangIncludeFixerTests/3/15' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/tools/extra/unittests/clang-include-fixer/./ClangIncludeFixerTests-Extra Tools Unit Tests-2647189-3-15.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=15 GTEST_SHARD_INDEX=3 /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/tools/extra/unittests/clang-include-fixer/./ClangIncludeFixerTests
--

Note: This is test shard 4 of 15.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from IncludeFixer
[ RUN      ] IncludeFixer.NestedName
future_error was thrown in -fno-exceptions mode #0 0x0000595f4056048e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:804:13
 #1 0x0000595f4055d4e6 llvm::sys::RunSignalHandlers() /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #2 0x0000595f405610bc SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
 #3 0x00007006ab445250 (/lib/x86_64-linux-gnu/libc.so.6+0x45250)
 #4 0x00007006ab4a3f1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0xa3f1c)
 #5 0x00007006ab44519e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4519e)
 #6 0x00007006ab428902 abort (/lib/x86_64-linux-gnu/libc.so.6+0x28902)
 #7 0x00007006ab8f3a8c std::__1::__libcpp_verbose_abort(char const*, ...) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/libcxx/src/verbose_abort.cpp:62:3
 #8 0x0000595f4047ef52 std::__1::__throw_future_error[abi:nn210000](std::__1::future_errc) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/future:519:3
 #9 0x0000595f4047eead set_value<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex> > > /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/future:624:5
#10 0x0000595f4047eead std::__1::__async_assoc_state<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>>, std::__1::__async_func<std::__1::function<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>> ()>>>::__execute() /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/future:858:11
#11 0x0000595f4047efd5 reset /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:284:21
#12 0x0000595f4047efd5 ~unique_ptr /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:256:71
#13 0x0000595f4047efd5 ~__tuple_leaf /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/tuple:307:7
#14 0x0000595f4047efd5 ~tuple /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/tuple:538:28
#15 0x0000595f4047efd5 operator() /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:76:5
#16 0x0000595f4047efd5 reset /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:287:7
#17 0x0000595f4047efd5 ~unique_ptr /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:256:71
#18 0x0000595f4047efd5 void* std::__1::__thread_proxy[abi:nn210000]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (std::__1::__async_assoc_state<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>>, std::__1::__async_func<std::__1::function<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>> ()>>>::*)(), std::__1::__async_assoc_state<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>>, std::__1::__async_func<std::__1::function<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>> ()>>>*>>(void*) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__thread/thread.h:210:1
#19 0x00007006ab4a1e2e (/lib/x86_64-linux-gnu/libc.so.6+0xa1e2e)
#20 0x00007006ab533a4c (/lib/x86_64-linux-gnu/libc.so.6+0x133a4c)

--
exit: -6
--
shard JSON output does not exist: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/tools/extra/unittests/clang-include-fixer/./ClangIncludeFixerTests-Extra Tools Unit Tests-2647189-3-15.json
********************
Step 11 (stage2/ubsan check) failure: stage2/ubsan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using ld.lld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using lld-link: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:512: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89281 tests, 88 workers --
Testing:  0.. 10.. 20.
FAIL: Extra Tools Unit Tests :: clang-include-fixer/./ClangIncludeFixerTests/3/15 (23849 of 89281)
******************** TEST 'Extra Tools Unit Tests :: clang-include-fixer/./ClangIncludeFixerTests/3/15' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/tools/extra/unittests/clang-include-fixer/./ClangIncludeFixerTests-Extra Tools Unit Tests-2647189-3-15.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=15 GTEST_SHARD_INDEX=3 /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/tools/extra/unittests/clang-include-fixer/./ClangIncludeFixerTests
--

Note: This is test shard 4 of 15.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from IncludeFixer
[ RUN      ] IncludeFixer.NestedName
future_error was thrown in -fno-exceptions mode #0 0x0000595f4056048e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:804:13
 #1 0x0000595f4055d4e6 llvm::sys::RunSignalHandlers() /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #2 0x0000595f405610bc SignalHandler(int, siginfo_t*, void*) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
 #3 0x00007006ab445250 (/lib/x86_64-linux-gnu/libc.so.6+0x45250)
 #4 0x00007006ab4a3f1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0xa3f1c)
 #5 0x00007006ab44519e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4519e)
 #6 0x00007006ab428902 abort (/lib/x86_64-linux-gnu/libc.so.6+0x28902)
 #7 0x00007006ab8f3a8c std::__1::__libcpp_verbose_abort(char const*, ...) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/libcxx/src/verbose_abort.cpp:62:3
 #8 0x0000595f4047ef52 std::__1::__throw_future_error[abi:nn210000](std::__1::future_errc) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/future:519:3
 #9 0x0000595f4047eead set_value<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex> > > /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/future:624:5
#10 0x0000595f4047eead std::__1::__async_assoc_state<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>>, std::__1::__async_func<std::__1::function<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>> ()>>>::__execute() /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/future:858:11
#11 0x0000595f4047efd5 reset /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:284:21
#12 0x0000595f4047efd5 ~unique_ptr /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:256:71
#13 0x0000595f4047efd5 ~__tuple_leaf /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/tuple:307:7
#14 0x0000595f4047efd5 ~tuple /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/tuple:538:28
#15 0x0000595f4047efd5 operator() /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:76:5
#16 0x0000595f4047efd5 reset /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:287:7
#17 0x0000595f4047efd5 ~unique_ptr /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__memory/unique_ptr.h:256:71
#18 0x0000595f4047efd5 void* std::__1::__thread_proxy[abi:nn210000]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (std::__1::__async_assoc_state<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>>, std::__1::__async_func<std::__1::function<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>> ()>>>::*)(), std::__1::__async_assoc_state<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>>, std::__1::__async_func<std::__1::function<std::__1::unique_ptr<clang::include_fixer::SymbolIndex, std::__1::default_delete<clang::include_fixer::SymbolIndex>> ()>>>*>>(void*) /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/libcxx_install_ubsan/include/c++/v1/__thread/thread.h:210:1
#19 0x00007006ab4a1e2e (/lib/x86_64-linux-gnu/libc.so.6+0xa1e2e)
#20 0x00007006ab533a4c (/lib/x86_64-linux-gnu/libc.so.6+0x133a4c)

--
exit: -6
--
shard JSON output does not exist: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/clang/tools/extra/unittests/clang-include-fixer/./ClangIncludeFixerTests-Extra Tools Unit Tests-2647189-3-15.json
********************

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.

4 participants