This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Remove calls to VectorType::getNumElements from clang
ClosedPublic

Authored by ctetreau on Jun 25 2020, 10:31 AM.

Diff Detail

Event Timeline

ctetreau created this revision.Jun 25 2020, 10:31 AM
c-rhodes added inline comments.Jul 23 2020, 1:28 AM
clang/lib/CodeGen/CGBuiltin.cpp
5623–5625

Is there a reason you can't do a single cast here?

ctetreau marked an inline comment as done.Jul 23 2020, 8:16 AM
ctetreau added inline comments.
clang/lib/CodeGen/CGBuiltin.cpp
5623–5625

GetNeonType should probably just return a FixedVectorType.

ctetreau updated this revision to Diff 280254.Jul 23 2020, 2:08 PM

address code review issues

there's a few places the getNumElements calls can be fixed by getting the initial cast right

clang/lib/CodeGen/CGBuiltin.cpp
5994

cast here

9840

cast here

clang/lib/CodeGen/CGExpr.cpp
1770

cast here

1804

cast here

2219

missed one here

clang/lib/CodeGen/CGExprScalar.cpp
1561

cast here

clang/lib/CodeGen/SwiftCallingConv.cpp
321

cast here

ctetreau planned changes to this revision.Aug 5 2020, 9:56 AM

I plan to investigate the changes proposed by @c-rhodes. I'm a bit swamped right now so it may take a bit.

ctetreau marked 8 inline comments as done.Aug 25 2020, 11:33 AM
ctetreau added inline comments.
clang/lib/CodeGen/CGExpr.cpp
1770

that would be a behavior change because of the dyn_cast.

1804

that would be a behavior change because of the dyn_cast

2219

this VTy is a clang::VectorType

clang/lib/CodeGen/SwiftCallingConv.cpp
321

this would be a behavior change due to dyn_cast

ctetreau updated this revision to Diff 287755.Aug 25 2020, 12:39 PM
ctetreau marked 4 inline comments as done.

address code review issues, rebase

RKSimon accepted this revision.Aug 26 2020, 2:09 AM

LGTM

This revision is now accepted and ready to land.Aug 26 2020, 2:09 AM