Skip to content

[InstCombine] Commuted pattern is not handled #121775

@dtcxzyw

Description

@dtcxzyw

https://godbolt.org/z/KTbTov4rb

define i8 @or_lshr1(i8 %x, i8 %y, i8 %z, i8 %shamt) {
  %sx = lshr i8 %x, %shamt
  %sy = lshr i8 %y, %shamt
  %a = or i8 %sx, %z
  %r = or i8 %sy, %a
  ret i8 %r
}

define i8 @or_lshr2(i8 %x, i8 %y, i8 %z, i8 %shamt) {
  %sx = lshr i8 %x, %shamt
  %sy = lshr i8 %y, %shamt
  %a = or i8 %z, %sx
  %r = or i8 %sy, %a
  ret i8 %r
}
define i8 @or_lshr1(i8 %x, i8 %y, i8 %z, i8 %shamt) {
  %1 = or i8 %x, %y
  %2 = lshr i8 %1, %shamt
  %r = or i8 %2, %z
  ret i8 %r
}

define i8 @or_lshr2(i8 %x, i8 %y, i8 %z, i8 %shamt) {
  %sx = lshr i8 %x, %shamt
  %sy = lshr i8 %y, %shamt
  %a = or i8 %z, %sx
  %r = or i8 %sy, %a
  ret i8 %r
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions