Page MenuHomePhabricator

[RISCV] Apply clang_builtin_alias to overloaded builtins.
ClosedPublic

Authored by HsiangKai on Fri, Apr 16, 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.Fri, Apr 16, 9:08 AM
HsiangKai requested review of this revision.Fri, Apr 16, 9:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptFri, Apr 16, 9:08 AM
HsiangKai edited the summary of this revision. (Show Details)Fri, Apr 16, 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.Sat, Apr 17, 6:34 PM

Consider PermuteOperands.

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

LGTM.

This revision is now accepted and ready to land.Sun, Apr 18, 1:39 AM
HsiangKai updated this revision to Diff 339607.Thu, Apr 22, 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.Sun, Apr 25, 3:12 AM
This revision was automatically updated to reflect the committed changes.