This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Apply clang_builtin_alias to overloaded builtins.
ClosedPublic

Authored by HsiangKai on Apr 16 2021, 9:08 AM.

Details

Summary

We only apply clang_builtin_alias to non-masked builtins.
Masked builtins could not use clang_builtin_alias because the operand order is different between overloaded intrinsics and builtins.

A bunch of test cases need to be updated. I only update clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vadd.c for demonstration.

The total testing time for ./bin/llvm-lit -q ../../source/llvm-project/clang/test/CodeGen/RISCV/rvv-intrinsics/ reduced to 1m54.194s from 2m31.482s on my machine.

Diff Detail

Event Timeline

HsiangKai created this revision.Apr 16 2021, 9:08 AM
HsiangKai requested review of this revision.Apr 16 2021, 9:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 16 2021, 9:08 AM
HsiangKai edited the summary of this revision. (Show Details)Apr 16 2021, 9:11 AM

I think you also need to handle PermuteOperands field?
PermuteOperands performs the order permutation for non-masked and masked intrinsics when the operand order is different to builtins.

HsiangKai updated this revision to Diff 338349.Apr 17 2021, 6:34 PM

Consider PermuteOperands.

khchen accepted this revision.Apr 18 2021, 1:39 AM

LGTM.

This revision is now accepted and ready to land.Apr 18 2021, 1:39 AM
HsiangKai updated this revision to Diff 339607.Apr 22 2021, 6:45 AM
HsiangKai retitled this revision from [RISCV] Apply __clang_riscv_builtin_alias to overloaded builtins. to [RISCV] Apply clang_builtin_alias to overloaded builtins..
HsiangKai edited the summary of this revision. (Show Details)

Apply `clang_builtin_alias`.

This revision was landed with ongoing or failed builds.Apr 25 2021, 3:12 AM
This revision was automatically updated to reflect the committed changes.