Page MenuHomePhabricator

[LV] Fix crash when optimized phi is feeding first-order recurrence.

Authored by fhahn on Nov 29 2021, 9:44 AM.



This patch fixes a crash when a phi with an optimized cast feeds a
first-order recurrence, as discussed in D113183.

There are 2 issues that this patch addresses:

  1. The recipe for the optimized cast is not recorded.
  2. fixHeaderPhis assumes the incoming def defines a single VPValue.

If the incoming value is an induction phi recipe, always use the first
defined value, which represents the phi itself.

Diff Detail

Unit TestsFailed

31,360 msx64 debian > libFuzzer.libFuzzer::fork.test
Script: -- : 'RUN: at line 3'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/SimpleTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/fork.test.tmp-SimpleTest

Event Timeline

fhahn created this revision.Nov 29 2021, 9:44 AM
fhahn requested review of this revision.Nov 29 2021, 9:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2021, 9:44 AM
Herald added a subscriber: vkmr. · View Herald Transcript
fhahn abandoned this revision.Dec 5 2021, 5:04 AM

Removing of dead casts can be done directly in VPlan, so there's no need for special handling of induction recipes: D115112