[llvm] [Hexagon] Fix KCFI check truncating type id (PR #211854)

Santanu Das via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 02:55:20 PDT 2026


================
@@ -0,0 +1,122 @@
+;; The compiler and the assembler must agree on the encoding of a KCFI check.
+;;
+;; HexagonAsmPrinter::LowerKCFI_CHECK() emits its packets by hand, so the
+;; integrated-assembler path and the "print text, assemble it" path are two
+;; independent implementations of the same sequence.  When they disagree the
+;; object file is wrong while -S output looks perfect, which is exactly how a
+;; missing constant extender stayed invisible: the assembler adds extenders
+;; when it parses `##imm`, so only the direct-to-object path truncated them.
+;;
+;; Comparing the two .text images catches any such divergence -- missing
+;; extenders, unformed compounds, bad slot assignment -- without having to
+;; predict which encoding is the right one, so it also catches divergences
+;; nobody thought to write a CHECK line for.
+;;
+;; The comparison is on section bytes rather than on disassembly because the
+;; two paths number their temporary labels differently; that is cosmetic, and
+;; would show up as a diff.  kcfi-packetization.ll is where a human-readable
----------------
quic-santdas wrote:

Is this file available in the codebase?

https://github.com/llvm/llvm-project/pull/211854


More information about the llvm-commits mailing list