Page MenuHomePhabricator

[CodeGen] Use the non-pointer LLT equivalent to check regclass type
Needs ReviewPublic

Authored by lewis-revill on Feb 2 2022, 2:39 AM.

Details

Reviewers
dsanders
arsenm
Summary

When we check the type legality of assigning a given LLT to a register class, we compare the LLT equivalents of the MVTs assigned to the register class to the given LLT. However since no MVTs match to the pointer LLTs, we always return false when given a pointer LLT - even if the type size and shape is legal for the register class.

This patch simply uses the non-pointer LLT equivalent to compare against the LLT equivalents of the MVTs assigned to the register class instead. Thus we can report pointer types as legal for register classes when their size and shape is legal.

Diff Detail

Unit TestsFailed

TimeTest
60,060 msx64 debian > libFuzzer.libFuzzer::large.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/LargeTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/large.test.tmp-LargeTest
690 msx64 debian > libomptarget :: x86_64-pc-linux-gnu.mapping::delete_inf_refcount.c
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -fopenmp -pthread -fno-experimental-isel -I /var/lib/buildkite-agent/builds/llvm-project/openmp/libomptarget/test -I /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/runtime/src -L /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/libomptarget -L /var/lib/buildkite-agent/builds/llvm-project/build/lib -fno-openmp-implicit-rpath -Wl,-rpath,/var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/libomptarget -Wl,-rpath,/var/lib/buildkite-agent/builds/llvm-project/build/lib -fno-openmp-target-new-runtime -fopenmp-targets=x86_64-pc-linux-gnu /var/lib/buildkite-agent/builds/llvm-project/openmp/libomptarget/test/mapping/delete_inf_refcount.c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/libomptarget/test/x86_64-pc-linux-gnu/mapping/Output/delete_inf_refcount.c.tmp && /var/lib/buildkite-agent/builds/llvm-project/build/projects/openmp/libomptarget/test/x86_64-pc-linux-gnu/mapping/Output/delete_inf_refcount.c.tmp | /var/lib/buildkite-agent/builds/llvm-project/build/./bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/openmp/libomptarget/test/mapping/delete_inf_refcount.c

Event Timeline

lewis-revill created this revision.Feb 2 2022, 2:39 AM
lewis-revill requested review of this revision.Feb 2 2022, 2:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2022, 2:39 AM

Bump - is anyone able to review this?

arsenm added a comment.Feb 9 2022, 8:36 AM

Can you add a verifier test for this?

The bridging between LLT and MVT is increasingly painful, we should probably start putting in the effort to move more infrastructure to directly using LLT

Can you add a verifier test for this?

The bridging between LLT and MVT is increasingly painful, we should probably start putting in the effort to move more infrastructure to directly using LLT

Sorry not quite sure what exactly a verifier test refers to. Do you mean an LLC test for the issue in RISC-V that exposed this or something else?

Can you add a verifier test for this?

The bridging between LLT and MVT is increasingly painful, we should probably start putting in the effort to move more infrastructure to directly using LLT

Sorry not quite sure what exactly a verifier test refers to. Do you mean an LLC test for the issue in RISC-V that exposed this or something else?

Yes. You can write a test that fails the verifier and check the verifier output is consistent here. e.g. I added such a test in cea97fc0fcd86d52f9efa215116356b72faeb17d when I added this version