This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Avoid SCALAR_TO_VECTOR for single FP constant vector.
ClosedPublic

Authored by fhahn on Mar 25 2021, 2:56 PM.

Details

Summary

Currently the code only checks for integer constants (ConstantSDNode)
and triggers an infinite cycle for single-element floating point
vector constants.

I've added a lambda used in a few places to make sure we always check
for both FP and integer constants.

Diff Detail

Event Timeline

fhahn created this revision.Mar 25 2021, 2:56 PM
fhahn requested review of this revision.Mar 25 2021, 2:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2021, 2:56 PM
david-arm added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
9689

It's just a thought, but this looks like a useful static function in it's own right that could live in a header somewhere? There are other parts of codegen that check the same thing, i.e.

DAGCombiner::visitBITCAST
DAGCombiner::getStoreMergeCandidates
llvm/test/CodeGen/AArch64/arm64-build-vector.ll
94

This appears to be unused

fhahn updated this revision to Diff 333589.Mar 26 2021, 10:38 AM

Updated to use isIntOrFPConstant (D99428) and removed unused pointer argument from test. Thanks!

fhahn marked an inline comment as done.Mar 26 2021, 10:41 AM
fhahn added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
9689

That's a great idea, thanks! I put up D99384

t.p.northover accepted this revision.Mar 31 2021, 1:32 AM

Looks like a good change to me.

This revision is now accepted and ready to land.Mar 31 2021, 1:32 AM
This revision was landed with ongoing or failed builds.Mar 31 2021, 2:18 AM
This revision was automatically updated to reflect the committed changes.