This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Improve codegen for some constant vectors by using constant pool loads
ClosedPublic

Authored by aemerson on Jun 22 2020, 6:26 PM.

Details

Summary

There's more smarts in AArch64ISelLowering that we don't have yet, but this change incrementally improves some of the more common patterns. I think future iterations will want to use some combination of PostLegalizerCombiner and the selector to catch the other cases.

Diff Detail

Event Timeline

aemerson created this revision.Jun 22 2020, 6:26 PM
aemerson marked an inline comment as done.Jun 22 2020, 6:27 PM
aemerson added inline comments.
llvm/test/CodeGen/AArch64/combine-loads.ll
7

I'm not entirely sure what this test was meant to demonstrate except poor codegen on -O0 (surprise surprise).

paquette added inline comments.Jun 23 2020, 9:16 AM
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
4503–4509

Can getConstantVRegValWithLookThrough handle this?

It has a HandleFConstants parameter.

aemerson marked an inline comment as done.Jun 23 2020, 10:06 AM
aemerson added inline comments.
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
4503–4509

getConstantVRegWithLookThrough tries to return an int64_t, but here I need to find the actual ConstantInt/ConstantFP IR values in order to generate the constant pool entries.

This revision is now accepted and ready to land.Jun 23 2020, 10:14 AM
This revision was automatically updated to reflect the committed changes.