diff options
author | Kai Nacke <kai@redstar.de> | 2022-06-23 23:31:19 -0400 |
---|---|---|
committer | Kai Nacke <kai@redstar.de> | 2022-11-13 11:07:27 -0500 |
commit | cfbf673065aa3d3787b443b870957440119951e2 (patch) | |
tree | a06561e3774c990fef2840f28c5f3e1ed430f2f0 | |
parent | 3423154d87857d3e7b35074b21e33f1f39a87310 (diff) | |
download | llvm-cfbf673065aa3d3787b443b870957440119951e2.zip llvm-cfbf673065aa3d3787b443b870957440119951e2.tar.gz llvm-cfbf673065aa3d3787b443b870957440119951e2.tar.bz2 |
[m88k] Better support for PHI
-rw-r--r-- | llvm/lib/Target/M88k/GISel/M88kInstructionSelector.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Target/M88k/GISel/M88kLegalizerInfo.cpp | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/M88k/GISel/M88kInstructionSelector.cpp b/llvm/lib/Target/M88k/GISel/M88kInstructionSelector.cpp index 1dd1375..acc3deae 100644 --- a/llvm/lib/Target/M88k/GISel/M88kInstructionSelector.cpp +++ b/llvm/lib/Target/M88k/GISel/M88kInstructionSelector.cpp @@ -790,6 +790,13 @@ bool M88kInstructionSelector::select(MachineInstr &I) { case TargetOpcode::G_MERGE_VALUES: case TargetOpcode::G_UNMERGE_VALUES: return selectMergeUnmerge(I, MBB, MRI); + case TargetOpcode::G_PHI: { + I.setDesc(TII.get(TargetOpcode::PHI)); + + Register DstReg = I.getOperand(0).getReg(); + const TargetRegisterClass *RC = guessRegClass(DstReg, MRI, TRI, RBI); + return RBI.constrainGenericRegister(DstReg, *RC, MRI); + } default: return false; } diff --git a/llvm/lib/Target/M88k/GISel/M88kLegalizerInfo.cpp b/llvm/lib/Target/M88k/GISel/M88kLegalizerInfo.cpp index 345f3bc..b1d9b24 100644 --- a/llvm/lib/Target/M88k/GISel/M88kLegalizerInfo.cpp +++ b/llvm/lib/Target/M88k/GISel/M88kLegalizerInfo.cpp @@ -30,6 +30,7 @@ M88kLegalizerInfo::M88kLegalizerInfo(const M88kSubtarget &ST) { const LLT S64 = LLT::scalar(64); const LLT S80 = LLT::scalar(80); const LLT P0 = LLT::pointer(0, 32); + getActionDefinitionsBuilder(G_PHI).legalFor({S32, P0}); getActionDefinitionsBuilder(G_SELECT) .customForCartesianProduct({S32, S64, P0}, {S1}); getActionDefinitionsBuilder({G_IMPLICIT_DEF, G_FREEZE}).legalFor({S32}); |