Commit 2873060
authored
[SHT_LLVM_BB_ADDR_MAP] Fixes two bugs in decoding of PGOAnalyses in BBAddrMap. (#77139)
We had specified that `readBBAddrMap` will always keep PGOAnalyses and
BBAddrMaps the same length on success.
https://github.com/llvm/llvm-project/blob/365fbbfbcfefb8766f7716109b9c3767b58e6058/llvm/include/llvm/Object/ELFObjectFile.h#L116-L117
It turns out that this is not currently the case when no analyses exist
in a function. No test had caught it.
We also should not append PGOBBEntries when there is no BBFreq or
BrProb.
This patch adds:
* tests that PGOAnalyses and BBAddrMaps are same length even when no
analyses are enabled
* fixes decode so that PGOAnalyses and BBAddrMaps are same length
* updates test to not emit unnecessary PGOBBEntries
* fixes decode to not emit PGOBBEntries when unnecessary1 parent dbea538 commit 2873060
File tree
3 files changed
+35
-12
lines changed- llvm
- include/llvm/Object
- lib/Object
- unittests/Object
3 files changed
+35
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
885 | 885 | | |
886 | 886 | | |
887 | 887 | | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
888 | 891 | | |
889 | 892 | | |
890 | 893 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
777 | | - | |
| 777 | + | |
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
785 | | - | |
786 | | - | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
787 | 788 | | |
788 | 789 | | |
789 | 790 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | | - | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
1021 | 1034 | | |
1022 | 1035 | | |
1023 | | - | |
| 1036 | + | |
1024 | 1037 | | |
1025 | 1038 | | |
1026 | 1039 | | |
| |||
1049 | 1062 | | |
1050 | 1063 | | |
1051 | 1064 | | |
| 1065 | + | |
| 1066 | + | |
1052 | 1067 | | |
1053 | | - | |
| 1068 | + | |
1054 | 1069 | | |
1055 | 1070 | | |
1056 | | - | |
| 1071 | + | |
1057 | 1072 | | |
1058 | | - | |
| 1073 | + | |
1059 | 1074 | | |
1060 | 1075 | | |
1061 | | - | |
| 1076 | + | |
1062 | 1077 | | |
1063 | 1078 | | |
1064 | 1079 | | |
| |||
1081 | 1096 | | |
1082 | 1097 | | |
1083 | 1098 | | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1084 | 1103 | | |
1085 | 1104 | | |
1086 | 1105 | | |
| |||
1132 | 1151 | | |
1133 | 1152 | | |
1134 | 1153 | | |
1135 | | - | |
| 1154 | + | |
1136 | 1155 | | |
1137 | | - | |
| 1156 | + | |
1138 | 1157 | | |
1139 | 1158 | | |
1140 | 1159 | | |
| |||
1150 | 1169 | | |
1151 | 1170 | | |
1152 | 1171 | | |
1153 | | - | |
| 1172 | + | |
1154 | 1173 | | |
1155 | 1174 | | |
1156 | 1175 | | |
| |||
0 commit comments