[llvm] [llvm][WebAssembly] mark BR_TABLE as isIndirectBranch (PR #73391)

via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 25 06:47:03 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-webassembly

Author: Xu Jun (xujuntwt95329)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/73391.diff


1 Files Affected:

- (modified) llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td (+2-2) 


``````````diff
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.

``````````

</details>


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


More information about the llvm-commits mailing list