rafael added a comment. You can probably split the codegen part in its own. I.E.: This patch can avoid the changes to RelocVisitor.h, AMDGPU.def and AMDGPUELFObjectWriter.cpp . Those can then be an independent patch. http://reviews.llvm.org/D21401