https://bugs.llvm.org/show_bug.cgi?id=52406
Bug ID: 52406
Summary: [InstCombine] try to thread binop through
select-of-constants
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: spatel+l...@rotateright.com
CC: llvm-bugs@lists.llvm.org
Forking this off from bug 52402 (it doesn't involve multiplication magic):
define i8 @src(i8 %x, i1 %b) {
%t4 = and i8 %x, 8
%t7 = select i1 %b, i8 7, i8 0
%t8 = shl i8 %t4, %t7
ret i8 %t8
}
define i8 @tgt(i8 %x, i1 %b) {
%t4 = and i8 %x, 8
%r = select i1 %b, i8 0, i8 %t4
ret i8 %r
}
https://alive2.llvm.org/ce/z/zw2px6
It probably does not make sense in general to pull the binop into the select -
we need to be able to simplify both sides of the select to justify this. This
might involve checking if one of the select operands is an identity constant
(ConstantExpr::getBinOpIdentity).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs