This is an archive of the discontinued LLVM Phabricator instance.

Fix ARMv4T (Thumb1) epilogue generation
ClosedPublic

Authored by tyomitch on Dec 1 2015, 12:30 PM.

Details

Summary

Before ARMv5T, Thumb1 code could not pop PC, as described at D14357 and D14986;
so we need the special fixup in the epilogue.

Diff Detail

Repository
rL LLVM

Event Timeline

tyomitch updated this revision to Diff 41554.Dec 1 2015, 12:30 PM
tyomitch retitled this revision from to Fix ARMv4T (Thumb1) epilogue generation.
tyomitch updated this object.
tyomitch added reviewers: jroelofs, qcolombet.
tyomitch added a subscriber: llvm-commits.
tyomitch added inline comments.Dec 1 2015, 12:47 PM
lib/Target/ARM/Thumb1FrameLowering.cpp
631 ↗(On Diff #41554)

A Thumb target implicitly has v4T ops (or above), so this condition is meaningless.

test/CodeGen/ARM/debug-frame.ll
33 ↗(On Diff #41554)

This test is not v4T-specific, so it's easier to bump the target triple to v5T than to update every epilogue for v4T compatibility.

test/CodeGen/Thumb/large-stack.ll
35 ↗(On Diff #41554)

The temporary register to be used here doesn't seem to have to be constrained to just r0, and somehow my patch affected the choice, so I'm relaxing the test.

test/CodeGen/Thumb/pop-special-fixup.ll
1 ↗(On Diff #41554)

The same test case (a diamond with a non-trivial final BB) is now checked in thumb-shrink-wrapping.ll in the four combinations: {v4T,v5T}x{enable shrink-wrap,disable shrink-wrap}

t.p.northover accepted this revision.Dec 8 2015, 10:59 AM
t.p.northover added a reviewer: t.p.northover.
t.p.northover added a subscriber: t.p.northover.

Hi Artyom,

I think I've convinced myself this logic is sound. Go for it! And sorry for the delay.

Tim.

This revision is now accepted and ready to land.Dec 8 2015, 10:59 AM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/test/CodeGen/Thumb/large-stack.ll