-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[AMDGPU][GlobalISel] Fix assert on APInt creation. #124608
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ; REQUIRES: asserts | ||
|
||
| ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -stop-after=instruction-select -o - %s | FileCheck %s | ||
|
||
|
|
||
| ; Check that APInt doesn't assert on creation from -2147483648 value. | ||
|
|
||
| ; CHECK-LABEL: @test | ||
| ; CHECK: S_BUFFER_LOAD_DWORD_SGPR_IMM | ||
|
||
|
|
||
| define amdgpu_cs void @test(<4 x i32> inreg %base, i32 inreg %i, ptr addrspace(1) inreg %out) { | ||
|
||
| %off = or i32 %i, -2147483648 | ||
| %v = call i32 @llvm.amdgcn.s.buffer.load.i32(<4 x i32> %base, i32 %off, i32 0) | ||
| store i32 %v, ptr addrspace(1) %out, align 4 | ||
| ret void | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APSint?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jay suggested to use APInt in the same case #122251 (comment)
@jayfoad?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the suggestion? I don't even see how you could use APSInt here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, indeed, that was just an incorrect usage of
APSInt(BitWidth, isUnsigned)...