-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[NFC][PowerPC] Add test case for lockdown of vector compare greater than support for Zero vector comparisons #147246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,143 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 | ||
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=POWERPC_64 | ||
// RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=POWERPC_64LE | ||
// RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=POWERPC_32 | ||
|
||
// POWERPC_64-LABEL: define dso_local signext i32 @test_Greater_than( | ||
// POWERPC_64-SAME: ptr noundef [[COLAUTHS:%.*]]) #[[ATTR0:[0-9]+]] { | ||
// POWERPC_64-NEXT: [[ENTRY:.*:]] | ||
// POWERPC_64-NEXT: [[COLAUTHS_ADDR:%.*]] = alloca ptr, align 8 | ||
// POWERPC_64-NEXT: [[RESULT:%.*]] = alloca i16, align 2 | ||
// POWERPC_64-NEXT: [[I:%.*]] = alloca i32, align 4 | ||
// POWERPC_64-NEXT: store ptr [[COLAUTHS]], ptr [[COLAUTHS_ADDR]], align 8 | ||
// POWERPC_64-NEXT: store i16 0, ptr [[RESULT]], align 2 | ||
// POWERPC_64-NEXT: store i32 0, ptr [[I]], align 4 | ||
// POWERPC_64-NEXT: br label %[[FOR_COND:.*]] | ||
// POWERPC_64: [[FOR_COND]]: | ||
// POWERPC_64-NEXT: [[TMP0:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_64-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP0]], 4 | ||
// POWERPC_64-NEXT: br i1 [[CMP]], label %[[FOR_BODY:.*]], label %[[FOR_END:.*]] | ||
// POWERPC_64: [[FOR_BODY]]: | ||
// POWERPC_64-NEXT: [[TMP1:%.*]] = load ptr, ptr [[COLAUTHS_ADDR]], align 8 | ||
// POWERPC_64-NEXT: [[TMP2:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_64-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP2]] to i64 | ||
// POWERPC_64-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i16, ptr [[TMP1]], i64 [[IDXPROM]] | ||
// POWERPC_64-NEXT: [[TMP3:%.*]] = load i16, ptr [[ARRAYIDX]], align 2 | ||
// POWERPC_64-NEXT: [[CONV:%.*]] = zext i16 [[TMP3]] to i32 | ||
// POWERPC_64-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[CONV]], 0 | ||
// POWERPC_64-NEXT: br i1 [[CMP1]], label %[[IF_THEN:.*]], label %[[IF_END:.*]] | ||
// POWERPC_64: [[IF_THEN]]: | ||
// POWERPC_64-NEXT: [[TMP4:%.*]] = load i16, ptr [[RESULT]], align 2 | ||
// POWERPC_64-NEXT: [[INC:%.*]] = add i16 [[TMP4]], 1 | ||
// POWERPC_64-NEXT: store i16 [[INC]], ptr [[RESULT]], align 2 | ||
// POWERPC_64-NEXT: br label %[[IF_END]] | ||
// POWERPC_64: [[IF_END]]: | ||
// POWERPC_64-NEXT: br label %[[FOR_INC:.*]] | ||
// POWERPC_64: [[FOR_INC]]: | ||
// POWERPC_64-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_64-NEXT: [[INC3:%.*]] = add nsw i32 [[TMP5]], 1 | ||
// POWERPC_64-NEXT: store i32 [[INC3]], ptr [[I]], align 4 | ||
// POWERPC_64-NEXT: br label %[[FOR_COND]], !llvm.loop [[LOOP2:![0-9]+]] | ||
// POWERPC_64: [[FOR_END]]: | ||
// POWERPC_64-NEXT: [[TMP6:%.*]] = load i16, ptr [[RESULT]], align 2 | ||
// POWERPC_64-NEXT: [[CONV4:%.*]] = zext i16 [[TMP6]] to i32 | ||
// POWERPC_64-NEXT: ret i32 [[CONV4]] | ||
// | ||
// POWERPC_64LE-LABEL: define dso_local signext i32 @test_Greater_than( | ||
// POWERPC_64LE-SAME: ptr noundef [[COLAUTHS:%.*]]) #[[ATTR0:[0-9]+]] { | ||
// POWERPC_64LE-NEXT: [[ENTRY:.*:]] | ||
// POWERPC_64LE-NEXT: [[COLAUTHS_ADDR:%.*]] = alloca ptr, align 8 | ||
// POWERPC_64LE-NEXT: [[RESULT:%.*]] = alloca i16, align 2 | ||
// POWERPC_64LE-NEXT: [[I:%.*]] = alloca i32, align 4 | ||
// POWERPC_64LE-NEXT: store ptr [[COLAUTHS]], ptr [[COLAUTHS_ADDR]], align 8 | ||
// POWERPC_64LE-NEXT: store i16 0, ptr [[RESULT]], align 2 | ||
// POWERPC_64LE-NEXT: store i32 0, ptr [[I]], align 4 | ||
// POWERPC_64LE-NEXT: br label %[[FOR_COND:.*]] | ||
// POWERPC_64LE: [[FOR_COND]]: | ||
// POWERPC_64LE-NEXT: [[TMP0:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_64LE-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP0]], 4 | ||
// POWERPC_64LE-NEXT: br i1 [[CMP]], label %[[FOR_BODY:.*]], label %[[FOR_END:.*]] | ||
// POWERPC_64LE: [[FOR_BODY]]: | ||
// POWERPC_64LE-NEXT: [[TMP1:%.*]] = load ptr, ptr [[COLAUTHS_ADDR]], align 8 | ||
// POWERPC_64LE-NEXT: [[TMP2:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_64LE-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP2]] to i64 | ||
// POWERPC_64LE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i16, ptr [[TMP1]], i64 [[IDXPROM]] | ||
// POWERPC_64LE-NEXT: [[TMP3:%.*]] = load i16, ptr [[ARRAYIDX]], align 2 | ||
// POWERPC_64LE-NEXT: [[CONV:%.*]] = zext i16 [[TMP3]] to i32 | ||
// POWERPC_64LE-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[CONV]], 0 | ||
// POWERPC_64LE-NEXT: br i1 [[CMP1]], label %[[IF_THEN:.*]], label %[[IF_END:.*]] | ||
// POWERPC_64LE: [[IF_THEN]]: | ||
// POWERPC_64LE-NEXT: [[TMP4:%.*]] = load i16, ptr [[RESULT]], align 2 | ||
// POWERPC_64LE-NEXT: [[INC:%.*]] = add i16 [[TMP4]], 1 | ||
// POWERPC_64LE-NEXT: store i16 [[INC]], ptr [[RESULT]], align 2 | ||
// POWERPC_64LE-NEXT: br label %[[IF_END]] | ||
// POWERPC_64LE: [[IF_END]]: | ||
// POWERPC_64LE-NEXT: br label %[[FOR_INC:.*]] | ||
// POWERPC_64LE: [[FOR_INC]]: | ||
// POWERPC_64LE-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_64LE-NEXT: [[INC3:%.*]] = add nsw i32 [[TMP5]], 1 | ||
// POWERPC_64LE-NEXT: store i32 [[INC3]], ptr [[I]], align 4 | ||
// POWERPC_64LE-NEXT: br label %[[FOR_COND]], !llvm.loop [[LOOP2:![0-9]+]] | ||
// POWERPC_64LE: [[FOR_END]]: | ||
// POWERPC_64LE-NEXT: [[TMP6:%.*]] = load i16, ptr [[RESULT]], align 2 | ||
// POWERPC_64LE-NEXT: [[CONV4:%.*]] = zext i16 [[TMP6]] to i32 | ||
// POWERPC_64LE-NEXT: ret i32 [[CONV4]] | ||
// | ||
// POWERPC_32-LABEL: define dso_local i32 @test_Greater_than( | ||
// POWERPC_32-SAME: ptr noundef [[COLAUTHS:%.*]]) #[[ATTR0:[0-9]+]] { | ||
// POWERPC_32-NEXT: [[ENTRY:.*:]] | ||
// POWERPC_32-NEXT: [[COLAUTHS_ADDR:%.*]] = alloca ptr, align 4 | ||
// POWERPC_32-NEXT: [[RESULT:%.*]] = alloca i16, align 2 | ||
// POWERPC_32-NEXT: [[I:%.*]] = alloca i32, align 4 | ||
// POWERPC_32-NEXT: store ptr [[COLAUTHS]], ptr [[COLAUTHS_ADDR]], align 4 | ||
// POWERPC_32-NEXT: store i16 0, ptr [[RESULT]], align 2 | ||
// POWERPC_32-NEXT: store i32 0, ptr [[I]], align 4 | ||
// POWERPC_32-NEXT: br label %[[FOR_COND:.*]] | ||
// POWERPC_32: [[FOR_COND]]: | ||
// POWERPC_32-NEXT: [[TMP0:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_32-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP0]], 4 | ||
// POWERPC_32-NEXT: br i1 [[CMP]], label %[[FOR_BODY:.*]], label %[[FOR_END:.*]] | ||
// POWERPC_32: [[FOR_BODY]]: | ||
// POWERPC_32-NEXT: [[TMP1:%.*]] = load ptr, ptr [[COLAUTHS_ADDR]], align 4 | ||
// POWERPC_32-NEXT: [[TMP2:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_32-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i16, ptr [[TMP1]], i32 [[TMP2]] | ||
// POWERPC_32-NEXT: [[TMP3:%.*]] = load i16, ptr [[ARRAYIDX]], align 2 | ||
// POWERPC_32-NEXT: [[CONV:%.*]] = zext i16 [[TMP3]] to i32 | ||
// POWERPC_32-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[CONV]], 0 | ||
// POWERPC_32-NEXT: br i1 [[CMP1]], label %[[IF_THEN:.*]], label %[[IF_END:.*]] | ||
// POWERPC_32: [[IF_THEN]]: | ||
// POWERPC_32-NEXT: [[TMP4:%.*]] = load i16, ptr [[RESULT]], align 2 | ||
// POWERPC_32-NEXT: [[INC:%.*]] = add i16 [[TMP4]], 1 | ||
// POWERPC_32-NEXT: store i16 [[INC]], ptr [[RESULT]], align 2 | ||
// POWERPC_32-NEXT: br label %[[IF_END]] | ||
// POWERPC_32: [[IF_END]]: | ||
// POWERPC_32-NEXT: br label %[[FOR_INC:.*]] | ||
// POWERPC_32: [[FOR_INC]]: | ||
// POWERPC_32-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4 | ||
// POWERPC_32-NEXT: [[INC3:%.*]] = add nsw i32 [[TMP5]], 1 | ||
// POWERPC_32-NEXT: store i32 [[INC3]], ptr [[I]], align 4 | ||
// POWERPC_32-NEXT: br label %[[FOR_COND]], !llvm.loop [[LOOP2:![0-9]+]] | ||
// POWERPC_32: [[FOR_END]]: | ||
// POWERPC_32-NEXT: [[TMP6:%.*]] = load i16, ptr [[RESULT]], align 2 | ||
// POWERPC_32-NEXT: [[CONV4:%.*]] = zext i16 [[TMP6]] to i32 | ||
// POWERPC_32-NEXT: ret i32 [[CONV4]] | ||
// | ||
int test_Greater_than(unsigned short *colauths) { | ||
unsigned short result = 0; | ||
for (int i = 0; i < 4; i++) { | ||
if (colauths[i] > 0) { | ||
result++; | ||
} | ||
} | ||
return result; | ||
} | ||
//. | ||
// POWERPC_64: [[LOOP2]] = distinct !{[[LOOP2]], [[META3:![0-9]+]]} | ||
// POWERPC_64: [[META3]] = !{!"llvm.loop.mustprogress"} | ||
//. | ||
// POWERPC_64LE: [[LOOP2]] = distinct !{[[LOOP2]], [[META3:![0-9]+]]} | ||
// POWERPC_64LE: [[META3]] = !{!"llvm.loop.mustprogress"} | ||
//. | ||
// POWERPC_32: [[LOOP2]] = distinct !{[[LOOP2]], [[META3:![0-9]+]]} | ||
// POWERPC_32: [[META3]] = !{!"llvm.loop.mustprogress"} | ||
//. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.