-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NFC] Add test in preparation for D123849.
- Loading branch information
1 parent
afa7c5d
commit 866bd4d
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | ||
; RUN: opt -S -expandmemcmp -memcmp-num-loads-per-block=1 -mtriple=x86_64-unknown-unknown -data-layout=e-m:o-i64:64-f80:128-n8:16:32:64-S128 < %s | FileCheck %s --check-prefix=X64 | ||
|
||
declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) | ||
|
||
define i32 @bcmp8(i8* nocapture readonly %x, i8* nocapture readonly %y) { | ||
; X64-LABEL: @bcmp8( | ||
; X64-NEXT: [[TMP1:%.*]] = bitcast i8* [[X:%.*]] to i64* | ||
; X64-NEXT: [[TMP2:%.*]] = bitcast i8* [[Y:%.*]] to i64* | ||
; X64-NEXT: [[TMP3:%.*]] = load i64, i64* [[TMP1]], align 1 | ||
; X64-NEXT: [[TMP4:%.*]] = load i64, i64* [[TMP2]], align 1 | ||
; X64-NEXT: [[TMP5:%.*]] = call i64 @llvm.bswap.i64(i64 [[TMP3]]) | ||
; X64-NEXT: [[TMP6:%.*]] = call i64 @llvm.bswap.i64(i64 [[TMP4]]) | ||
; X64-NEXT: [[TMP7:%.*]] = icmp ugt i64 [[TMP5]], [[TMP6]] | ||
; X64-NEXT: [[TMP8:%.*]] = icmp ult i64 [[TMP5]], [[TMP6]] | ||
; X64-NEXT: [[TMP9:%.*]] = zext i1 [[TMP7]] to i32 | ||
; X64-NEXT: [[TMP10:%.*]] = zext i1 [[TMP8]] to i32 | ||
; X64-NEXT: [[TMP11:%.*]] = sub i32 [[TMP9]], [[TMP10]] | ||
; X64-NEXT: ret i32 [[TMP11]] | ||
; | ||
%call = tail call i32 @bcmp(i8* %x, i8* %y, i64 8) | ||
ret i32 %call | ||
} | ||
|