Page MenuHomePhabricator

[IROutliner] Avoid reusing PHINodes that have already been matched when merging outlined functions' phi node blocks
ClosedPublic

Authored by AndrewLitteken on Mar 9 2022, 10:58 AM.

Details

Summary

https://godbolt.org/z/63r5hzKsT

When there are two external phi nodes for two different outlined regions, when compressing the created phi nodes between the two regions, the matching for the second phi node in the second region matches the first phi node created for the first region rather than the second phi node created for the first region. This adds an extra output path where there should not be one.

The fix is the ignore phi nodes that have already been matched for each region.

Diff Detail

Unit TestsFailed

TimeTest
60,310 msx64 debian > Clang.CodeGen/RISCV/rvv-intrinsics::vluxseg_mask.c
Script: -- : 'RUN: at line 3'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/clang -cc1 -internal-isystem /var/lib/buildkite-agent/builds/llvm-project/build/lib/clang/15.0.0/include -nostdsysteminc -triple riscv64 -target-feature +f -target-feature +d -target-feature +zfh -target-feature +v -disable-O0-optnone -emit-llvm /var/lib/buildkite-agent/builds/llvm-project/clang/test/CodeGen/RISCV/rvv-intrinsics/vluxseg_mask.c -o - | /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt -S -mem2reg | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck --check-prefix=CHECK-RV64 /var/lib/buildkite-agent/builds/llvm-project/clang/test/CodeGen/RISCV/rvv-intrinsics/vluxseg_mask.c
60,270 msx64 debian > Clang.CodeGen/RISCV/rvv-intrinsics-overloaded::vloxseg_mask.c
Script: -- : 'RUN: at line 3'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/clang -cc1 -internal-isystem /var/lib/buildkite-agent/builds/llvm-project/build/lib/clang/15.0.0/include -nostdsysteminc -triple riscv64 -target-feature +f -target-feature +d -target-feature +v -disable-O0-optnone -emit-llvm /var/lib/buildkite-agent/builds/llvm-project/clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vloxseg_mask.c -o - | /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt -S -mem2reg | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck --check-prefix=CHECK-RV64 /var/lib/buildkite-agent/builds/llvm-project/clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vloxseg_mask.c

Event Timeline

AndrewLitteken created this revision.Mar 9 2022, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2022, 10:58 AM
AndrewLitteken requested review of this revision.Mar 9 2022, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2022, 10:58 AM
This revision is now accepted and ready to land.Mar 9 2022, 11:21 AM
This revision was landed with ongoing or failed builds.Mar 14 2022, 10:00 AM
This revision was automatically updated to reflect the committed changes.