This patch introduces getShadowOriginPtr(), a method that obtains both the shadow and origin pointers for an address as a Value pair.
The existing callers of getShadowPtr() and getOriginPtr() are updated to use getShadowOriginPtr().
The rationale for this change is to simplify KMSAN instrumentation implementation.
In KMSAN origins tracking is always enabled, and there's no direct mapping between the app memory and the shadow/origin pages.
Both the shadow and the origin pointer for a given address are obtained by calling a single runtime hook from the instrumentation, therefore it's easier to work with those pointers together.
Normally, we load origin (and compute OriginPtr) only when the shadow check fails. It is done in a different BB behind a cold branch, at least on the IR level. Your change moves OriginPtr computation up to the hot BB.
I really hope that the optimization pipeline is smart enough to sink it back. Please verify that this does not regress userspace codegen.