[PATCH] D100027: [update_llc_test_checks.py] Fix MIPS ASM regex for functions with EH

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 7 02:30:44 PDT 2021


arichardson created this revision.
arichardson added reviewers: atanasyan, MaskRay.
Herald added a subscriber: sdardis.
arichardson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

On MIPS, functions with exception handling code emits an additional
temporary label at the start of the function (due to UseAssignmentForEHBegin):

  _Z8do_catchv:                           # @_Z8do_catchv
  .Ltmp3:
  .set .Lfunc_begin0, .Ltmp3
  .cfi_startproc
  .cfi_personality 128, DW.ref.__gxx_personality_v0
  .cfi_lsda 0, .Lexception0
  .frame	$c11,48,$c17
  .mask 	0x00000000,0
  .fmask	0x00000000,0
  .set	noreorder
  .set	nomacro
  .set	noat
  # %bb.0:                                # %entry

The `[^:]*` regex was terminating the search after .Ltmp<N>: and therefore
not detecting functions with exception handling.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100027

Files:
  llvm/utils/UpdateTestChecks/asm.py


Index: llvm/utils/UpdateTestChecks/asm.py
===================================================================
--- llvm/utils/UpdateTestChecks/asm.py
+++ llvm/utils/UpdateTestChecks/asm.py
@@ -59,6 +59,7 @@
 
 ASM_FUNCTION_MIPS_RE = re.compile(
     r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n[^:]*?' # f: (name of func)
+    r'(?:\s*\.?Ltmp[^:\n]*:\n)?[^:]*?'        # optional .Ltmp<N> for EH
     r'(?:^[ \t]+\.(frame|f?mask|set).*?\n)+'  # Mips+LLVM standard asm prologue
     r'(?P<body>.*?)\n'                        # (body of the function)
     # Mips+LLVM standard asm epilogue


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100027.335763.patch
Type: text/x-patch
Size: 594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210407/c9fa77e4/attachment.bin>


More information about the llvm-commits mailing list