This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Replace integer immediate intrinsics with splat vector variant
ClosedPublic

Authored by dancgr on Dec 17 2019, 9:03 AM.

Details

Event Timeline

dancgr created this revision.Dec 17 2019, 9:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2019, 9:03 AM
efriedma added inline comments.Dec 17 2019, 12:59 PM
llvm/include/llvm/IR/IntrinsicsAArch64.td
1120–1121

Why do we need to treat subr specially here? It's just a plain subtraction; the only interesting bit is that the immediate is in the first operand of the IR "sub" instruction, instead of the second.

dancgr marked an inline comment as done.Dec 17 2019, 1:20 PM
dancgr added inline comments.
llvm/include/llvm/IR/IntrinsicsAArch64.td
1120–1121

I just added an intrinsic for this one because I didn't have a direct match for the subr in the basic operations set. I suppose I could use sub and create an extra class to match the sub with immediate as the first operand. Is that what you were expecting?

dancgr marked an inline comment as not done.Dec 17 2019, 1:20 PM
efriedma added inline comments.Dec 17 2019, 1:27 PM
llvm/include/llvm/IR/IntrinsicsAArch64.td
1120–1121

Yes, something like that.

dancgr updated this revision to Diff 234380.Dec 17 2019, 1:44 PM

Moving SUBR from intrinsics to a reverse pattern match with sub IR instruction.

dancgr updated this revision to Diff 234384.Dec 17 2019, 1:52 PM
dancgr marked 3 inline comments as done.

Remove unused intrinsic.

dancgr marked an inline comment as done.Dec 17 2019, 1:53 PM
dancgr added inline comments.
llvm/include/llvm/IR/IntrinsicsAArch64.td
1120–1121

Done

This revision is now accepted and ready to land.Dec 17 2019, 2:25 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Dec 18 2019, 10:38 AM

This seems to break CodeGen/AArch64/sve-gather-scatter-dag-combine.ll everywhere, e.g. http://45.33.8.238/linux/5970/step_12.txt

dancgr reopened this revision.Dec 18 2019, 11:42 AM
This revision is now accepted and ready to land.Dec 18 2019, 11:42 AM
dancgr updated this revision to Diff 234591.Dec 18 2019, 11:44 AM

Fix issues with sve gather scatter test.

dancgr requested review of this revision.Dec 18 2019, 11:45 AM

For llvm/test/CodeGen/AArch64/sve-gather-scatter-dag-combine.ll it is still not performing the dag combine, however the resulting assembly is different because this matches with the new AArch64dup pattern for logical vector and immediate AND.

efriedma accepted this revision.Dec 18 2019, 12:38 PM
This revision is now accepted and ready to land.Dec 18 2019, 12:38 PM
sdesmalen accepted this revision.Dec 18 2019, 2:35 PM

LGTM as well!

This revision was automatically updated to reflect the committed changes.