| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,53 @@ | ||
| // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -x hlsl -emit-llvm -o - %s | FileCheck %s | ||
|
|
||
| using handle_float_t = __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::contained_type(float)]]; | ||
|
|
||
| // CHECK: %"class.hlsl::RWBuffer" = type { target("dx.TypedBuffer", <4 x float>, 1, 0, 0) | ||
| // CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", %struct.MyStruct = type { <4 x float>, <2 x i32>, [8 x i8] }, 1, 0) | ||
|
|
||
| // CHECK: define void @_Z2faU9_Res_u_CTfu17__hlsl_resource_t(target("dx.TypedBuffer", float, 1, 0, 0) %a) | ||
| // CHECK: call void @_Z4foo1U9_Res_u_CTfu17__hlsl_resource_t(target("dx.TypedBuffer", float, 1, 0, 0) %0) | ||
| // CHECK: declare void @_Z4foo1U9_Res_u_CTfu17__hlsl_resource_t(target("dx.TypedBuffer", float, 1, 0, 0)) | ||
|
|
||
| void foo1(handle_float_t res); | ||
|
|
||
| void fa(handle_float_t a) { | ||
| foo1(a); | ||
| } | ||
|
|
||
| // CHECK: define void @_Z2fbU9_Res_u_CTfu17__hlsl_resource_t(target("dx.TypedBuffer", float, 1, 0, 0) %a) | ||
| void fb(handle_float_t a) { | ||
| handle_float_t b = a; | ||
| } | ||
|
|
||
| // CHECK: define void @_Z2fcN4hlsl8RWBufferIDv4_fEE(ptr noundef byval(%"class.hlsl::RWBuffer") align 16 %a) | ||
| // CHECK: call void @_Z4foo2N4hlsl8RWBufferIDv4_fEE(ptr noundef byval(%"class.hlsl::RWBuffer") align 16 %agg.tmp) | ||
| // CHECK: declare void @_Z4foo2N4hlsl8RWBufferIDv4_fEE(ptr noundef byval(%"class.hlsl::RWBuffer") align 16) | ||
| void foo2(RWBuffer<float4> buf); | ||
|
|
||
| void fc(RWBuffer<float4> a) { | ||
| foo2(a); | ||
| } | ||
|
|
||
| void fd(RWBuffer<float4> a) { | ||
| RWBuffer<float4> b = a; | ||
| } | ||
|
|
||
| struct MyStruct { | ||
| float4 f; | ||
| int2 i; | ||
| }; | ||
|
|
||
| // CHECK: define void @_Z2feN4hlsl16StructuredBufferI8MyStructEE(ptr noundef byval(%"class.hlsl::StructuredBuffer") align 16 %a) | ||
| // CHECK: call void @_Z4foo3N4hlsl16StructuredBufferI8MyStructEE(ptr noundef byval(%"class.hlsl::StructuredBuffer") align 16 %agg.tmp) | ||
| // CHECK: declare void @_Z4foo3N4hlsl16StructuredBufferI8MyStructEE(ptr noundef byval(%"class.hlsl::StructuredBuffer") align 16) | ||
| void foo3(StructuredBuffer<MyStruct> buf); | ||
|
|
||
| void fe(StructuredBuffer<MyStruct> a) { | ||
| foo3(a); | ||
| } | ||
|
|
||
| void ff(StructuredBuffer<MyStruct> a) { | ||
| StructuredBuffer<MyStruct> b = a; | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,22 @@ | ||
| // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s | ||
|
|
||
| // CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} {{.*}} struct MyBuffer definition | ||
| // CHECK: FieldDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 4]]:3, col:68> col:68 h '__hlsl_resource_t | ||
| // CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]] | ||
| // CHECK-SAME{LITERAL}: [[hlsl::is_rov]] | ||
| struct MyBuffer { | ||
| __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::is_rov]] h; | ||
| }; | ||
|
|
||
| // CHECK: VarDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 3]]:1, col:66> col:66 res '__hlsl_resource_t | ||
| // CHECK-SAME{LITERAL}: [[hlsl::resource_class(SRV)]] | ||
| // CHECK-SAME{LITERAL}: [[hlsl::is_rov]] | ||
| __hlsl_resource_t [[hlsl::is_rov]] [[hlsl::resource_class(SRV)]] res; | ||
|
|
||
| // CHECK: FunctionDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 4]]:1, line:[[# @LINE + 6]]:1> line:[[# @LINE + 4]]:6 f 'void () | ||
| // CHECK: VarDecl 0x{{[0-9a-f]+}} <col:3, col:72> col:72 r '__hlsl_resource_t | ||
| // CHECK-SAME{LITERAL}: [[hlsl::resource_class(Sampler)]] | ||
| // CHECK-SAME{LITERAL}: [[hlsl::is_rov]] | ||
| void f() { | ||
| __hlsl_resource_t [[hlsl::resource_class(Sampler)]] [[hlsl::is_rov]] r; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,22 @@ | ||
| // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s | ||
|
|
||
| // CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} {{.*}} struct MyBuffer definition | ||
| // CHECK: FieldDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 4]]:3, col:72> col:72 h1 '__hlsl_resource_t | ||
| // CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]] | ||
| // CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]] | ||
| struct MyBuffer { | ||
| __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::raw_buffer]] h1; | ||
| }; | ||
|
|
||
| // CHECK: VarDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 3]]:1, col:70> col:70 h2 '__hlsl_resource_t | ||
| // CHECK-SAME{LITERAL}: [[hlsl::resource_class(SRV)]] | ||
| // CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]] | ||
| __hlsl_resource_t [[hlsl::raw_buffer]] [[hlsl::resource_class(SRV)]] h2; | ||
|
|
||
| // CHECK: FunctionDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 4]]:1, line:[[# @LINE + 6]]:1> line:[[# @LINE + 4]]:6 f 'void () | ||
| // CHECK: VarDecl 0x{{[0-9a-f]+}} <col:3, col:72> col:72 h3 '__hlsl_resource_t | ||
| // CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]] | ||
| // CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]] | ||
| void f() { | ||
| __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::raw_buffer]] h3; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| //===-- include/flang/Common/erfc-scaled.h-----------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef FORTRAN_COMMON_ERFC_SCALED_H_ | ||
| #define FORTRAN_COMMON_ERFC_SCALED_H_ | ||
|
|
||
| namespace Fortran::common { | ||
| template <typename T> inline T ErfcScaled(T arg) { | ||
| // Coefficients for approximation to erfc in the first interval. | ||
| static const T a[5] = {3.16112374387056560e00, 1.13864154151050156e02, | ||
| 3.77485237685302021e02, 3.20937758913846947e03, 1.85777706184603153e-1}; | ||
| static const T b[4] = {2.36012909523441209e01, 2.44024637934444173e02, | ||
| 1.28261652607737228e03, 2.84423683343917062e03}; | ||
|
|
||
| // Coefficients for approximation to erfc in the second interval. | ||
| static const T c[9] = {5.64188496988670089e-1, 8.88314979438837594e00, | ||
| 6.61191906371416295e01, 2.98635138197400131e02, 8.81952221241769090e02, | ||
| 1.71204761263407058e03, 2.05107837782607147e03, 1.23033935479799725e03, | ||
| 2.15311535474403846e-8}; | ||
| static const T d[8] = {1.57449261107098347e01, 1.17693950891312499e02, | ||
| 5.37181101862009858e02, 1.62138957456669019e03, 3.29079923573345963e03, | ||
| 4.36261909014324716e03, 3.43936767414372164e03, 1.23033935480374942e03}; | ||
|
|
||
| // Coefficients for approximation to erfc in the third interval. | ||
| static const T p[6] = {3.05326634961232344e-1, 3.60344899949804439e-1, | ||
| 1.25781726111229246e-1, 1.60837851487422766e-2, 6.58749161529837803e-4, | ||
| 1.63153871373020978e-2}; | ||
| static const T q[5] = {2.56852019228982242e00, 1.87295284992346047e00, | ||
| 5.27905102951428412e-1, 6.05183413124413191e-2, 2.33520497626869185e-3}; | ||
|
|
||
| constexpr T sqrtpi{1.7724538509078120380404576221783883301349L}; | ||
| constexpr T rsqrtpi{0.5641895835477562869480794515607725858440L}; | ||
| constexpr T epsilonby2{std::numeric_limits<T>::epsilon() * 0.5}; | ||
| constexpr T xneg{-26.628e0}; | ||
| constexpr T xhuge{6.71e7}; | ||
| constexpr T thresh{0.46875e0}; | ||
| constexpr T zero{0.0}; | ||
| constexpr T one{1.0}; | ||
| constexpr T four{4.0}; | ||
| constexpr T sixteen{16.0}; | ||
| constexpr T xmax{1.0 / (sqrtpi * std::numeric_limits<T>::min())}; | ||
| static_assert(xmax > xhuge, "xmax must be greater than xhuge"); | ||
|
|
||
| T ysq; | ||
| T xnum; | ||
| T xden; | ||
| T del; | ||
| T result; | ||
|
|
||
| auto x{arg}; | ||
| auto y{std::fabs(x)}; | ||
|
|
||
| if (y <= thresh) { | ||
| // evaluate erf for |x| <= 0.46875 | ||
| ysq = zero; | ||
| if (y > epsilonby2) { | ||
| ysq = y * y; | ||
| } | ||
| xnum = a[4] * ysq; | ||
| xden = ysq; | ||
| for (int i{0}; i < 3; i++) { | ||
| xnum = (xnum + a[i]) * ysq; | ||
| xden = (xden + b[i]) * ysq; | ||
| } | ||
| result = x * (xnum + a[3]) / (xden + b[3]); | ||
| result = one - result; | ||
| result = std::exp(ysq) * result; | ||
| return result; | ||
| } else if (y <= four) { | ||
| // evaluate erfc for 0.46875 < |x| <= 4.0 | ||
| xnum = c[8] * y; | ||
| xden = y; | ||
| for (int i{0}; i < 7; ++i) { | ||
| xnum = (xnum + c[i]) * y; | ||
| xden = (xden + d[i]) * y; | ||
| } | ||
| result = (xnum + c[7]) / (xden + d[7]); | ||
| } else { | ||
| // evaluate erfc for |x| > 4.0 | ||
| result = zero; | ||
| if (y >= xhuge) { | ||
| if (y < xmax) { | ||
| result = rsqrtpi / y; | ||
| } | ||
| } else { | ||
| ysq = one / (y * y); | ||
| xnum = p[5] * ysq; | ||
| xden = ysq; | ||
| for (int i{0}; i < 4; ++i) { | ||
| xnum = (xnum + p[i]) * ysq; | ||
| xden = (xden + q[i]) * ysq; | ||
| } | ||
| result = ysq * (xnum + p[4]) / (xden + q[4]); | ||
| result = (rsqrtpi - result) / y; | ||
| } | ||
| } | ||
| // fix up for negative argument, erf, etc. | ||
| if (x < zero) { | ||
| if (x < xneg) { | ||
| result = std::numeric_limits<T>::max(); | ||
| } else { | ||
| ysq = trunc(x * sixteen) / sixteen; | ||
| del = (x - ysq) * (x + ysq); | ||
| y = std::exp((ysq * ysq)) * std::exp((del)); | ||
| result = (y + y) - result; | ||
| } | ||
| } | ||
| return result; | ||
| } | ||
| } // namespace Fortran::common | ||
| #endif // FORTRAN_COMMON_ERFC_SCALED_H_ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ! RUN: %python %S/test_folding.py %s %flang_fc1 | ||
| module m | ||
| real(4), parameter :: x20_4 = erfc_scaled(20._4) | ||
| logical, parameter :: t20_4 = x20_4 == 0.02817435003817081451416015625_4 | ||
| real(8), parameter :: x20_8 = erfc_scaled(20._8) | ||
| logical, parameter :: t20_8 = x20_8 == 0.0281743487410513193669459042212110944092273712158203125_8 | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| ! RUN: %flang_fc1 -fopenmp -fopenacc -E %s 2>&1 | FileCheck %s | ||
| program main | ||
| ! CHECK: k01=1+ 1 | ||
| k01=1+ | ||
| !$ & 1 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| !RUN: %flang_fc1 -fdebug-unparse -pedantic %s 2>&1 | FileCheck %s | ||
| !Test rewrite of "PRINT namelistname" into "WRITE(*,NML=namelistname)" | ||
| !CHECK: nonstandard: namelist in PRINT statement | ||
| namelist /nml/x | ||
| x = 123. | ||
| !CHECK: WRITE (*, NML=nml) | ||
| print nml | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| !RUN: %flang -fsyntax-only %s 2>&1 | FileCheck --allow-empty %s | ||
| !Ensure no bogus error message about incompatible character length | ||
| !CHECK-NOT: error | ||
|
|
||
| module m1 | ||
| integer :: n = 1 | ||
| end | ||
|
|
||
| module m2 | ||
| interface | ||
| module subroutine s(a,b) | ||
| use m1 | ||
| character(n) :: a | ||
| character(n) :: b | ||
| end | ||
| end interface | ||
| end | ||
|
|
||
| submodule(m2) m2s1 | ||
| contains | ||
| module procedure s | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # REQUIRES: x86 | ||
|
|
||
| # RUN: llvm-mc -filetype=obj -triple=i686-windows %s -o %t.obj | ||
| # RUN: llvm-lib -machine:x86 -out:%t-func.lib %t.obj | ||
|
|
||
| # -export:func creates a weak alias to a lazy symbol. Make sure we can handle that when processing -export:func2=func. | ||
| # RUN: lld-link -dll -noentry -machine:x86 -out:%t.dll %t-func.lib -export:func -export:func2=func | ||
|
|
||
| .text | ||
| .def @feat.00; | ||
| .scl 3; | ||
| .type 0; | ||
| .endef | ||
| .globl @feat.00 | ||
| .set @feat.00, 1 | ||
| .globl _func@0 | ||
| _func@0: | ||
| retl |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| //===-- DynamicLoaderDarwinProperties.cpp ---------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "DynamicLoaderDarwinProperties.h" | ||
|
|
||
| using namespace lldb_private; | ||
|
|
||
| #define LLDB_PROPERTIES_dynamicloaderdarwin_experimental | ||
| #include "DynamicLoaderDarwinProperties.inc" | ||
|
|
||
| enum { | ||
| #define LLDB_PROPERTIES_dynamicloaderdarwin_experimental | ||
| #include "DynamicLoaderDarwinPropertiesEnum.inc" | ||
| }; | ||
|
|
||
| llvm::StringRef DynamicLoaderDarwinProperties::GetSettingName() { | ||
| static constexpr llvm::StringLiteral g_setting_name("darwin"); | ||
| return g_setting_name; | ||
| } | ||
|
|
||
| DynamicLoaderDarwinProperties::ExperimentalProperties::ExperimentalProperties() | ||
| : Properties(std::make_shared<OptionValueProperties>( | ||
| GetExperimentalSettingsName())) { | ||
| m_collection_sp->Initialize(g_dynamicloaderdarwin_experimental_properties); | ||
| } | ||
|
|
||
| DynamicLoaderDarwinProperties::DynamicLoaderDarwinProperties() | ||
| : Properties(std::make_shared<OptionValueProperties>(GetSettingName())), | ||
| m_experimental_properties(std::make_unique<ExperimentalProperties>()) { | ||
| m_collection_sp->AppendProperty( | ||
| Properties::GetExperimentalSettingsName(), | ||
| "Experimental settings - setting these won't produce errors if the " | ||
| "setting is not present.", | ||
| true, m_experimental_properties->GetValueProperties()); | ||
| } | ||
|
|
||
| bool DynamicLoaderDarwinProperties::GetEnableParallelImageLoad() const { | ||
| return m_experimental_properties->GetPropertyAtIndexAs<bool>( | ||
| ePropertyEnableParallelImageLoad, | ||
| g_dynamicloaderdarwin_experimental_properties | ||
| [ePropertyEnableParallelImageLoad] | ||
| .default_uint_value != 0); | ||
| } | ||
|
|
||
| DynamicLoaderDarwinProperties &DynamicLoaderDarwinProperties::GetGlobal() { | ||
| static DynamicLoaderDarwinProperties g_settings; | ||
| return g_settings; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| //===-- DynamicLoaderDarwinProperties.h -------------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef LLDB_SOURCE_PLUGINS_DYNAMICLOADER_MACOSX_DYLD_DYNAMICLOADERDARWINPROPERTIES_H | ||
| #define LLDB_SOURCE_PLUGINS_DYNAMICLOADER_MACOSX_DYLD_DYNAMICLOADERDARWINPROPERTIES_H | ||
|
|
||
| #include "lldb/Core/UserSettingsController.h" | ||
|
|
||
| namespace lldb_private { | ||
|
|
||
| class DynamicLoaderDarwinProperties : public Properties { | ||
| public: | ||
| class ExperimentalProperties : public Properties { | ||
| public: | ||
| ExperimentalProperties(); | ||
| }; | ||
| static llvm::StringRef GetSettingName(); | ||
| static DynamicLoaderDarwinProperties &GetGlobal(); | ||
| DynamicLoaderDarwinProperties(); | ||
| ~DynamicLoaderDarwinProperties() override = default; | ||
| bool GetEnableParallelImageLoad() const; | ||
|
|
||
| private: | ||
| std::unique_ptr<ExperimentalProperties> m_experimental_properties; | ||
| }; | ||
|
|
||
| } // namespace lldb_private | ||
|
|
||
| #endif // LLDB_SOURCE_PLUGINS_DYNAMICLOADER_MACOSX_DYLD_DYNAMICLOADERDARWINPROPERTIES_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| include "../../../../include/lldb/Core/PropertiesBase.td" | ||
|
|
||
| let Definition = "dynamicloaderdarwin_experimental" in { | ||
| def EnableParallelImageLoad: Property<"enable-parallel-image-load", "Boolean">, | ||
| Global, | ||
| DefaultTrue, | ||
| Desc<"Load images in parallel.">; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| CXX_SOURCES := main.cpp | ||
|
|
||
| ifneq ($(OS),Darwin) | ||
| USE_LIBSTDCPP := 1 | ||
| else | ||
| USE_SYSTEM_STDLIB := 1 | ||
| endif | ||
|
|
||
| include Makefile.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3851,13 +3851,3 @@ SIRegisterInfo::getSubRegAlignmentNumBits(const TargetRegisterClass *RC, | |
| } | ||
| return 0; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -578,18 +578,3 @@ body: | | |
| SI_RETURN | ||
|
|
||
| ... | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| ; REQUIRES: asserts | ||
|
|
||
| ; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize \ | ||
| ; RUN: -force-tail-folding-style=data-with-evl \ | ||
| ; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \ | ||
| ; RUN: -mtriple=riscv64 -mattr=+v -riscv-v-vector-bits-max=128 -disable-output < %s 2>&1 | FileCheck --check-prefix=IF-EVL %s | ||
|
|
||
| define void @vp_select(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) { | ||
| ; IF-EVL: VPlan 'Final VPlan for VF={vscale x 1,vscale x 2,vscale x 4},UF={1}' { | ||
| ; IF-EVL-NEXT: Live-in vp<[[VFUF:%[0-9]+]]> = VF * UF | ||
| ; IF-EVL-NEXT: Live-in vp<[[VTC:%[0-9]+]]> = vector-trip-count | ||
| ; IF-EVL-NEXT: Live-in ir<%N> = original trip-count | ||
|
|
||
| ; IF-EVL: vector.ph: | ||
| ; IF-EVL-NEXT: Successor(s): vector loop | ||
|
|
||
| ; IF-EVL: <x1> vector loop: { | ||
| ; IF-EVL-NEXT: vector.body: | ||
| ; IF-EVL-NEXT: EMIT vp<[[IV:%[0-9]+]]> = CANONICAL-INDUCTION | ||
| ; IF-EVL-NEXT: EXPLICIT-VECTOR-LENGTH-BASED-IV-PHI vp<[[EVL_PHI:%[0-9]+]]> = phi ir<0>, vp<[[IV_NEX:%[0-9]+]]> | ||
| ; IF-EVL-NEXT: EMIT vp<[[AVL:%.+]]> = sub ir<%N>, vp<[[EVL_PHI]]> | ||
| ; IF-EVL-NEXT: EMIT vp<[[EVL:%.+]]> = EXPLICIT-VECTOR-LENGTH vp<[[AVL]]> | ||
| ; IF-EVL-NEXT: vp<[[ST:%[0-9]+]]> = SCALAR-STEPS vp<[[EVL_PHI]]>, ir<1> | ||
| ; IF-EVL-NEXT: CLONE ir<[[GEP1:%.+]]> = getelementptr inbounds ir<%b>, vp<[[ST]]> | ||
| ; IF-EVL-NEXT: vp<[[PTR1:%[0-9]+]]> = vector-pointer ir<[[GEP1]]> | ||
| ; IF-EVL-NEXT: WIDEN ir<[[LD1:%.+]]> = vp.load vp<[[PTR1]]>, vp<[[EVL]]> | ||
| ; IF-EVL-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%c>, vp<[[ST]]> | ||
| ; IF-EVL-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer ir<[[GEP2]]> | ||
| ; IF-EVL-NEXT: WIDEN ir<[[LD2:%.+]]> = vp.load vp<[[PTR2]]>, vp<[[EVL]]> | ||
| ; IF-EVL-NEXT: WIDEN ir<[[CMP:%.+]]> = icmp sgt ir<[[LD1]]>, ir<[[LD2]]> | ||
| ; IF-EVL-NEXT: WIDEN ir<[[SUB:%.+]]> = vp.sub ir<0>, ir<[[LD2]]>, vp<[[EVL]]> | ||
| ; IF-EVL-NEXT: WIDEN-INTRINSIC vp<[[SELECT:%.+]]> = call llvm.vp.select(ir<[[CMP]]>, ir<%1>, ir<%2>, vp<[[EVL]]>) | ||
| ; IF-EVL-NEXT: WIDEN ir<[[ADD:%.+]]> = vp.add vp<[[SELECT]]>, ir<[[LD1]]>, vp<[[EVL]]> | ||
| ; IF-EVL-NEXT: CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]> | ||
| ; IF-EVL-NEXT: vp<[[PTR3:%.+]]> = vector-pointer ir<[[GEP3]]> | ||
| ; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR3]]>, ir<[[ADD]]>, vp<[[EVL]]> | ||
| ; IF-EVL-NEXT: SCALAR-CAST vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64 | ||
| ; IF-EVL-NEXT: EMIT vp<[[IV_NEX]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]> | ||
| ; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%[0-9]+]]> = add vp<[[IV]]>, vp<[[VFUF]]> | ||
| ; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]> | ||
| ; IF-EVL-NEXT: No successors | ||
| ; IF-EVL-NEXT: } | ||
|
|
||
| entry: | ||
| br label %for.body | ||
|
|
||
| for.body: | ||
| %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] | ||
| %arrayidx = getelementptr inbounds i32, ptr %b, i64 %indvars.iv | ||
| %0 = load i32, ptr %arrayidx, align 4 | ||
| %arrayidx3 = getelementptr inbounds i32, ptr %c, i64 %indvars.iv | ||
| %1 = load i32, ptr %arrayidx3, align 4 | ||
| %cmp4 = icmp sgt i32 %0, %1 | ||
| %2 = sub i32 0, %1 | ||
| %cond.p = select i1 %cmp4, i32 %1, i32 %2 | ||
| %cond = add i32 %cond.p, %0 | ||
| %arrayidx15 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv | ||
| store i32 %cond, ptr %arrayidx15, align 4 | ||
| %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 | ||
| %exitcond.not = icmp eq i64 %indvars.iv.next, %N | ||
| br i1 %exitcond.not, label %exit, label %for.body | ||
|
|
||
| exit: | ||
| ret void | ||
| } |