Commit 42378b2
committed
[BOLT][AArch64] Skip as many as possible zero's in code padding validation
We are skipping four zero's as a time when validating code padding in case
that the next zero would be part of an instruction or constant island, and
for functions that have large amount of padding (like due to hugify), this
could be very slow. We now change the validation to skip as many as possible
but need to be 4's exact multiple number of zero's. No valid instruction has
encoding as 0x00000000 and even if we stumble into some constant island, the
API `BinaryFunction::isInConstantIsland()` has been made to find the size
between the asked address and the end of island (llvm#164037), so this should
be safe.1 parent 50faea2 commit 42378b2
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
1013 | | - | |
1014 | | - | |
| 1013 | + | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
| 1018 | + | |
1021 | 1019 | | |
1022 | 1020 | | |
1023 | 1021 | | |
| |||
0 commit comments