[llvm] [AMDGPU] PeepholeOptimizer - continue search next new source if a new source found is a subreg (PR #212563)
Frederik Harwath via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 21 06:19:11 PDT 2026
================
@@ -1076,8 +1109,13 @@ bool PeepholeOptimizer::findNextSource(const TargetRegisterClass *DefRC,
// constraints to the register allocator. Moreover, if we want to extend
// the live-range of a physical register, unlike SSA virtual register,
// we will have to check that they aren't redefine before the related use.
- if (CurSrcPair.Reg.isPhysical())
+ if (CurSrcPair.Reg.isPhysical()) {
+ if (FoundSuitable) {
+ FallBackToSuitable();
----------------
frederik-h wrote:
> Instead of falling back, can you defer the point where the rewrite is decided
Do you want it to keep track of all possible sources and then pick the right candidate in the end, if any?
https://github.com/llvm/llvm-project/pull/212563
More information about the llvm-commits
mailing list