Skip to content

Commit cce934d

Browse files
authored
Integrates/llvm 20250312 llvm/llvm-project@cdf10d7 (#20229)
bump to llvm/llvm-project@cdf10d7 cherry-pick revert commit@[add3564](iree-org/llvm-project@add3564) to this PR llvm/llvm-project#129850. add revert commit [f8fe920](llvm/llvm-project@f8fe920) to this insert/extract_slice verifier PR: llvm/llvm-project#130487. --------- Signed-off-by: Bangtian Liu <[email protected]>
1 parent d2e0fdd commit cce934d

File tree

9 files changed

+19
-14
lines changed

9 files changed

+19
-14
lines changed

compiler/plugins/input/TOSA/InputConversion/test/apply_pdl_patterns_tosa.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func.func @mlp_invocation(%lhs: tensor<2x4xf32>, %rhs : tensor<4x8xf32>) -> tens
5151
%1 = tosa.clamp %0 {
5252
min_val = 0.0 : f32, max_val = 3.4028235e+38 : f32}
5353
: (tensor<1x2x8xf32>) -> tensor<1x2x8xf32>
54-
%2 = tosa.negate %1 : (tensor<1x2x8xf32>) -> tensor<1x2x8xf32>
54+
%2 = tosa.negate %1, %azp0, %bzp0 : (tensor<1x2x8xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x2x8xf32>
5555
%result_shape = tosa.const_shape {values = dense<[2, 8]> : tensor<2xindex>} : () -> !tosa.shape<2>
5656
%3 = tosa.reshape %2, %result_shape : (tensor<1x2x8xf32>, !tosa.shape<2>) -> tensor<2x8xf32>
5757
return %3 : tensor<2x8xf32>

compiler/plugins/target/CUDA/CUDATarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class CUDATargetBackend final : public TargetBackend {
566566
return variantOp.emitError() << "cannot initialize target triple";
567567
}
568568
targetMachine.reset(target->createTargetMachine(
569-
triple.str(), targetArch, targetFeatures, {}, {}));
569+
triple, targetArch, targetFeatures, {}, {}));
570570
if (targetMachine == nullptr) {
571571
return variantOp.emitError() << "cannot initialize target machine";
572572
}

compiler/plugins/target/LLVMCPU/LLVMTargetOptions.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,9 @@ createTargetMachine(const LLVMTarget &target) {
399399
llvm::TargetRegistry::lookupTarget(target.getTriple(), errorMessage);
400400
if (!llvmTarget)
401401
return nullptr;
402+
llvm::Triple triple(target.getTriple());
402403
std::unique_ptr<llvm::TargetMachine> machine(llvmTarget->createTargetMachine(
403-
target.getTriple(), target.getCpu() /* cpu e.g k8 */,
404+
triple, target.getCpu() /* cpu e.g k8 */,
404405
target.getCpuFeatures() /* cpu features e.g avx512f */,
405406
target.llvmTargetOptions, llvm::Reloc::Model::PIC_, {},
406407
target.codeGenOptLevel,

compiler/plugins/target/ROCM/ROCMTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ class ROCMTargetBackend final : public TargetBackend {
533533
std::string featureStr = llvm::join(features, ",");
534534

535535
targetMachine.reset(target->createTargetMachine(
536-
triple.str(), targetArch, featureStr, opt, llvm::Reloc::Model::PIC_,
536+
triple, targetArch, featureStr, opt, llvm::Reloc::Model::PIC_,
537537
std::nullopt, llvm::CodeGenOptLevel::Aggressive));
538538

539539
if (!targetMachine) {

compiler/src/iree/compiler/Codegen/LLVMCPU/test/apply_scale_lowering.mlir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ hal.executable private @apply_scale_no_vector_feature {
2828
%0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) alignment(64) offset(%c0) : memref<2xi32>
2929
%1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<2xi32>
3030
%2 = vector.load %0[%c0] : memref<2xi32>, vector<2xi32>
31-
%3 = tosa.apply_scale %2, %cst, %cst_0 {double_round = false} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
31+
%3 = tosa.apply_scale %2, %cst, %cst_0 {rounding_mode = "SINGLE_ROUND"} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
3232
vector.store %3, %1[%c0] : memref<2xi32>, vector<2xi32>
3333
return
3434
}
@@ -74,7 +74,7 @@ hal.executable private @apply_scale_v {
7474
%0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) alignment(64) offset(%c0) : memref<2xi32>
7575
%1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<2xi32>
7676
%2 = vector.load %0[%c0] : memref<2xi32>, vector<2xi32>
77-
%3 = tosa.apply_scale %2, %cst, %cst_0 {double_round = false} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
77+
%3 = tosa.apply_scale %2, %cst, %cst_0 {rounding_mode = "SINGLE_ROUND"} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
7878
vector.store %3, %1[%c0] : memref<2xi32>, vector<2xi32>
7979
return
8080
}
@@ -118,7 +118,7 @@ hal.executable private @apply_scale_zve64x {
118118
%0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) alignment(64) offset(%c0) : memref<2xi32>
119119
%1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<2xi32>
120120
%2 = vector.load %0[%c0] : memref<2xi32>, vector<2xi32>
121-
%3 = tosa.apply_scale %2, %cst, %cst_0 {double_round = false} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
121+
%3 = tosa.apply_scale %2, %cst, %cst_0 {rounding_mode = "SINGLE_ROUND"} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
122122
vector.store %3, %1[%c0] : memref<2xi32>, vector<2xi32>
123123
return
124124
}
@@ -162,7 +162,7 @@ hal.executable private @apply_scale_zve32x {
162162
%0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) alignment(64) offset(%c0) : memref<2xi32>
163163
%1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<2xi32>
164164
%2 = vector.load %0[%c0] : memref<2xi32>, vector<2xi32>
165-
%3 = tosa.apply_scale %2, %cst, %cst_0 {double_round = false} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
165+
%3 = tosa.apply_scale %2, %cst, %cst_0 {rounding_mode = "SINGLE_ROUND"} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
166166
vector.store %3, %1[%c0] : memref<2xi32>, vector<2xi32>
167167
return
168168
}
@@ -213,7 +213,7 @@ hal.executable private @apply_scale_zve32f {
213213
%0 = hal.interface.binding.subspan layout(#pipeline_layout) binding(0) alignment(64) offset(%c0) : memref<2xi32>
214214
%1 = hal.interface.binding.subspan layout(#pipeline_layout) binding(1) alignment(64) offset(%c0) : memref<2xi32>
215215
%2 = vector.load %0[%c0] : memref<2xi32>, vector<2xi32>
216-
%3 = tosa.apply_scale %2, %cst, %cst_0 {double_round = false} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
216+
%3 = tosa.apply_scale %2, %cst, %cst_0 {rounding_mode = "SINGLE_ROUND"} : (vector<2xi32>, vector<2xi32>, vector<2xi8>) -> vector<2xi32>
217217
vector.store %3, %1[%c0] : memref<2xi32>, vector<2xi32>
218218
return
219219
}

compiler/src/iree/compiler/Codegen/VMVX/test/select_lowering_strategy.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func.func @fusion_quant_matmul_generic() attributes {hal.executable.target = #ex
127127
%16 = arith.muli %in_1, %c-128_i32 : i32
128128
%17 = arith.subi %in_0, %16 : i32
129129
%18 = arith.addi %in, %17 : i32
130-
%19 = tosa.apply_scale %18, %c1101627623_i32, %c36_i8 {double_round = true} : (i32, i32, i8) -> i32
130+
%19 = tosa.apply_scale %18, %c1101627623_i32, %c36_i8 {rounding_mode = "DOUBLE_ROUND"} : (i32, i32, i8) -> i32
131131
%20 = arith.addi %19, %c-128_i32 : i32
132132
%21 = arith.cmpi slt, %20, %c-128_i32 : i32
133133
%22 = arith.select %21, %c-128_i32, %20 : i32

samples/custom_dispatch/cpu/mlp_plugin/mlp_tosa.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module @example attributes {hal.device.targets = [#cpu_target]} {
5656
%1 = tosa.clamp %0 {
5757
min_val = 0.0 : f32, max_val = 3.4028235e+38 : f32}
5858
: (tensor<1x2x8xf32>) -> tensor<1x2x8xf32>
59-
%2 = tosa.negate %1 : (tensor<1x2x8xf32>) -> tensor<1x2x8xf32>
59+
%2 = tosa.negate %1, %azp0, %bzp0 : (tensor<1x2x8xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x2x8xf32>
6060
%result_shape = tosa.const_shape {values = dense<[2, 8]> : tensor<2xindex>} : () -> !tosa.shape<2>
6161
%3 = tosa.reshape %2, %result_shape : (tensor<1x2x8xf32>, !tosa.shape<2>) -> tensor<2x8xf32>
6262
return %3 : tensor<2x8xf32>

tests/e2e/tosa_ops/negate.mlir

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
func.func @tensor_float() {
22
%0 = util.unfoldable_constant dense<[-1.0, -0.5, 0.0, 1.0]> : tensor<4xf32>
3-
%result = tosa.negate %0 : (tensor<4xf32>) -> tensor<4xf32>
3+
%input_zp = "tosa.const"() <{values = dense<0.0> : tensor<1xf32>}> : () -> tensor<1xf32>
4+
%output_zp = "tosa.const"() <{values = dense<0.0> : tensor<1xf32>}> : () -> tensor<1xf32>
5+
%result = tosa.negate %0, %input_zp, %output_zp : (tensor<4xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<4xf32>
46
check.expect_almost_eq_const(%result, dense<[1.0, 0.5, 0.0, -1.0]> : tensor<4xf32>) : tensor<4xf32>
57
return
68
}
79

810
func.func @tensor_int() {
911
%0 = util.unfoldable_constant dense<[-1, 0, 3, 1]> : tensor<4xi32>
10-
%result = tosa.negate %0 : (tensor<4xi32>) -> tensor<4xi32>
12+
%input_zp = "tosa.const"() <{values = dense<0> : tensor<1xi32>}> : () -> tensor<1xi32>
13+
%output_zp = "tosa.const"() <{values = dense<0> : tensor<1xi32>}> : () -> tensor<1xi32>
14+
%result = tosa.negate %0, %input_zp, %output_zp : (tensor<4xi32>, tensor<1xi32>, tensor<1xi32>) -> tensor<4xi32>
1115
check.expect_eq_const(%result, dense<[1, 0, -3, -1]> : tensor<4xi32>) : tensor<4xi32>
1216
return
1317
}

third_party/llvm-project

Submodule llvm-project updated 1469 files

0 commit comments

Comments
 (0)