[llvm] Add a pass to convert jump tables to switches. (PR #77709)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 00:00:27 PST 2024


================
@@ -0,0 +1,94 @@
+; RUN: opt < %s -passes=jump-table-to-switch -verify-dom-info -S | FileCheck %s
+; RUN: opt < %s -passes=jump-table-to-switch -jump-table-to-switch-size-threshold=0 -verify-dom-info -S | FileCheck %s --check-prefix=THRESHOLD-0
+
+ at func_array = global [2 x ptr] [ptr @func0, ptr @func1]
----------------
dtcxzyw wrote:

The global should be a constant.
See also `InstCombinerImpl::foldCmpLoadFromIndexedGlobal`.

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


More information about the llvm-commits mailing list