aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineRegisterInfo.cpp
diff options
context:
space:
mode:
authorPetar Avramovic <Petar.Avramovic@amd.com>2024-02-05 14:07:01 +0100
committerGitHub <noreply@github.com>2024-02-05 14:07:01 +0100
commit06f711a906be85e141bcce9a88ab304dc81e74ef (patch)
tree7813216f56225ecdc746ebdbfcd8e76fc4d57fd2 /llvm/lib/CodeGen/MachineRegisterInfo.cpp
parent89ec940b4a8020e1399e019d845be1a2d2217f69 (diff)
downloadllvm-06f711a906be85e141bcce9a88ab304dc81e74ef.zip
llvm-06f711a906be85e141bcce9a88ab304dc81e74ef.tar.gz
llvm-06f711a906be85e141bcce9a88ab304dc81e74ef.tar.bz2
AMDGPU/GlobalISelDivergenceLowering: select divergent i1 phis (#80003)
Implement PhiLoweringHelper for GlobalISel in DivergenceLoweringHelper. Use machine uniformity analysis to find divergent i1 phis and select them as lane mask phis in same way SILowerI1Copies select VReg_1 phis. Note that divergent i1 phis include phis created by LCSSA and all cases of uses outside of cycle are actually covered by "lowering LCSSA phis". GlobalISel lane masks are registers with sgpr register class and S1 LLT. TODO: General goal is that instructions created in this pass are fully instruction-selected so that selection of lane mask phis is not split across multiple passes. patch 3 from: https://github.com/llvm/llvm-project/pull/73337
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineRegisterInfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
index 087604a..e88487f 100644
--- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
@@ -167,6 +167,15 @@ MachineRegisterInfo::createVirtualRegister(const TargetRegisterClass *RegClass,
return Reg;
}
+Register MachineRegisterInfo::createVirtualRegister(VRegAttrs RegAttr,
+ StringRef Name) {
+ Register Reg = createIncompleteVirtualRegister(Name);
+ VRegInfo[Reg].first = RegAttr.RCOrRB;
+ setType(Reg, RegAttr.Ty);
+ noteNewVirtualRegister(Reg);
+ return Reg;
+}
+
Register MachineRegisterInfo::cloneVirtualRegister(Register VReg,
StringRef Name) {
Register Reg = createIncompleteVirtualRegister(Name);