[llvm] [InstCombine] Thwart complexity-based canonicalization in shl-add test (NFC) (PR #91413)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 7 17:49:57 PDT 2024
https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/91413
>From 06276806d0afc6e468579ca72da78d7a2acfc0e8 Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Tue, 7 May 2024 20:48:41 -0400
Subject: [PATCH] [InstCombine] Thwart complexity-based canonicalization in
shl-add test (NFC)
Extra test for #88193
---
llvm/test/Transforms/InstCombine/lshr.ll | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/test/Transforms/InstCombine/lshr.ll b/llvm/test/Transforms/InstCombine/lshr.ll
index 563e669f90353..25e89c91a9e55 100644
--- a/llvm/test/Transforms/InstCombine/lshr.ll
+++ b/llvm/test/Transforms/InstCombine/lshr.ll
@@ -402,6 +402,7 @@ define i32 @shl_add_lshr_comm(i32 %x, i32 %c, i32 %y) {
; CHECK-NEXT: ret i32 [[LSHR]]
;
%shl = shl nuw i32 %x, %c
+ %xx = mul i32 %x, %x ; thwart complexity-based canonicalization
%add = add nuw i32 %y, %shl
%lshr = lshr i32 %add, %c
ret i32 %lshr
More information about the llvm-commits
mailing list