-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handles basic syntax using ext_vector_type type. (#179)
* Handles basic syntax using ext_vector_type type. * Improvement is needed to support more complex syntax (such as ext.xyz) * Refactors implementation of VisitExtVectorElementExpr using CommonArrayLookup. * Adds test.
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
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
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 @@ | ||
// RUN: mlir-clang %s --function=* -S | FileCheck %s | ||
|
||
typedef size_t size_t_vec __attribute__((ext_vector_type(3))); | ||
|
||
size_t evt() { | ||
size_t_vec stv; | ||
return stv.x; | ||
} | ||
|
||
extern "C" const size_t_vec stv; | ||
size_t evt2() { | ||
return stv.x; | ||
} | ||
|
||
// CHECK: func.func @_Z3evtv() -> i32 attributes {llvm.linkage = #llvm.linkage<external>} { | ||
// CHECK-NEXT: %0 = memref.alloca() : memref<1x3xi32> | ||
// CHECK-NEXT: %1 = affine.load %0[0, 0] : memref<1x3xi32> | ||
// CHECK-NEXT: return %1 : i32 | ||
// CHECK-NEXT: } | ||
// CHECK: func.func @_Z4evt2v() -> i32 attributes {llvm.linkage = #llvm.linkage<external>} { | ||
// CHECK-NEXT: %0 = memref.get_global @stv : memref<3xi32> | ||
// CHECK-NEXT: %1 = affine.load %0[0] : memref<3xi32> | ||
// CHECK-NEXT: return %1 : i32 | ||
// CHECK-NEXT: } |