[llvm] [SimplifyCFG] Add optimization for switches of powers of two (PR #70977)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 05:27:14 PST 2023


================
@@ -0,0 +1,453 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --tool ./bin/opt --version 3
+; RUN: opt -passes='simplifycfg<switch-to-lookup>' -simplifycfg-require-and-preserve-domtree=1 -S -mtriple=riscv64 < %s \
+; RUN: | FileCheck %s --check-prefixes=CHECK,RV64I
+; RUN: opt -passes='simplifycfg<switch-to-lookup>' -simplifycfg-require-and-preserve-domtree=1 -S -mtriple=riscv64 -mattr=+zbb < %s \
+; RUN: | FileCheck %s --check-prefixes=CHECK,RV64ZBB
----------------
nikic wrote:

This causes distinct check lines for all tests due to the extra function attributes. Can we avoid that somehow? Maybe the easiest way is to run update_test_checks.py with `--version 1` to avoid inclusion of the function signature. Or maybe if you add an explicit `-mattr=-zbb` to the first one that would also avoid this difference?

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


More information about the llvm-commits mailing list