hwasan: Move fixed shadow behind opaque no-op cast as well.
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 27 Oct 2020 23:26:07 +0000 (16:26 -0700)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 30 Oct 2020 20:23:52 +0000 (13:23 -0700)
commit0930763b4baf926a39dd2d0571fd9e2102ec3831
treebac73caf96de8982fe55a64b747d7a8a169a8d99
parentaa1c6b79878475d61c90c0d4c2af17312242f18e
hwasan: Move fixed shadow behind opaque no-op cast as well.

This is a workaround for poor heuristics in the backend where we can
end up materializing the constant multiple times. This is particularly
bad when using outlined checks because we materialize it for every call
(because the backend considers it trivial to materialize).

As a result the field containing the shadow base value will always
be set so simplify the code taking that into account.

Differential Revision: https://reviews.llvm.org/D90425
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
llvm/test/Instrumentation/HWAddressSanitizer/basic.ll
llvm/test/Instrumentation/HWAddressSanitizer/kernel.ll