[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:51:34 PDT 2024


https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/91413

>From 3c28a120976c4a1347fb01e198cb87a25128e4a3 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..2f170513d2527 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 %y, %y ; 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