[flang] [llvm] [compiler-rt] [clang] [llvm][WebAssembly] mark BR_TABLE as isIndirectBranch (PR #72755)

Xu Jun via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 25 06:09:20 PST 2023


https://github.com/xujuntwt95329 updated https://github.com/llvm/llvm-project/pull/72755

>From 1f7588ce6a473204e102c03cf94b3ebcafcbca78 Mon Sep 17 00:00:00 2001
From: Xu Jun <693788454 at qq.com>
Date: Sat, 18 Nov 2023 18:29:18 +0000
Subject: [PATCH] [llvm][WebAssembly] mark BR_TABLE as isIndirectBranch

Signed-off-by: Xu Jun <693788454 at qq.com>
---
 llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
index be6547007aaf7a7..a94e7f9f829a347 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
@@ -45,7 +45,7 @@ def brlist : Operand<i32> {
 // Duplicating a BR_TABLE is almost never a good idea. In particular, it can
 // lead to some nasty irreducibility due to tail merging when the br_table is in
 // a loop.
-let isTerminator = 1, hasCtrlDep = 1, isBarrier = 1, isNotDuplicable = 1 in {
+let isTerminator = 1, hasCtrlDep = 1, isBarrier = 1, isNotDuplicable = 1, isIndirectBranch = 1 in {
 
 defm BR_TABLE_I32 : I<(outs), (ins I32:$index, variable_ops),
                       (outs), (ins brlist:$brl),
@@ -60,7 +60,7 @@ defm BR_TABLE_I64 : I<(outs), (ins I64:$index, variable_ops),
                       [(WebAssemblybr_table I64:$index)],
                       "br_table \t$index", "br_table \t$brl",
                       0x0e>;
-} // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1, isNotDuplicable = 1
+} // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1, isNotDuplicable = 1, isIndirectBranch = 1
 
 // This is technically a control-flow instruction, since all it affects is the
 // IP.



More information about the cfe-commits mailing list