[llvm] [Docs] Store to poison is the canonical form for non-terminator unreachable (PR #98910)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 07:29:02 PDT 2024


https://github.com/DianQK created https://github.com/llvm/llvm-project/pull/98910

Add the content from https://github.com/llvm/llvm-project/pull/96639#issuecomment-2189111902.

>From 9fb582e09c7773d13a1432da586f27d1a8f0cf9e Mon Sep 17 00:00:00 2001
From: DianQK <dianqk at dianqk.net>
Date: Mon, 15 Jul 2024 22:24:54 +0800
Subject: [PATCH] [Docs] Store to poison is the canonical form for
 non-terminator unreachable

---
 llvm/docs/Frontend/PerformanceTips.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llvm/docs/Frontend/PerformanceTips.rst b/llvm/docs/Frontend/PerformanceTips.rst
index 289106cd1e28e..4baf127bf050b 100644
--- a/llvm/docs/Frontend/PerformanceTips.rst
+++ b/llvm/docs/Frontend/PerformanceTips.rst
@@ -206,7 +206,9 @@ Other Things to Consider
    that fact is critical for optimization purposes.  Assumes are a great
    prototyping mechanism, but they can have negative effects on both compile
    time and optimization effectiveness.  The former is fixable with enough
-   effort, but the later is fairly fundamental to their designed purpose.
+   effort, but the later is fairly fundamental to their designed purpose.  If
+   you are creating a non-terminator unreachable instruction or passing a false
+   value, use the ``store i1 true, ptr poison, align 1`` canonical form.
 
 
 Describing Language Specific Properties



More information about the llvm-commits mailing list