Page MenuHomePhabricator

[GlobalISel] Do not crash on widening vector result
Needs ReviewPublic

Authored by sepavloff on Jun 24 2022, 11:44 AM.

Details

Reviewers
arsenm
foad
Summary

Function buildCopyToRegs did not handle properly the case when it should
make wider vector result. It happened, for example, in a function that
returns value of type <2 x f32>, which should be widen to <4 x f32> to
fit XMM register on X86. The function eventually calls
MachineIRBuilder::buildUnmerge, which does not expect that only one
destination register is specified.

Now this case is treated specifically in buildCopyToRegs.

Diff Detail

Unit TestsFailed

TimeTest
60,080 msx64 debian > AddressSanitizer-x86_64-linux-dynamic.TestCases::scariness_score_test.cpp
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libasan -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/scariness_score_test.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Output/scariness_score_test.cpp.tmp
60,080 msx64 debian > AddressSanitizer-x86_64-linux.TestCases::scariness_score_test.cpp
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/scariness_score_test.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/scariness_score_test.cpp.tmp

Event Timeline

sepavloff created this revision.Jun 24 2022, 11:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 11:44 AM
sepavloff requested review of this revision.Jun 24 2022, 11:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 11:44 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.Jun 24 2022, 12:04 PM
llvm/test/CodeGen/X86/GlobalISel/x86_64-irtranslator.ll
368

Can you add a few additional cases with odd elements that also are widened

378

Missing space