This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][Altivec] Fix constant argument for vec_dss
ClosedPublic

Authored by jsji on Aug 23 2019, 9:14 PM.

Details

Summary

This is similar to vec_ct* in https://reviews.llvm.org/rL304205.

The argument must be a constant, otherwise instruction selection
will fail. always_inline is not enough for isel to always fold
everything away at -O0.

The fix is to turn the function into macros in altivec.h.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43072

Diff Detail

Repository
rL LLVM

Event Timeline

jsji created this revision.Aug 23 2019, 9:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2019, 9:14 PM
jsji added a reviewer: Restricted Project.Aug 23 2019, 9:15 PM
wuzish added inline comments.Sep 2 2019, 8:15 PM
clang/test/CodeGen/builtins-ppc-error.c
78 ↗(On Diff #217000)

It would be better if add range constraint check at Sema::CheckPPCBuiltinFunctionCall

jsji updated this revision to Diff 218479.Sep 3 2019, 10:04 AM

Add range check and test.

jsji marked 2 inline comments as done.Sep 3 2019, 10:07 AM
jsji added inline comments.
clang/test/CodeGen/builtins-ppc-error.c
78 ↗(On Diff #217000)

Good point, Done. Thanks.

wuzish accepted this revision.Sep 3 2019, 7:18 PM
This revision is now accepted and ready to land.Sep 3 2019, 7:18 PM
This revision was automatically updated to reflect the committed changes.
jsji marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2019, 7:01 AM