From bd0aab5a159913403c0878a9a2d907caf4b5cfd3 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 22 Jul 2023 15:57:41 -0700 Subject: [Frontend] Sort featuresVec for AMDGPU target features D145579 leverages the iteration order of StringSet, which is not guaranteed to be deterministic. --- flang/lib/Frontend/FrontendActions.cpp | 2 +- flang/test/Lower/OpenMP/target_cpu_features.f90 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'flang') diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp index d1158cb..0154fd2 100644 --- a/flang/lib/Frontend/FrontendActions.cpp +++ b/flang/lib/Frontend/FrontendActions.cpp @@ -165,7 +165,7 @@ getExplicitAndImplicitAMDGPUTargetFeatures(CompilerInstance &ci, implicitFeatureItem.first().str()) .str()); } - + llvm::sort(featuresVec); return llvm::join(featuresVec, ","); } diff --git a/flang/test/Lower/OpenMP/target_cpu_features.f90 b/flang/test/Lower/OpenMP/target_cpu_features.f90 index eb87c81..08aee02 100644 --- a/flang/test/Lower/OpenMP/target_cpu_features.f90 +++ b/flang/test/Lower/OpenMP/target_cpu_features.f90 @@ -6,10 +6,10 @@ !=============================================================================== !CHECK: omp.target = #omp.target +!CHECK-SAME: target_features = "+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot10-insts, +!CHECK-SAME: +dot2-insts,+dot3-insts,+dot4-insts,+dot5-insts,+dot6-insts,+dot7-insts,+dpp, +!CHECK-SAME: +gfx8-insts,+gfx9-insts,+image-insts,+mai-insts,+s-memrealtime,+s-memtime-inst, +!CHECK-SAME: +wavefrontsize64"> !CHECK-LABEL: func.func @_QPomp_target_simple() subroutine omp_target_simple ! Directive needed to prevent subroutine from being filtered out when -- cgit v1.1