This is an archive of the discontinued LLVM Phabricator instance.

ARM: Add @llvm.arm.space to aid ARMConstantIslands testing
AbandonedPublic

Authored by t.p.northover on Apr 11 2014, 11:53 AM.

Details

Reviewers
None
Summary

Hi,

As we all know, testing ARMConstantIslands is a complete nightmare because you need thousands of lines of code to even start needing it.

This patch implements an "@llvm.arm.space(i32)" intrinsic which should make that much easer. It's the CodeGen equivalent of ".zero" in assembly, and immediately makes a basic block bigger by the amount in its argument.

It's not a panacea: getting just the perfect number of instructions for the split you're attempting to create is still tricky. But it should greatly improve matters.

I'm hoping to use it to actually write some more substantial tests for the pass, but wanted to get it out there to be used by Saleem in particular.

Does it look OK? Anyone got suggestions for improvement? Or enough other uses to justify it being generic?

Cheers.

Tim.

Diff Detail

Event Timeline

asl added a comment.Apr 11 2014, 12:18 PM

Hi Tim,

Does the current asm parser handle .zero inside inline asm?

Hi Anton,

Does the current asm parser handle .zero inside inline asm?

Depends on what you mean by handle. I'd say no, because
GetInstrSizeInBytes tries (and fails) to be conservative: it assumes
any inline asm takes up at most "4 * # lines" bytes. That would lead
bad CodeGen failures if you tried to use it (though quite possibly no
warnings or errors about it).

Tim.

asl added a comment.Apr 11 2014, 12:48 PM

I thought - maybe to teach asmparser to somehow handle .zero gracefully? Or it will be much harder?

t.p.northover abandoned this revision.Jun 26 2014, 6:31 AM