1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+m -verify-machineinstrs < %s | FileCheck %s
4 ; This test has multiple opportunities for SimplifyDemandedBits after type
5 ; legalization. There are 2 opportunities on the chain feeding the LHS of the
6 ; shl. And one opportunity on the shift amount. We previously weren't managing
7 ; the DAGCombiner worklist correctly and failed to get the RHS.
9 define i32 @foo(i32 %x, i32 %y, i32 %z) {
12 ; CHECK-NEXT: mulw a0, a0, a0
13 ; CHECK-NEXT: addiw a0, a0, 1
14 ; CHECK-NEXT: mulw a0, a0, a0
15 ; CHECK-NEXT: addw a0, a0, a2
16 ; CHECK-NEXT: addiw a0, a0, 1
17 ; CHECK-NEXT: sllw a0, a0, a1