From 82430b91bb177ac40766f2ce605cafbb866ab7f1 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 11 May 2023 13:49:42 -0400 Subject: [PATCH] ac/llvm: Use nir_foreach_phi Signed-off-by: Alyssa Rosenzweig Reviewed-by: Konstantin Seurer Reviewed-by: Jesse Natalie Part-of: --- src/amd/llvm/ac_nir_to_llvm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 55a178ea23c..2803dac3b1f 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -4845,10 +4845,8 @@ static bool visit_block(struct ac_nir_context *ctx, nir_block *block) LLVMPositionBuilderBefore(ctx->ac.builder, LLVMGetFirstInstruction(blockref)); } - nir_foreach_instr(instr, block) { - if (instr->type != nir_instr_type_phi) - break; - visit_phi(ctx, nir_instr_as_phi(instr)); + nir_foreach_phi(phi, block) { + visit_phi(ctx, phi); } LLVMPositionBuilderAtEnd(ctx->ac.builder, blockref);