mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-30 07:14:53 +00:00
d23a64cc16
undefined behavior, which Rafael was kind enough to fix. Original commit message for r153423: Use the new range metadata in computeMaskedBits and add a new optimization to instruction simplify that lets us remove an and when loding a boolean value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153521 91177308-0d34-0410-b5e6-96231b3b80d8
16 lines
357 B
LLVM
16 lines
357 B
LLVM
; RUN: opt < %s -instsimplify -S | FileCheck %s
|
|
|
|
define zeroext i1 @_Z3fooPb(i8* nocapture %x) {
|
|
entry:
|
|
%a = load i8* %x, align 1, !range !0
|
|
%b = and i8 %a, 1
|
|
%tobool = icmp ne i8 %b, 0
|
|
ret i1 %tobool
|
|
}
|
|
|
|
; CHECK: %a = load i8* %x, align 1, !range !0
|
|
; CHECK-NEXT: %tobool = icmp ne i8 %a, 0
|
|
; CHECK-NEXT: ret i1 %tobool
|
|
|
|
!0 = metadata !{i8 0, i8 2}
|