This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add interpolation builtins
ClosedPublic

Authored by timcorringham on May 15 2018, 4:39 AM.

Details

Summary

Added builtins for the interpolation intrinsics, and related LIT
test.

Diff Detail

Repository
rC Clang

Event Timeline

timcorringham created this revision.May 15 2018, 4:39 AM
timcorringham added reviewers: arsenm, tpr, dstuttard, Restricted Project.May 15 2018, 4:47 AM
arsenm added inline comments.May 15 2018, 7:17 AM
include/clang/Basic/BuiltinsAMDGPU.def
111–115

You will also need C++ handling for these when the intrinsics are fixed to use name mangling

test/CodeGenOpenCL/builtins-amdgcn-interp.cl
3–29

These should be emitting / checking the IR, not the output asm

timcorringham added inline comments.May 15 2018, 8:07 AM
include/clang/Basic/BuiltinsAMDGPU.def
111–115

Can you expand on that please, I don't know what needs to be done here?

test/CodeGenOpenCL/builtins-amdgcn-interp.cl
3–29

Checking the IR doesn't allow you to check the behavior very well, as there are differences depending on the target-cpu which are not apparent in the IR.

arsenm added inline comments.May 18 2018, 1:33 AM
include/clang/Basic/BuiltinsAMDGPU.def
111–115

In the other review I commented you should change the existing intrinsics to use name mangling instead of adding a second set. Once you do that, GCCBuiltin no longer works. You have to add some code like the other type mangled intrinsics in lib/CodeGen/CGBuiltin.cpp

test/CodeGenOpenCL/builtins-amdgcn-interp.cl
3–29

That is a codegen test which we have (or should have) in the backend. I know we have some for the f32 variants.

Clang tests should only be checking that the produced IR is correct

[AMDGPU] Add interpolation builtins

Updated LIT test so that it only tests for the existence of the builtins
by checking the IR.

arsenm accepted this revision.Jul 9 2018, 3:14 AM

LGTM. Checking the full operands wouldn't hurt though.

This revision is now accepted and ready to land.Jul 9 2018, 3:14 AM
This revision was automatically updated to reflect the committed changes.