This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Handle ST1iN instructions in isAArch64FrameOffsetLegal
ClosedPublic

Authored by danilaml on Oct 22 2021, 5:34 AM.

Details

Summary

Before the code would crash with "unhandled opcode in
isAArch64FrameOffsetLegal" when there was a spill from extractelement.
Fixes pr52249.

Diff Detail

Event Timeline

danilaml created this revision.Oct 22 2021, 5:34 AM
danilaml requested review of this revision.Oct 22 2021, 5:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 22 2021, 5:34 AM
danilaml edited the summary of this revision. (Show Details)Oct 22 2021, 5:45 AM
danilaml added reviewers: t.p.northover, ostannard, pcc.
ostannard added inline comments.Oct 25 2021, 5:20 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
4293

Should this also handle ST1i64, and the LD1 opcodes?

llvm/test/CodeGen/AArch64/aarch64st1.ll
2

This would be better as an MIR test, so it's not dependent on unrelated details of codegen. If I run this test with -stop-before=localstackalloc to generate a MIR file, then run that back through llc with -run-pass=localstackalloc, I get the same same assertion.

danilaml added inline comments.Oct 25 2021, 6:02 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
4293

Right, forgot about i64.
Logically, it seems like it should handle LD1 opcodes the same way but I just wasn't able to come up with the code to test them.
This switch case feels a bit ad-hoc and if something more general is required, I think it's better to use tablegen for that.

llvm/test/CodeGen/AArch64/aarch64st1.ll
2

I feel like MIR tests can be "brittle" in other ways (and CHECKs ensure that the st1 instructions are actually generated), but alright.

danilaml updated this revision to Diff 381973.Oct 25 2021, 6:34 AM

Changed test to MIR and added STi64 case

danilaml marked an inline comment as done.Oct 25 2021, 6:35 AM
This revision is now accepted and ready to land.Oct 25 2021, 6:54 AM
This revision was landed with ongoing or failed builds.Oct 25 2021, 7:06 AM
This revision was automatically updated to reflect the committed changes.