File: pr32842.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (36 lines) | stat: -rw-r--r-- 1,703 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Regression test for https://bugs.llvm.org/show_bug.cgi?id=32842
;
; RUN: opt < %s -S -passes=msan 2>&1 | FileCheck %s

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Make sure the shadow of the (x < y) comparison isn't truncated to i1.

define zeroext i1 @_Z1fii(i32 %x, i32 %y) sanitize_memory {
; CHECK-LABEL: define zeroext i1 @_Z1fii(
; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT:  [[ENTRY:.*:]]
; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @__msan_param_tls, align 8
; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__msan_param_tls to i64), i64 8) to ptr), align 8
; CHECK-NEXT:    call void @llvm.donothing()
; CHECK-NEXT:    [[TMP10:%.*]] = xor i32 [[X]], -2147483648
; CHECK-NEXT:    [[TMP3:%.*]] = xor i32 [[TMP0]], -1
; CHECK-NEXT:    [[TMP4:%.*]] = and i32 [[TMP10]], [[TMP3]]
; CHECK-NEXT:    [[TMP5:%.*]] = or i32 [[TMP10]], [[TMP0]]
; CHECK-NEXT:    [[TMP6:%.*]] = xor i32 [[Y]], -2147483648
; CHECK-NEXT:    [[TMP7:%.*]] = xor i32 [[TMP1]], -1
; CHECK-NEXT:    [[TMP8:%.*]] = and i32 [[TMP6]], [[TMP7]]
; CHECK-NEXT:    [[TMP9:%.*]] = or i32 [[TMP6]], [[TMP1]]
; CHECK-NEXT:    [[TMP14:%.*]] = icmp ult i32 [[TMP4]], [[TMP9]]
; CHECK-NEXT:    [[TMP27:%.*]] = icmp ult i32 [[TMP5]], [[TMP8]]
; CHECK-NEXT:    [[TMP2:%.*]] = xor i1 [[TMP14]], [[TMP27]]
; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[X]], [[Y]]
; CHECK-NEXT:    store i1 [[TMP2]], ptr @__msan_retval_tls, align 8
; CHECK-NEXT:    ret i1 [[CMP]]
;
entry:
  %cmp = icmp slt i32 %x, %y
  ret i1 %cmp
}