-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AIEX] Enable InferAddressSpacesPass
- Loading branch information
1 parent
65047bf
commit 0ca00c0
Showing
4 changed files
with
67 additions
and
4 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
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
59 changes: 59 additions & 0 deletions
59
llvm/test/CodeGen/AIE/aie2/GlobalISel/infer-address-space.ll
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,59 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4 | ||
|
||
; RUN: llc -O0 -mtriple=aie2 -stop-after=irtranslator %s -o - 2>&1 | FileCheck -check-prefixes=AIE-O0 %s | ||
; RUN: llc -O1 -mtriple=aie2 -stop-after=irtranslator %s -o - 2>&1 | FileCheck -check-prefixes=AIE-O1 %s | ||
; RUN: llc -O2 -mtriple=aie2 -stop-after=irtranslator %s -o - 2>&1 | FileCheck -check-prefixes=AIE-O2 %s | ||
|
||
define <8 x i32> @test_infer_addrspace(ptr %input , <2 x i32> %b) { | ||
; AIE-O0-LABEL: name: test_infer_addrspace | ||
; AIE-O0: bb.1.entry: | ||
; AIE-O0-NEXT: liveins: $l0, $p0 | ||
; AIE-O0-NEXT: {{ $}} | ||
; AIE-O0-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $p0 | ||
; AIE-O0-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $l0 | ||
; AIE-O0-NEXT: [[ADDRSPACE_CAST:%[0-9]+]]:_(p5) = G_ADDRSPACE_CAST [[COPY]](p0) | ||
; AIE-O0-NEXT: [[ADDRSPACE_CAST1:%[0-9]+]]:_(p0) = G_ADDRSPACE_CAST [[ADDRSPACE_CAST]](p5) | ||
; AIE-O0-NEXT: [[C:%[0-9]+]]:_(s20) = G_CONSTANT i20 10 | ||
; AIE-O0-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = nuw G_PTR_ADD [[ADDRSPACE_CAST1]], [[C]](s20) | ||
; AIE-O0-NEXT: [[ADDRSPACE_CAST2:%[0-9]+]]:_(p5) = G_ADDRSPACE_CAST [[PTR_ADD]](p0) | ||
; AIE-O0-NEXT: [[LOAD:%[0-9]+]]:_(<8 x s32>) = G_LOAD [[ADDRSPACE_CAST2]](p5) :: (load (<8 x s32>) from %ir.add.ptr.ascast.i, addrspace 5) | ||
; AIE-O0-NEXT: $wl0 = COPY [[LOAD]](<8 x s32>) | ||
; AIE-O0-NEXT: PseudoRET implicit $lr, implicit $wl0 | ||
; | ||
; AIE-O1-LABEL: name: test_infer_addrspace | ||
; AIE-O1: bb.1.entry: | ||
; AIE-O1-NEXT: liveins: $l0, $p0 | ||
; AIE-O1-NEXT: {{ $}} | ||
; AIE-O1-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $p0 | ||
; AIE-O1-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $l0 | ||
; AIE-O1-NEXT: [[ADDRSPACE_CAST:%[0-9]+]]:_(p5) = G_ADDRSPACE_CAST [[COPY]](p0) | ||
; AIE-O1-NEXT: [[ADDRSPACE_CAST1:%[0-9]+]]:_(p0) = G_ADDRSPACE_CAST [[ADDRSPACE_CAST]](p5) | ||
; AIE-O1-NEXT: [[C:%[0-9]+]]:_(s20) = G_CONSTANT i20 10 | ||
; AIE-O1-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = nuw G_PTR_ADD [[ADDRSPACE_CAST1]], [[C]](s20) | ||
; AIE-O1-NEXT: [[ADDRSPACE_CAST2:%[0-9]+]]:_(p5) = G_ADDRSPACE_CAST [[PTR_ADD]](p0) | ||
; AIE-O1-NEXT: [[LOAD:%[0-9]+]]:_(<8 x s32>) = G_LOAD [[ADDRSPACE_CAST2]](p5) :: (load (<8 x s32>) from %ir.add.ptr.ascast.i, addrspace 5) | ||
; AIE-O1-NEXT: $wl0 = COPY [[LOAD]](<8 x s32>) | ||
; AIE-O1-NEXT: PseudoRET implicit $lr, implicit $wl0 | ||
; | ||
; AIE-O2-LABEL: name: test_infer_addrspace | ||
; AIE-O2: bb.1.entry: | ||
; AIE-O2-NEXT: liveins: $l0, $p0 | ||
; AIE-O2-NEXT: {{ $}} | ||
; AIE-O2-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $p0 | ||
; AIE-O2-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $l0 | ||
; AIE-O2-NEXT: [[ADDRSPACE_CAST:%[0-9]+]]:_(p5) = G_ADDRSPACE_CAST [[COPY]](p0) | ||
; AIE-O2-NEXT: [[ADDRSPACE_CAST1:%[0-9]+]]:_(p0) = G_ADDRSPACE_CAST [[ADDRSPACE_CAST]](p5) | ||
; AIE-O2-NEXT: [[C:%[0-9]+]]:_(s20) = G_CONSTANT i20 10 | ||
; AIE-O2-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = nuw G_PTR_ADD [[ADDRSPACE_CAST1]], [[C]](s20) | ||
; AIE-O2-NEXT: [[ADDRSPACE_CAST2:%[0-9]+]]:_(p5) = G_ADDRSPACE_CAST [[PTR_ADD]](p0) | ||
; AIE-O2-NEXT: [[LOAD:%[0-9]+]]:_(<8 x s32>) = G_LOAD [[ADDRSPACE_CAST2]](p5) :: (load (<8 x s32>) from %ir.add.ptr.ascast.i, addrspace 5) | ||
; AIE-O2-NEXT: $wl0 = COPY [[LOAD]](<8 x s32>) | ||
; AIE-O2-NEXT: PseudoRET implicit $lr, implicit $wl0 | ||
entry: | ||
%p_mat_b.0890 = addrspacecast ptr %input to ptr addrspace(5) | ||
%39 = addrspacecast ptr addrspace(5) %p_mat_b.0890 to ptr | ||
%add.ptr.i537 = getelementptr inbounds i8, ptr %39, i20 10 | ||
%add.ptr.ascast.i = addrspacecast ptr %add.ptr.i537 to ptr addrspace(5) | ||
%40 = load <8 x i32>, ptr addrspace(5) %add.ptr.ascast.i, align 32 | ||
ret <8 x i32> %40 | ||
} |
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