Skip to content

Commit

Permalink
Integrate LLVM at llvm/llvm-project@78e0cca13507
Browse files Browse the repository at this point in the history
Updates LLVM usage to match
[78e0cca13507](llvm/llvm-project@78e0cca13507)

PiperOrigin-RevId: 603055188
  • Loading branch information
d0k authored and TensorFlow MLIR Team committed Jan 31, 2024
1 parent a5e3fb8 commit f14f936
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 34 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ http_archive(
],
)

LLVM_COMMIT = "8b38970811086b09752a5909d0c17de4d0cd04c3"
LLVM_COMMIT = "78e0cca135076154abab21eadd146dc1dfd3549f"

LLVM_SHA256 = "7be1eceb43c56f5b02cbaa293cf3213a877f79f9a26f34cc9293f757880d5f2e"
LLVM_SHA256 = "7447c5000ebc5e6976e496fa55755a209b9e0d82869eea1298da1abcc8c82b41"

http_archive(
name = "llvm-raw",
Expand Down
2 changes: 1 addition & 1 deletion build_tools/llvm_version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
8b38970811086b09752a5909d0c17de4d0cd04c3
78e0cca135076154abab21eadd146dc1dfd3549f

2 changes: 1 addition & 1 deletion stablehlo/build_tools/llvm_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8b38970811086b09752a5909d0c17de4d0cd04c3
78e0cca135076154abab21eadd146dc1dfd3549f
30 changes: 2 additions & 28 deletions tests/naive_copy_removal.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ func.func @target_is_subview_of_subview(%arg0: memref<8x8xf32>)
%subview_5 = memref.subview %alloc_4[0, 0] [%c4, %c4] [1, 1] :
memref<8x8xf32> to memref<?x?xf32, strided<[8, 1]>>
%subview_6 = memref.subview %subview_5[0, 0] [%c4, %c4] [1, 1] :
memref<?x?xf32, strided<[8, 1]>> to memref<?x?xf32, strided<[?, ?]>>
memref<?x?xf32, strided<[8, 1]>> to memref<?x?xf32, strided<[8, 1]>>
memref.copy %arg0, %subview_6 :
memref<8x8xf32> to memref<?x?xf32, strided<[?, ?]>>
memref<8x8xf32> to memref<?x?xf32, strided<[8, 1]>>
return %arg0 : memref<8x8xf32>
}

Expand All @@ -79,32 +79,6 @@ func.func @target_is_subview_of_subview(%arg0: memref<8x8xf32>)

// -----

func.func @do_not_simplify_subview_of_subview(%arg0: memref<8x8xf32>)
-> vector<8x8xf32> {
%c4 = arith.constant 4 : index
%c0 = arith.constant 0 : index
%cst_0 = arith.constant 0.000000e+00 : f32
%alloc_4 = memref.alloc() {alignment = 64 : i64} : memref<8x8xf32>
%subview_5 = memref.subview %alloc_4[0, 0] [%c4, %c4] [1, 1] :
memref<8x8xf32> to memref<?x?xf32, strided<[8, 1]>>
%subview_6 = memref.subview %subview_5[0, 0] [%c4, %c4] [1, 1] :
memref<?x?xf32, strided<[8, 1]>> to memref<?x?xf32, strided<[?, ?]>>
memref.copy %arg0, %subview_6 :
memref<8x8xf32> to memref<?x?xf32, strided<[?, ?]>>
%27 = vector.transfer_read %subview_5[%c0, %c0], %cst_0 :
memref<?x?xf32, strided<[8, 1]>>, vector<8x8xf32>
return %27 : vector<8x8xf32>
}

// CHECK-LABEL: func @do_not_simplify_subview_of_subview(

// CHECK: memref.alloc
// CHECK: memref.subview
// CHECK: memref.subview
// CHECK: memref.copy

// -----

func.func @do_not_simplify_subview(%arg0: memref<8x8xf32>) -> vector<8x8xf32> {
%c4 = arith.constant 4 : index
%c0 = arith.constant 0 : index
Expand Down
3 changes: 1 addition & 2 deletions tests/vectorize_copy.mlir
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// RUN: mlir-hlo-opt %s --vectorize-copy --split-input-file | FileCheck %s

func.func @vectorize_copy(%arg: memref<2x2xf32>) -> memref<2x2xf32> {
%subview = memref.subview %arg[0, 0] [2, 2] [1, 1] : memref<2x2xf32> to memref<2x2xf32, strided<[16, 1]>>
func.func @vectorize_copy(%subview: memref<2x2xf32, strided<[16, 1]>>) -> memref<2x2xf32> {
%alloc = memref.alloc() : memref<2x2xf32>
memref.copy %subview, %alloc : memref<2x2xf32, strided<[16, 1]>> to memref<2x2xf32>
return %alloc : memref<2x2xf32>
Expand Down

0 comments on commit f14f936

Please sign in to comment.