[llvm-dev] trouble hoisting GlobalValues
Mehdi Amini via llvm-dev
llvm-dev at lists.llvm.org
Fri Dec 11 17:57:39 PST 2015
Is it exactly the same question as what we discussed a few days ago in this thread https://groups.google.com/forum/#!topic/llvm-dev/08EXrCDPboo ?
CC Preston who will be feel less lonely maybe.
> On Dec 11, 2015, at 1:53 PM, Steve King via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> Hello LLVM,
> To reduce the code-size cost of relocations, I'm trying to hoist
> GlobalValues that are used many times. A new pass hides each hoisted
> GV behind a BITCAST in the dominating BB. The pass then updates users
> with the output of the BITCAST. This pass works properly AFAICT.
> The problems come in instruction selection.
> SelectionDAGBuilder::visitBitCast() treats the BITCAST as a no-op and
> eventually users of the GV fold the relocation as if hoisting never
> happened. Experiments turning the BITCAST into a copytoreg failed and
> anyway I feel like I'm just shooting in the dark.
> Can anyone can suggest a strategy for lowering a hoisted GV? The end
> result should be that the GV materializes as a simple move-immediate
> to register.
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
More information about the llvm-dev