This patch adds several features to support codegen for pagerando. We add a new ISD opcode and pseudo-source value for the page offset table (analogous to the global offset table) which allows backends to emit references to the POT. The patch extends target-independent lowering slightly to store a POT base register for backends that support pagerando, and handles interactions between pagerando sections, unique sections, and jump tables. Finally, the bulk of the patch supports emission of the POT in AsmPrinter.
This patch set (D37580, D37581, D37582, D37583, D37584, D37585, D37586, D37587)
is a first draft of the pagerando implementation described in
http://lists.llvm.org/pipermail/llvm-dev/2017-June/113794.html.
I think that this is worth doing now, when reviewing I had to double check that the duplication was computing the same thing.