This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] fix broken JIT-compiled code with tail call optimization
ClosedPublic

Authored by inouehrs on May 28 2018, 11:40 PM.

Details

Summary

The relocation for branch instructions in the dynamic loader of ExecutionEngine assumes branch instructions with R_PPC64_REL24 relocation type are only bl. However, with the tail call optimization, b instructions can be also used to jump into another function.
This patch makes the relocation to keep bits in the branch instruction other than the jump offset to avoid relocation rewrites a b instruction into bl.

This problem makes NNVM, a deep learning optimizer which uses LLVM as backend https://github.com/dmlc/nnvm, crash on POWER.

Diff Detail

Repository
rL LLVM

Event Timeline

inouehrs created this revision.May 28 2018, 11:40 PM
This revision is now accepted and ready to land.May 29 2018, 12:01 PM
This revision was automatically updated to reflect the committed changes.