This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][NFC] Move tests of inline asm memory constraints to separate file
ClosedPublic

Authored by wangpc on Aug 15 2023, 4:42 AM.

Details

Diff Detail

Event Timeline

wangpc created this revision.Aug 15 2023, 4:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2023, 4:42 AM
wangpc requested review of this revision.Aug 15 2023, 4:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2023, 4:42 AM

Why do they need moving?

jrtc27 added inline comments.Aug 15 2023, 8:15 AM
llvm/test/CodeGen/RISCV/inline-asm-mem-constraint.ll
7

And I said medany, not pic. PIC implies GOT indirection, which means the %pcrel_lo12 is hidden behind a load, and so isn't of interest.

wangpc updated this revision to Diff 550583.Aug 15 2023, 8:28 PM

check medium code model.

wangpc marked an inline comment as done.Aug 15 2023, 8:31 PM

Why do they need moving?

We don't need to check medium code model for other constraints in inline-asm.ll, so I just move all memory-related constraints to new file.

llvm/test/CodeGen/RISCV/inline-asm-mem-constraint.ll
7

Ooops, my mistake. Updated.

wangpc edited the summary of this revision. (Show Details)Aug 15 2023, 8:31 PM

Why do they need moving?

We don't need to check medium code model for other constraints in inline-asm.ll, so I just move all memory-related constraints to new file.

constraint_r(_zero) still do loads though. And if you use --check-prefixes smartly then it only duplicates CHECK lines for functions that differ between code models.

wangpc updated this revision to Diff 550613.Aug 15 2023, 10:23 PM
wangpc marked an inline comment as done.

Move constraint A too.

wangpc added a comment.EditedAug 15 2023, 10:37 PM

Why do they need moving?

We don't need to check medium code model for other constraints in inline-asm.ll, so I just move all memory-related constraints to new file.

constraint_r(_zero) still do loads though.

The inline asm with constraint r won't influenced by code model because it will always be a register.

And if you use --check-prefixes smartly then it only duplicates CHECK lines for functions that differ between code models.

Yeah I know. I just think that we should split them out as there are some custom lowering in SelectInlineAsmMemoryOperand for memory constraints, which is different from other constraints.
I don't think this will increase complexity as there are other separate tests for constraints like f, S, etc.

@asb What about this?

wangpc accepted this revision.Aug 21 2023, 3:55 AM

I decide to move forward and land this since D157839 is accepted.

This revision is now accepted and ready to land.Aug 21 2023, 3:55 AM
This revision was landed with ongoing or failed builds.Aug 21 2023, 4:00 AM
This revision was automatically updated to reflect the committed changes.