aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineRegisterInfo.cpp
diff options
context:
space:
mode:
authorAlexander Timofeev <alexander.timofeev@amd.com>2022-09-09 19:32:51 +0200
committerAlexander Timofeev <alexander.timofeev@amd.com>2022-09-15 22:03:56 +0200
commitfbdea5a2e9169be524463aae6663d958b94a2685 (patch)
tree588994dbf9054c02387b48c45c0997c2c85ebdf7 /llvm/lib/CodeGen/MachineRegisterInfo.cpp
parented188b39aba0b766f3cec66295638d7251c687fb (diff)
downloadllvm-fbdea5a2e9169be524463aae6663d958b94a2685.zip
llvm-fbdea5a2e9169be524463aae6663d958b94a2685.tar.gz
llvm-fbdea5a2e9169be524463aae6663d958b94a2685.tar.bz2
[AMDGPU] Always select s_cselect_b32 for uniform 'select' SDNode
This patch contains changes necessary to carry physical condition register (SCC) dependencies through the SDNode scheduler. It adds the edge in the SDNodeScheduler dependency graph instead of inserting the SCC copy between each definition and use. This approach lets the scheduler place instructions in an optimal way placing the copy only when the dependency cannot be resolved. Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D133593
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineRegisterInfo.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
index c96de7a..e48f1be 100644
--- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
@@ -79,10 +79,10 @@ constrainRegClass(MachineRegisterInfo &MRI, Register Reg,
return NewRC;
}
-const TargetRegisterClass *
-MachineRegisterInfo::constrainRegClass(Register Reg,
- const TargetRegisterClass *RC,
- unsigned MinNumRegs) {
+const TargetRegisterClass *MachineRegisterInfo::constrainRegClass(
+ Register Reg, const TargetRegisterClass *RC, unsigned MinNumRegs) {
+ if (Reg.isPhysical())
+ return nullptr;
return ::constrainRegClass(*this, Reg, getRegClass(Reg), RC, MinNumRegs);
}