[llvm-bugs] [Bug 42748] New: [instCombine] Suboptimal immediate size in range test
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jul 24 14:24:53 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=42748
Bug ID: 42748
Summary: [instCombine] Suboptimal immediate size in range test
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: craig.topper at gmail.com
CC: llvm-bugs at lists.llvm.org
This came up during the review of D65017
For this test:
define i1 @PR42691_6(i32 %x) {
; CHECK-LABEL: @PR42691_6(
; CHECK-NEXT: [[X_OFF:%.*]] = add i32 %x, 2147483647
; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt i32 [[X_OFF]], 2147483645
; CHECK-NEXT: ret i1 [[TMP1]]
;
%c1 = icmp ult i32 %x, 2147483649
%c2 = icmp eq i32 %x, 4294967295
%c = or i1 %c1, %c2
ret i1 %c
}
We might want to generate
%x.off = add i32 %x, 1
%c = icmp ult i32 %x.off, -2147483646
since 1 is small constant on X86.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190724/7cc0c64c/attachment.html>
More information about the llvm-bugs
mailing list