summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping/loopmacro.c
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-10-01 03:33:52 +0000
committerJustin Bogner <mail@justinbogner.com>2014-10-01 03:33:52 +0000
commitf59329b083ced9d01a717e92fc278841b0377291 (patch)
treef2a564789fcf8a112c4fdc0667b19b3b35d4c8ea /clang/test/CoverageMapping/loopmacro.c
parent09c7179bad274427a0a8840c74c66c403f5216af (diff)
downloadbcm5719-llvm-f59329b083ced9d01a717e92fc278841b0377291.tar.gz
bcm5719-llvm-f59329b083ced9d01a717e92fc278841b0377291.zip
InstrProf: Avoid repeated linear searches in a hot path
When generating coverage regions, we were doing a linear search through the existing regions in order to try to merge related ones. Most of the time this would find what it was looking for in a small number of steps and it wasn't a big deal, but in cases with many regions and few mergeable ones this leads to an absurd compile time regression. This changes the coverage mapping logic to do a single sort and then merge as we go, which is a bit simpler and about 100 times faster. I've also added FIXMEs on a couple of behaviours that seem a little suspect, while keeping them behaving as they were - I'll look into these soon. The test changes here are mostly tedious reorganization, because the ordering of regions we output has become slightly (but not completely) more consistent from the almost completely arbitrary ordering we got before. llvm-svn: 218738
Diffstat (limited to 'clang/test/CoverageMapping/loopmacro.c')
-rw-r--r--clang/test/CoverageMapping/loopmacro.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/CoverageMapping/loopmacro.c b/clang/test/CoverageMapping/loopmacro.c
index cd93878fb7f..8480dbdc37e 100644
--- a/clang/test/CoverageMapping/loopmacro.c
+++ b/clang/test/CoverageMapping/loopmacro.c
@@ -29,12 +29,12 @@ int main() { // CHECK: File 0, [[@LINE]]:12 -> [[
// CHECK-NEXT: File 0, 24:21 -> 24:29 = (#0 + #1) (HasCodeBefore = 0)
// CHECK-NEXT: File 0, 24:31 -> 24:40 = (#0 + #1) (HasCodeBefore = 0)
// CHECK-NEXT: File 1, 10:4 -> 12:23 = (#0 + #1) (HasCodeBefore = 0)
-// CHECK-NEXT: Expansion,File 1, 10:5 -> 10:16 = (#0 + #1) (HasCodeBefore = 0, Expanded file = 3)
+// CHECK-NEXT: Expansion,File 1, 10:5 -> 10:16 = (#0 + #1) (HasCodeBefore = 0, Expanded file = 2)
// CHECK-NEXT: File 1, 10:17 -> 10:22 = (#0 + #1) (HasCodeBefore = 0)
// CHECK-NEXT: File 1, 10:17 -> 10:22 = (#0 + #1) (HasCodeBefore = 0)
// CHECK-NEXT: File 1, 10:24 -> 10:32 = (#0 + #1) (HasCodeBefore = 0)
// CHECK-NEXT: File 1, 10:33 -> 10:36 = (#0 + #1) (HasCodeBefore = 0)
// CHECK-NEXT: File 1, 10:46 -> 10:49 = (#0 + #1) (HasCodeBefore = 0)
-// CHECK-NEXT: File 2, 5:18 -> 5:53 = (#0 + #1) (HasCodeBefore = 0)
-// CHECK-NEXT: File 3, 8:26 -> 8:66 = (#0 + #1) (HasCodeBefore = 0)
-// CHECK-NEXT: Expansion,File 3, 8:38 -> 8:45 = (#0 + #1) (HasCodeBefore = 0, Expanded file = 2)
+// CHECK-NEXT: File 2, 8:26 -> 8:66 = (#0 + #1) (HasCodeBefore = 0)
+// CHECK-NEXT: Expansion,File 2, 8:38 -> 8:45 = (#0 + #1) (HasCodeBefore = 0, Expanded file = 3)
+// CHECK-NEXT: File 3, 5:18 -> 5:53 = (#0 + #1) (HasCodeBefore = 0)
OpenPOWER on IntegriCloud