[llvm] [LoopRotation] Enable LoopRotation with -Oz if header folds (PR #72842)

Daniil Fukalov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 13:43:48 PST 2024


================
@@ -0,0 +1,39 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt < %s -S -Oz -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OZ
+
+; Loop should be rotated for -Oz if the duplicated branch in the header
+; can be folded.
+; Test adapted from gcc-c-torture/execute/pr90949.c
+
+; OZ: bypassing header threshold
+; OZ: rotating Loop at depth 1 containing: %tailrecurse.i<header><exiting>,%tailrecurse.backedge.i<latch>
+; OZ: into Loop at depth 1 containing: %tailrecurse.backedge.i<header><latch><exiting>
+
+%struct.Node = type { %struct.Node* }
----------------
dfukalov wrote:

Is it possible to simplify the test to remove these complex types and auto-generated names with a lot of dots?
Also, it would be good idea to add tests for all `return false;` cases, as well as for `llvm_unreachable()`.

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


More information about the llvm-commits mailing list