From a57dafdb00f28c0361dd16d9edbd0f1e0c8c1138 Mon Sep 17 00:00:00 2001 From: Alexander Nutz Date: Fri, 4 Jul 2025 19:19:50 +0200 Subject: [PATCH] c --- core-page-style.typ | 1 + pages/compiler-pattern-matching.typ | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core-page-style.typ b/core-page-style.typ index d811966..3605293 100644 --- a/core-page-style.typ +++ b/core-page-style.typ @@ -10,6 +10,7 @@ #show: x => context { set page(width: auto, height: auto) if is-web and not is-html() set page(paper: "a4") if not is-web and not is-html() + set page(numbering: "1 of 1") if not is-web and not is-html() x } diff --git a/pages/compiler-pattern-matching.typ b/pages/compiler-pattern-matching.typ index a178328..0897244 100644 --- a/pages/compiler-pattern-matching.typ +++ b/pages/compiler-pattern-matching.typ @@ -52,6 +52,7 @@ Some (but not all) disadvantages: - debugging pattern matches can be hard - IR rewrites need to be tracked manually (for debugging) + - source locations and debug information needs to be tracked manually, which often isn't implemented very well. - verbose and hardly readable pattern matching code - overall error-prone @@ -98,7 +99,7 @@ #section[ == Advantages - - debugging and tracking of rewrites can be done properly + - *debugging and tracking of rewrites, source locations, and debug information can be done properly* - patterns themselves can be inspected and modified programmatically. - they are easier and nicer to use and read than manual pattern matching in the compiler's source code. @@ -201,7 +202,11 @@ but also some target architectures have a bit test operation, that is more optimal. ] -// TODO! DEBUG INFORMATION +#section[ + This is not just the case for "low-level" things like bit tests, but also high level concepts, + like a reduction over an array, or even the implementation of a whole algorithm. + For example LLVM, since recently, can detect implementations of CRC. +] #section[ LLVM actually doesn't have many dedicated operations like a bit-test operation, @@ -209,12 +214,6 @@ and matches for that in passes that expect bit test operations. ] -#section[ - This is not just the case for "low-level" things like bit tests, but also high level concepts, - like a reduction over an array, or even the implementation of a whole algorithm. - For example LLVM, since recently, can detect implementations of CRC. -] - #section[ Now let's go back to the ```c x & (1 << b)``` (bit test) example. Optimizing compilers should be able to detect that pattern, and also other bit test patterns (like ```c x & (1 << b) > 0```),