[BOLT] Process each block only once in fixCFGForPIC
authorFabian Parzefall <parzefall@fb.com>
Mon, 25 Jul 2022 21:48:48 +0000 (14:48 -0700)
committerFabian Parzefall <parzefall@fb.com>
Mon, 25 Jul 2022 22:06:24 +0000 (15:06 -0700)
commit83882606dbd7ffb0bdd3460356202d97705809c8
tree78ad4a2231b6f1d6e54accc41b837b6d0b716614
parent1d23f6c5a4f6ebb101c282f8f506588fe4d9e92f
[BOLT] Process each block only once in fixCFGForPIC

Rather than iterating over the whole function from the start until no
internal calls are found, process each block only once and continue
processing after splitting. This version of the function also does not
seemingly invalidate iterators from within the loop.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D130436
bolt/include/bolt/Core/BinaryFunction.h
bolt/include/bolt/Passes/ValidateInternalCalls.h
bolt/lib/Passes/ValidateInternalCalls.cpp