[PATCH] D51472: [ARM] Fix correctness checks in promoteToConstantPool.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 6 14:32:34 PDT 2018


efriedma added a comment.

> Did you ever see https://reviews.llvm.org/D36787? It's almost certainly not worth looking at very much. I remember it being a bit over-complicated with constant pool entries pointing to other constant pool entries. If it helps, feel free to take what might be useful. I'm kind of hoping there is a better way than that though.

No, I don't think I ever saw it (or at least, I don't remember seeing it).

Looking at it, yes, it does seem a little more complicated than I would have hoped for.  But I'm not sure what a better solution would look like... I mean, if there are multiple tLEApcrel instructions referring to a given constant, ARMConstantIslands will be forced to do something like https://reviews.llvm.org/D36787 in general.  (By "like https://reviews.llvm.org/D36787", I mean computing the address of the constant using some sequence that isn't a tLEApcrel; I guess instead of computing the address like the address of a global, you could "outline" the computation, but that's equally awkward).

I guess the alternative is to avoid cloning.  If, in isel, we can prove that all references to the constant in question are lowered to a single SelectionDAG node (essentially, all references are in the same BasicBlock), we could lower that to some special tLEApcrel_nodup that's marked isNotDuplicable, and then ARMConstantIslands will ensure it's in range without cloning.


Repository:
  rL LLVM

https://reviews.llvm.org/D51472





More information about the llvm-commits mailing list