[PATCH] D22295: Introduce !splitpoint metadata and GlobalSplit pass.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 20:43:33 PDT 2016


hfinkel added a subscriber: hfinkel.

================
Comment at: docs/LangRef.rst:4904
@@ +4903,3 @@
+will cross the boundary of a split point. The metadata allows the optimizer
+to split a global variable at split points if possible and beneficial.
+
----------------
I find the specification of the semantics somewhat unclear. What I think this is trying to say is that the splitpoint metadata modifies the definition of 'inbounds' on GEPs, so that instead after:

  The in bounds addresses for an allocated object are all the addresses that point into the object, plus the address one byte past the end.

We add something like this:

  If the object is a global partitioned with one or more !splitpoint metadata, then in bounds addresses are all of the addresses that point into the same partition of the object as the base address. The address one byte past the end of the object is part of the last partition.

Maybe this is only true if the first GEP index value is a constant?

Alternatively, we might specify that the optimizer is free to add an arbitrary amount of padding at the split points. I'm not sure this is strong enough because the later partitions might actually end up with addresses before the first partition.


http://reviews.llvm.org/D22295





More information about the llvm-commits mailing list