[llvm] r323342 - [globalisel] Introduce LegalityQuery to better encapsulate the legalizer decisions. NFC.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 11:48:59 PST 2018



> On 24 Jan 2018, at 11:43, Justin Bogner <mail at justinbogner.com> wrote:
> 
> Daniel Sanders via llvm-commits <llvm-commits at lists.llvm.org> writes:
>> Author: dsanders
>> Date: Wed Jan 24 09:17:46 2018
>> New Revision: 323342
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=323342&view=rev
>> Log:
>> [globalisel] Introduce LegalityQuery to better encapsulate the legalizer decisions. NFC.
>> 
>> Summary:
>> `getAction(const InstrAspect &) const` breaks encapsulation by exposing
>> the smaller components that are used to decide how to legalize an
>> instruction.
> ...
>> Modified: llvm/trunk/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp?rev=323342&r1=323341&r2=323342&view=diff
>> ==============================================================================
>> --- llvm/trunk/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp (original)
>> +++ llvm/trunk/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp Wed Jan 24 09:17:46 2018
>> @@ -60,29 +60,29 @@ TEST(LegalizerInfoTest, ScalarRISC) {
>> 
>>   for (unsigned opcode : {G_ADD, G_SUB}) {
>>     // Check we infer the correct types and actually do what we're told.
>> -    ASSERT_EQ(L.getAction({opcode, LLT::scalar(8)}),
>> -              std::make_pair(LegalizerInfo::WidenScalar, LLT::scalar(32)));
>> -    ASSERT_EQ(L.getAction({opcode, LLT::scalar(16)}),
>> -              std::make_pair(LegalizerInfo::WidenScalar, LLT::scalar(32)));
>> -    ASSERT_EQ(L.getAction({opcode, LLT::scalar(32)}),
>> -              std::make_pair(LegalizerInfo::Legal, LLT::scalar(32)));
>> -    ASSERT_EQ(L.getAction({opcode, LLT::scalar(64)}),
>> -              std::make_pair(LegalizerInfo::Legal, LLT::scalar(64)));
>> +    ASSERT_EQ(L.getAction({opcode, {LLT::scalar(8)}}),
>> +              LegalizerInfo::LegalizeActionStep(LegalizerInfo::WidenScalar, 0, LLT::scalar(32)));
>> +    ASSERT_EQ(L.getAction({opcode, {LLT::scalar(16)}}),
>> +              LegalizerInfo::LegalizeActionStep(LegalizerInfo::WidenScalar, 0, LLT::scalar(32)));
>> +    ASSERT_EQ(L.getAction({opcode, {LLT::scalar(32)}}),
>> +              LegalizerInfo::LegalizeActionStep(LegalizerInfo::Legal, 0, LLT{}));
>> +    ASSERT_EQ(L.getAction({opcode, {LLT::scalar(64)}}),
>> +              LegalizerInfo::LegalizeActionStep(LegalizerInfo::Legal, 0, LLT{}));
> 
> Looks like you've added a bunch of long lines in the tests. Please
> clang-format.

I thought I'd caught all of those but it looks like that was in D42251 instead of this commit. I'll fix this


More information about the llvm-commits mailing list