[clang] 9320ac9 - [Clang] Only run test when X86 backend is built.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 2 14:28:21 PDT 2021


On Thu, Apr 1, 2021 at 1:29 PM Florian Hahn <flo at fhahn.com> wrote:
>
>
>
> On Thu, Apr 1, 2021 at 8:11 PM David Blaikie <dblaikie at gmail.com> wrote:
>>
>> On Thu, Apr 1, 2021 at 1:16 AM Florian Hahn <flo at fhahn.com> wrote:
>> >
>> > Hi,
>> >
>> > On Tue, Mar 30, 2021 at 7:52 PM David Blaikie <dblaikie at gmail.com> wrote:
>> >>
>> >> Is there a more reliable remark that could be tested for? (Clang shouldn't be testing all remarks - just that the remark infrastructure in general is wired up (specific remarks should be tested in llvm) - so picking some really stable remark would be great)
>> >>
>> >> maybe there's a remark for "this always_inline thing can't be inlined because it's recursive" for instance?
>> >>
>> >
>> > That's a great point, there certainly are more stable remarks, e.g. inlining as you suggested or GVN. I can add a separate test for that, so we can still keep testing the vectorization remark. WDYT?
>>
>> Actually my goal was to stop testing the vectorization remark in
>> clang, if it's not an especially stable remark - the remark should be
>> tested in LLVM in any case (even if it's also tested in Clang). So
>> ideally we'd test some really simple, stable, reliable remark in clang
>> that validates that the remark infrastructure works with clang - and
>> we'd test all the nitty gritty specific remarks down in LLVM only.
>
>
> Ah, got it!
>
> I think this test specifically tests the vectorization remark, because Clang adds some extra information to the remark. I'm not really familiar with the code myself, but the suggestion about using the pragma is Clang specific I think. Some of the relevant code should be https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CodeGenAction.cpp#L751

Ah, thanks for explaining/pointing that out - that does complicate
things. Yeah, that invalidates my suggestion/not sure how to stabilize
the test and make it more portable/reliable - short of writing a mock
LLVM pass that is just designed for testing clang by being able to be
configured to emit certain remarks, but that's likely overkill.

Thanks for helping me understand!

- Dave


More information about the cfe-commits mailing list