This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Don't add -unaligned-scalar-mem to target features by default.
ClosedPublic

Authored by craig.topper on Aug 29 2023, 3:32 PM.

Details

Summary

Only pass it +unaligned-scalar-mem/-unaligned-scalar-mem if the
user has passed one of the alignment options.

This allows us to add unaligned-scalar-mem as a feature on CPUs
that support it.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 29 2023, 3:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2023, 3:33 PM
craig.topper requested review of this revision.Aug 29 2023, 3:33 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 29 2023, 3:33 PM
wangpc added inline comments.Aug 29 2023, 7:40 PM
llvm/lib/Target/RISCV/RISCVProcessors.td
185 ↗(On Diff #554511)

This can be tested in clang/test/Driver/riscv-cpus.c.

craig.topper added inline comments.Aug 29 2023, 7:44 PM
llvm/lib/Target/RISCV/RISCVProcessors.td
185 ↗(On Diff #554511)

This shouldn’t be in here. That was for testing and I accidentally committed it

wangpc added inline comments.Aug 29 2023, 8:39 PM
llvm/lib/Target/RISCV/RISCVProcessors.td
185 ↗(On Diff #554511)

Are there any processors in upstream that support unaligned memory access so that we can test it?

craig.topper planned changes to this revision.Aug 29 2023, 9:02 PM

Remove change to sifive-x280.

wangpc accepted this revision.Aug 30 2023, 8:57 AM

LGTM.

This revision is now accepted and ready to land.Aug 30 2023, 8:57 AM