Skip to content

Commit

Permalink
Hanfle filtering tail call void @llvm.dbg.* in LLVM IR (compiler-ex…
Browse files Browse the repository at this point in the history
…plorer#6425)

Fixes compiler-explorer#6416. Additionally escapes a dot in another copy of an
`@llvm.dbg` check.

Didn't find any existing tests for IR filtering to update where this
filter applies, but did make sure locally that it does start hiding the
instructions for clang-17 and clang-18.
  • Loading branch information
dzaima authored May 2, 2024
1 parent 4fbc2d4 commit 3a6a799
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/llvm-ir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class LlvmIrParser {
this.namedMetaDirective = /^(![.A-Z_a-z-]+) = (?:distinct )?!{.*}/;
this.metaNodeOptionsRe = /(\w+): (!?\d+|\w+|""|"(?:[^"]|\\")*[^\\]")/gi;

this.llvmDebugLine = /^\s*call void @llvm\.dbg\..*$/;
this.llvmDebugLine = /^\s*(tail\s)?call void @llvm\.dbg\..*$/;
this.llvmDebugAnnotation = /,? !dbg !\d+/;
this.otherMetadataAnnotation = /,? !(?!dbg)[\w.]+ (!\d+)/;
this.attributeAnnotation = /,? #\d+(?= )/;
Expand Down
2 changes: 1 addition & 1 deletion lib/parsers/llvm-pass-dump-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class LlvmPassDumpParser {

// Additional filters conditionally enabled by `filterDebugInfo`
this.debugInfoFilters = [
/^\s+(tail\s)?call void @llvm.dbg.+$/, // dbg calls
/^\s+(tail\s)?call void @llvm\.dbg.+$/, // dbg calls
/^\s+DBG_.+$/, // dbg pseudo-instructions
/^(!\d+) = (?:distinct )?!DI([A-Za-z]+)\(([^)]+?)\)/, // meta
/^(!\d+) = (?:distinct )?!{.*}/, // meta
Expand Down

0 comments on commit 3a6a799

Please sign in to comment.