This is an archive of the discontinued LLVM Phabricator instance.

[VFABI] Add LLVM internal mangling for vector functions.
ClosedPublic

Authored by fpetrogalli on Nov 11 2019, 9:22 AM.

Details

Summary

This patch adds a custom ISA for vector functions for internal use
in LLVM. The <isa> token is set to "_LLVM_VF_", and it is not attached
to any specific instruction Vector ISA, or Vector Function ABI.

The ISA is used as a token for handling Vector Function ABI-style
vectorization for those vector functions that are not directly
associated to any existing Vector Function ABI (for example, some of
the vector functions exposed by TargetLibraryInfo). The demangling
function for this ISA in a Vector Function ABI context is set to be
the same as the common one shared between X86 and AArch64.

Event Timeline

fpetrogalli created this revision.Nov 11 2019, 9:22 AM
sdesmalen accepted this revision.Nov 12 2019, 1:45 AM

Nice and simple patch, LGTM!

llvm/include/llvm/Analysis/VectorUtils.h
51–53

nit: maybe drop the _VF and use LLVM directly? (also for other uses in this file)

This revision is now accepted and ready to land.Nov 12 2019, 1:45 AM
fpetrogalli marked an inline comment as done.Nov 12 2019, 6:40 AM
fpetrogalli added inline comments.
llvm/include/llvm/Analysis/VectorUtils.h
51–53

I'd prefer llvm::LLVM_VF. The alternative llvm::LLVM is less appealing to me, because it doesn't say anything about it's meaning. In the former, at least VF stands for Vector Function.

Once could argue that we could move the variable into the VFABI namespace, so that llvm::VFABI::LLVM would be slightly more specific, but I'd rather not do this too because I suspect that the llvm::LLVM_VF ISA coudl be used also outside of a VFABI context (like we do it now for the other vector extensions).

So, overall, I think we should stay with llvm::LLVM_VF.

fpetrogalli marked an inline comment as done.Nov 12 2019, 6:47 AM
fpetrogalli added inline comments.
llvm/include/llvm/Analysis/VectorUtils.h
51–53

*Never* reply to a code review before having coffee.

llvm::VFISAKind::LLVMwill be.

I have changed LLVM_VF to LLVM in the VFISAKind enum class.

I have updated the way we represent the token for the internal name ISA used by LLVM. The token is used only in a VFABI context, so I moved it in the VFABI namespace. In there, the name can be simplified to _LLVM_ as the VFABI namespace specializes the name already.

fpetrogalli marked an inline comment as done.Nov 12 2019, 12:39 PM

Cosmetic changes to comments and commit message. [NFC]

This revision was automatically updated to reflect the committed changes.