Skip to content

Commit dc72d87

Browse files
committed
Build LLVM wrap getFirstNonPHI by version
1 parent fe40234 commit dc72d87

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

rpcs3/Emu/CPU/CPUTranslator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ cpu_translator::cpu_translator(llvm::Module* _module, bool is_be)
7171
result = m_ir->CreateInsertElement(v, m_ir->CreateExtractElement(data0, m_ir->CreateExtractElement(mask, i)), i);
7272
v->addIncoming(result, loop);
7373
m_ir->CreateCondBr(m_ir->CreateICmpULT(i, m_ir->getInt32(16)), loop, next);
74+
#if LLVM_VERSION_MAJOR >= 21 || (LLVM_VERSION_MAJOR == 20 && LLVM_VERSION_MINOR >= 1)
7475
m_ir->SetInsertPoint(next->getFirstNonPHIIt());
76+
#else
77+
m_ir->SetInsertPoint(next->getFirstNonPHI());
78+
#endif
7579
result = m_ir->CreateSelect(m_ir->CreateICmpSLT(index, zeros), zeros, result);
7680

7781
return result;

rpcs3/Emu/Cell/SPULLVMRecompiler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,7 +2617,11 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator
26172617
{
26182618
if (b2 != bqbi)
26192619
{
2620+
#if LLVM_VERSION_MAJOR >= 21 || (LLVM_VERSION_MAJOR == 20 && LLVM_VERSION_MINOR >= 1)
26202621
auto ins = &*b2->block->getFirstNonPHIIt();
2622+
#else
2623+
auto ins = b2->block->getFirstNonPHI();
2624+
#endif
26212625

26222626
if (b2->bb->preds.size() == 1)
26232627
{

0 commit comments

Comments
 (0)