Nirav Dave | 9011da3 | 2016-09-22 17:28:43 +0000 | [diff] [blame] | 1 | ; RUN: llc -debug-only=misched -march=amdgcn -verify-machineinstrs %s -o - 2>&1| FileCheck -check-prefix=SI-NOHSA -check-prefix=FUNC -check-prefix=DEBUG %s |
| 2 | ; REQUIRES: asserts |
| 3 | |
| 4 | ; Verify that the extload generated from %eval has the default |
| 5 | ; alignment size (2) corresponding to the underlying memory size (i16) |
| 6 | ; size and not 4 corresponding to the sign-extended size (i32). |
| 7 | |
| 8 | ; DEBUG: {{^}}# Machine code for function extload_align: |
| 9 | ; DEBUG: mem:LD2[<unknown>]{{[^(]}} |
| 10 | ; DEBUG: {{^}}# End machine code for function extload_align. |
| 11 | |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 12 | define amdgpu_kernel void @extload_align(i32* %out, i32 %index) #0 { |
Nirav Dave | 9011da3 | 2016-09-22 17:28:43 +0000 | [diff] [blame] | 13 | %v0 = alloca [4 x i16] |
| 14 | %a1 = getelementptr inbounds [4 x i16], [4 x i16]* %v0, i32 0, i32 0 |
| 15 | %a2 = getelementptr inbounds [4 x i16], [4 x i16]* %v0, i32 0, i32 1 |
| 16 | store i16 0, i16* %a1 |
| 17 | store i16 1, i16* %a2 |
| 18 | %a = getelementptr inbounds [4 x i16], [4 x i16]* %v0, i32 0, i32 %index |
| 19 | %val = load i16, i16* %a |
| 20 | %eval = sext i16 %val to i32 |
| 21 | store i32 %eval, i32* %out |
| 22 | ret void |
| 23 | } |