OSDN Git Service

[llvm-mca][UpdateTestChecks] Don't try to align blocks that have already been subject...
authorGreg Bedwell <greg_bedwell@sn.scee.net>
Mon, 29 Oct 2018 13:24:20 +0000 (13:24 +0000)
committerGreg Bedwell <greg_bedwell@sn.scee.net>
Mon, 29 Oct 2018 13:24:20 +0000 (13:24 +0000)
This fixes PR39466.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345499 91177308-0d34-0410-b5e6-96231b3b80d8

utils/update_mca_test_checks.py

index a83186c..54d1cb4 100755 (executable)
@@ -267,10 +267,14 @@ def _align_matching_blocks(all_blocks, farthest_indexes):
         continue
 
       changed = False
-      while(index < farthest_indexes[block]):
-        blocks.insert(index, '')
-        index += 1
-        changed = True
+      # If the block has not already been subject to alignment (i.e. if the
+      # previous block is not empty) then insert empty blocks until the index
+      # matches the farthest index identified for that block.
+      if (index > 0) and blocks[index - 1]:
+        while(index < farthest_indexes[block]):
+          blocks.insert(index, '')
+          index += 1
+          changed = True
 
       if changed:
         # Bail out.  We'll need to re-do the farthest block analysis now that