[CodeGen] Emit more precise AssertZext/AssertSext nodes.
ClosedPublic

Authored by efriedma on Thu, Jul 5, 6:32 PM.

Details

Summary

This is marginally helpful for removing redundant extensions, and it's easier to read, so it seems like an all-around win. In the new test i8-phi-ext.ll, we used to emit an AssertSext i8; now we emit an AssertZext i2, which allows the extension of the return value to be eliminated.

Someone familiar with the AMDGPU backend should review the test change there; I'm not sure why this change makes a difference. (We now emit an AssertZext i27 for the stack address.)

Diff Detail

Repository
rL LLVM
efriedma created this revision.Thu, Jul 5, 6:32 PM
arsenm added inline comments.Fri, Jul 6, 5:14 AM
test/CodeGen/AMDGPU/frame-index-elimination.ll
143 ↗(On Diff #154343)

This probably makes sense. We can't use the constant offset addressing mode if we don't know if the base address is >= 0

dmgreen added a subscriber: dmgreen.Fri, Jul 6, 6:37 AM
arsenm accepted this revision.Mon, Jul 9, 3:04 AM

LGTM

This revision is now accepted and ready to land.Mon, Jul 9, 3:04 AM
This revision was automatically updated to reflect the committed changes.