This is an archive of the discontinued LLVM Phabricator instance.

[ARM] MSR instructions implicitly set CPSR
ClosedPublic

Authored by olista01 on Jun 8 2016, 8:23 AM.

Details

Summary

The MSR instructions can write to the CPSR, but we did not model this
fact, so we could emit them in the middle of IT blocks, changing the
condition flags for later instructions in the block.

The tests use two calls to llvm.write_register.i32 because it is valid
to use these instructions at the end of an IT block, which if conversion
does do in some cases. With two calls, the first clobbers the flags, so
a branch has to be used to make the second one conditional.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 updated this revision to Diff 60044.Jun 8 2016, 8:23 AM
olista01 retitled this revision from to [ARM] MSR instructions implicitly set CPSR.
olista01 updated this object.
olista01 added reviewers: rengolin, t.p.northover.
olista01 set the repository for this revision to rL LLVM.
olista01 added a subscriber: llvm-commits.
rengolin accepted this revision.Jun 8 2016, 8:28 AM
rengolin edited edge metadata.

Ouch! LGTM, thanks!

This revision is now accepted and ready to land.Jun 8 2016, 8:28 AM
This revision was automatically updated to reflect the committed changes.