[clang] [clang][powerpc][wasm][systemz][x86] Replace target vector popcount intrinsics with __builtin_elementwise_popcount (PR #109160)

2024-09-19 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: > Officially we don't guarantee target intrinsics at all - but I can add a > release note if it will help? hmm, I meant IBM OpenXLC compiler product doc, many builtins are listed there, not the community clang/llvm docs. https://github.com/llvm/llvm-project/pull/109160 __

[clang] [clang][powerpc][wasm][systemz][x86] Replace target vector popcount intrinsics with __builtin_elementwise_popcount (PR #109160)

2024-09-19 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: > @nemanjai Are you OK with the PPC changes? on behalf of @nemanjai : ): the change LG to PPC. FYI @lei137 @stefanp-ibm if we doc these builtins for PPC users, we may need to change the the docs. https://github.com/llvm/llvm-project/pull/109160 ___

[clang] [clang][Driver] Define soft float macros for PPC. (PR #106012)

2024-09-03 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 closed https://github.com/llvm/llvm-project/pull/106012 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Define soft float macros for PPC. (PR #106012)

2024-08-29 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM now. Thanks very much for the fix. https://github.com/llvm/llvm-project/pull/106012 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [clang][Driver] Define soft float macros for PPC. (PR #106012)

2024-08-27 Thread Chen Zheng via cfe-commits
@@ -402,9 +402,16 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__VEC__", "10206"); Builder.defineMacro("__ALTIVEC__"); } - if (HasSPE) { + if (HasSPE) Builder.defineMacro("__SPE__"); + if (HasSPE || FloatABI == SoftFlo

[clang] [clang][Driver] Define soft float macros for PPC. (PR #106012)

2024-08-26 Thread Chen Zheng via cfe-commits
@@ -439,14 +443,12 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, // FIXME: The following are not yet generated here by Clang, but are //generated by GCC: // - // _SOFT_FLOAT_ // __RECIP_PRECISION__ // __APPLE_ALTIVEC__ // __RE

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-08-07 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM. Thanks for making the fix. https://github.com/llvm/llvm-project/pull/100450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [llvm] [PPC] Implement BCD assist builtins (PR #101390)

2024-08-06 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM. Thanks for the offline discussion @lei137 https://github.com/llvm/llvm-project/pull/101390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [llvm] [PPC] Implement BCD assist builtins (PR #101390)

2024-08-04 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,58 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// REQUIRES: powerpc-registered-target +// RUN: %clang_cc1 -triple powerpc64le-unknown-linux -O2 -target-cpu pwr7 \ +// RUN: -emit-llvm %s -o - | FileCheck %s

[clang] [llvm] [PPC] Implement BCD assist builtins (PR #101390)

2024-08-04 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,75 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// REQUIRES: powerpc-registered-target +// RUN: %clang_cc1 -triple powerpc64le-unknown-linux -O2 -target-cpu pwr7 \ +// RUN: -emit-llvm %s -o - | FileCheck %s

[clang] [llvm] [PPC] Implement BCD assist builtins (PR #101390)

2024-08-04 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/101390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PPC] Implement BCD assist builtins (PR #101390)

2024-08-04 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,58 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// REQUIRES: powerpc-registered-target +// RUN: %clang_cc1 -triple powerpc64le-unknown-linux -O2 -target-cpu pwr7 \ +// RUN: -emit-llvm %s -o - | FileCheck %s

[clang] [llvm] [PPC] Implement BCD assist builtins (PR #101390)

2024-08-02 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,58 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// REQUIRES: powerpc-registered-target +// RUN: %clang_cc1 -triple powerpc64le-unknown-linux -O2 -target-cpu pwr7 \ +// RUN: -emit-llvm %s -o - | FileCheck %s

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-07-31 Thread Chen Zheng via cfe-commits
@@ -690,6 +698,19 @@ bool PPCTargetInfo::initFeatureMap( return false; } + if (llvm::is_contained(FeaturesVec, "-hard-float")) { chenzheng1030 wrote: After another look, I still think this should be done in https://github.com/llvm/llvm-project/blob/ma

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-07-31 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: We still miss many implications in `PPCTargetInfo::setFeatureEnabled()`. This patch fixes the implications for `-msoft-float`. But implications like `-mno-power8-altivec` for `-crypto` is still not handled. Let's leave them for now and make this patc

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-07-31 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/100450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AIX] Turn on `#pragma mc_func` check by default (PR #101336)

2024-07-31 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: LGTM. Please wait for @AaronBallman 's approval. Thanks https://github.com/llvm/llvm-project/pull/101336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [AIX] Turn on `#pragma mc_func` check by default (PR #101336)

2024-07-31 Thread Chen Zheng via cfe-commits
@@ -562,7 +562,7 @@ void AIX::addClangTargetOptions( CC1Args.push_back("-fno-sized-deallocation"); if (Args.hasFlag(options::OPT_ferr_pragma_mc_func_aix, - options::OPT_fno_err_pragma_mc_func_aix, false)) + options::OPT_fno_err_pragma_

[clang] [AIX] Turn on `#pragma mc_func` check by default (PR #101336)

2024-07-31 Thread Chen Zheng via cfe-commits
@@ -562,7 +562,7 @@ void AIX::addClangTargetOptions( CC1Args.push_back("-fno-sized-deallocation"); if (Args.hasFlag(options::OPT_ferr_pragma_mc_func_aix, - options::OPT_fno_err_pragma_mc_func_aix, false)) + options::OPT_fno_err_pragma_

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-07-31 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang -target powerpc64-unknown-unknown -mcpu=pwr10 -msoft-float -S -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECKSOFT +// RUN: %clang -target powerpc64-unknown-unknown -mcpu=pwr10 -S -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECKNOSOFT +

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-07-31 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: Compared with `llvm/lib/Target/PowerPC/PPC.td`, seems still miss below implicit flag: `crypto` ``` def FeatureP8Crypto : SubtargetFeature<"crypto", "HasP8Crypto", "true", "Enable POWER8 Crypto instructions",

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-07-31 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/100450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-07-31 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang -target powerpc64-unknown-unknown -mcpu=pwr10 -msoft-float -S -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECKSOFT +// RUN: %clang -target powerpc64-unknown-unknown -mcpu=pwr10 -S -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECKNOSOFT +

[clang] daf9d7f - [PowerPC] add testcaseis for PPC, NFC

2024-07-25 Thread Chen Zheng via cfe-commits
Author: Chen Zheng Date: 2024-07-25T10:13:45-04:00 New Revision: daf9d7f3881e4ffd1fd5988dc1b6223c733b6bef URL: https://github.com/llvm/llvm-project/commit/daf9d7f3881e4ffd1fd5988dc1b6223c733b6bef DIFF: https://github.com/llvm/llvm-project/commit/daf9d7f3881e4ffd1fd5988dc1b6223c733b6bef.diff LO

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 closed https://github.com/llvm/llvm-project/pull/97541 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/97541 >From 95b653b6a8f65c04eda610761e52772cb4f8ba35 Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 3 Jul 2024 04:42:25 -0400 Subject: [PATCH] [PowerPC] add TargetParser for PPC target For now only focus o

[clang] [PPC] Disable vsx and altivec when -msoft-float is used (PR #100450)

2024-07-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: ``` def FeatureFPU : SubtargetFeature<"fpu","HasFPU","true", "Enable classic FPU instructions", [FeatureHardFloat]>; def FeatureAltivec : SubtargetFeature<"altivec",

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/97541 >From 3b7cd8f6fc046ed28f9e329ba0f26156477c0a17 Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 3 Jul 2024 04:42:25 -0400 Subject: [PATCH] [PowerPC] add TargetParser for PPC target For now only focus o

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/97541 >From abe45fe2c6540534bfbd2f452240cc73b273e905 Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 3 Jul 2024 04:42:25 -0400 Subject: [PATCH] [PowerPC] add TargetParser for PPC target For now only focus o

[clang] b830790 - [NFC] changes all run lines

2024-07-22 Thread Chen Zheng via cfe-commits
Author: Chen Zheng Date: 2024-07-23T02:00:28-04:00 New Revision: b830790547c304aa2a771ce0706b337ea5ec7a02 URL: https://github.com/llvm/llvm-project/commit/b830790547c304aa2a771ce0706b337ea5ec7a02 DIFF: https://github.com/llvm/llvm-project/commit/b830790547c304aa2a771ce0706b337ea5ec7a02.diff LO

[clang] [AIX] Detect `#pragma mc_func` (PR #99888)

2024-07-22 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: ee07547487a3502f7436968bbfc243b054c14071 should be able to fix the `No available targets are compatible with triple "powerpc64-ibm-aix"` error. https://github.com/llvm/llvm-project/pull/99888 ___ cfe-commits mailing list cfe-commi

[clang] ee07547 - [NFC] make the case only require frontend

2024-07-22 Thread Chen Zheng via cfe-commits
Author: Chen Zheng Date: 2024-07-23T01:53:21-04:00 New Revision: ee07547487a3502f7436968bbfc243b054c14071 URL: https://github.com/llvm/llvm-project/commit/ee07547487a3502f7436968bbfc243b054c14071 DIFF: https://github.com/llvm/llvm-project/commit/ee07547487a3502f7436968bbfc243b054c14071.diff LO

[clang] [llvm] [PowerPC] Add support for -mcpu=pwr11 / -mtune=pwr11 (PR #99511)

2024-07-22 Thread Chen Zheng via cfe-commits
@@ -3485,9 +3485,11 @@ unsigned PPCInstrInfo::getSpillTarget() const { // With P10, we may need to spill paired vector registers or accumulator // registers. MMA implies paired vectors, so we can just check that. bool IsP10Variant = Subtarget.isISA3_1() || Subtarget.paire

[clang] [llvm] [PowerPC] Add support for -mcpu=pwr11 / -mtune=pwr11 (PR #99511)

2024-07-22 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM except one nit. Thanks very much for adding this support. https://github.com/llvm/llvm-project/pull/99511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [llvm] [PowerPC] Add support for -mcpu=pwr11 / -mtune=pwr11 (PR #99511)

2024-07-22 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/99511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-07-21 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 closed https://github.com/llvm/llvm-project/pull/92997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-18 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: ping : ) Sorry, I may commit this directly if I don't get any further comments. I have follow up patches based on this one. Thanks. https://github.com/llvm/llvm-project/pull/97541 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [llvm] [PowerPC] Add builtin_cpu_is P11 support (PR #99550)

2024-07-18 Thread Chen Zheng via cfe-commits
@@ -103,6 +105,7 @@ PPC_CPU("ppc476",SYS_CALL,44,BUILTIN_PPC_FALSE,0) PPC_CPU("power8",SYS_CALL,45,USE_SYS_CONF,AIX_PPC8_VALUE) PPC_CPU("power9",SYS_CALL,46,USE_SYS_CONF,AIX_PPC9_VALUE) PPC_CPU("power10",SYS_CALL,47,USE_SYS_CONF,AIX_PPC10_VALUE) +PPC_CPU("power11",SYS_CALL,48,U

[clang] [llvm] [PowerPC] Add builtin_cpu_is P11 support (PR #99550)

2024-07-18 Thread Chen Zheng via cfe-commits
@@ -84,6 +85,7 @@ #define AIX_PPC8_VALUE 0x0001 #define AIX_PPC9_VALUE 0x0002 #define AIX_PPC10_VALUE 0x0004 +#define AIX_PPC11_VALUE 0x0008 chenzheng1030 wrote: Where did you get this value? Is it documented somewhere? From the latest AIX 7.3

[clang] [llvm] [PowerPC] Add support for -mcpu=pwr11 / -mtune=pwr11 (PR #99511)

2024-07-18 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: We also need more tests like: 1: `llvm/test/CodeGen/PowerPC/check-cpu.ll` 2: at least one test in the backend like `llvm/test/CodeGen/PowerPC/p10-constants.ll`? https://github.com/llvm/llvm-project/pull/99511 __

[clang] [llvm] [PowerPC] Add support for -mcpu=pwr11 / -mtune=pwr11 (PR #99511)

2024-07-18 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: Basically you need to handle P11 for all the places where P10 is handled, seems you are missing below places: 1: we need handling in `LoadOpcodesForSpill` and `StoreOpcodesForSpill` for P11. Even for now P11 may already use the model of P10, we need a

[clang] [llvm] [PowerPC] Add support for -mcpu=pwr11 / -mtune=pwr11 (PR #99511)

2024-07-18 Thread Chen Zheng via cfe-commits
@@ -672,6 +685,8 @@ def : ProcessorModel<"pwr7", P7Model, ProcessorFeatures.P7Features>; def : ProcessorModel<"pwr8", P8Model, ProcessorFeatures.P8Features>; def : ProcessorModel<"pwr9", P9Model, ProcessorFeatures.P9Features>; def : ProcessorModel<"pwr10", P10Model, ProcessorF

[clang] [llvm] [PowerPC] Add support for -mcpu=pwr11 / -mtune=pwr11 (PR #99511)

2024-07-18 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/99511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AIX] Add -msave-reg-params to save arguments to stack (PR #97524)

2024-07-15 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM. Thanks for adding this support. https://github.com/llvm/llvm-project/pull/97524 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-10 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: gentle ping : ) https://github.com/llvm/llvm-project/pull/97541 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-07-07 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 closed https://github.com/llvm/llvm-project/pull/93267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-07-05 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: @efriedma-quic sorry to bother you. Do you think the new update is the correct one? Thanks very much. https://github.com/llvm/llvm-project/pull/93267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-05 Thread Chen Zheng via cfe-commits
@@ -1,52 +1,60 @@ -// RUN: echo "int main() { return __builtin_cpu_is(\"ppc970\");}" > %t.c +// RUN: echo "int main() { return __builtin_cpu_is(\"ppc970\");}" > %t.c // RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -// RUN: echo "int main(

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-05 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,120 @@ +//=== PPCTargetParser.cpp - Parser for target features --*- 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: Ap

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-05 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: Thanks for your comments @daltenty @ecnelises . Comments addressed. https://github.com/llvm/llvm-project/pull/97541 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-05 Thread Chen Zheng via cfe-commits
@@ -85,8 +85,59 @@ #define AIX_PPC9_VALUE 0x0002 #define AIX_PPC10_VALUE 0x0004 -// __builtin_cpu_is() and __builtin_cpu_supports() are supported only on Power7 and up on AIX. // PPC_CPU(Name, Linux_SUPPORT_METHOD, LinuxID, AIX_SUPPORT_METHOD, AIXID) + +// Valid CPUs

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-05 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/97541 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-05 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/97541 >From 405639a8847111e401d5c2b69bb801c1c0ccadb7 Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 3 Jul 2024 04:42:25 -0400 Subject: [PATCH 1/2] [PowerPC] add TargetParser for PPC target For now only foc

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-03 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/97541 >From 405639a8847111e401d5c2b69bb801c1c0ccadb7 Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 3 Jul 2024 04:42:25 -0400 Subject: [PATCH] [PowerPC] add TargetParser for PPC target For now only focus o

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-03 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 unassigned https://github.com/llvm/llvm-project/pull/97541 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)

2024-07-03 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 created https://github.com/llvm/llvm-project/pull/97541 For now only focus on the CPU type, will work on the CPU features part later. With the CPU handling in TargetParser, clang and llc/opt are able to query common interfaces. So we can set same default CPU a

[clang] 6a992bc - [PowerPC] refactor CPU info in PPCTargetParser.def, NFC

2024-07-02 Thread Chen Zheng via cfe-commits
Author: Chen Zheng Date: 2024-07-03T00:20:14-04:00 New Revision: 6a992bc89f5ca25d132abd044d78ecf27ae6e162 URL: https://github.com/llvm/llvm-project/commit/6a992bc89f5ca25d132abd044d78ecf27ae6e162 DIFF: https://github.com/llvm/llvm-project/commit/6a992bc89f5ca25d132abd044d78ecf27ae6e162.diff LO

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-06-28 Thread Chen Zheng via cfe-commits
@@ -5751,8 +5751,29 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, if (llvm::CallInst *Call = dyn_cast(CI)) { if (TargetDecl && TargetDecl->hasAttr()) Call->setTailCallKind(llvm::CallInst::TCK_NoTail); -else if (IsMustTail) +else if (Is

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-06-28 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/93267 >From dc1902589e601bd5673aecf58eb11b85543f0ad5 Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Thu, 23 May 2024 22:59:48 -0400 Subject: [PATCH 1/4] [PowerPC] Diagnose musttail instead of crash inside backe

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-06-23 Thread Chen Zheng via cfe-commits
@@ -743,6 +743,20 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) { CallerType.Func = CallerDecl->getType()->getAs(); } + if (Context.getTargetInfo().getTriple().isPPC()) { +if (Context.getTargetInfo().getTriple().isOSAIX()) + return Diag(St->

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-06-23 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/93267 >From 6047403b41bdeef8cd16294f0538150b8c58f6ea Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Thu, 23 May 2024 22:59:48 -0400 Subject: [PATCH 1/3] [PowerPC] Diagnose musttail instead of crash inside backe

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-06-23 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/93267 >From 6047403b41bdeef8cd16294f0538150b8c58f6ea Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Thu, 23 May 2024 22:59:48 -0400 Subject: [PATCH 1/3] [PowerPC] Diagnose musttail instead of crash inside backe

[clang] [PPC][InlineASM] Mark the 'a' constraint as unsupported (PR #96109)

2024-06-19 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM except a nit. https://github.com/llvm/llvm-project/pull/96109 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PPC][InlineASM] Mark the 'a' constraint as unsupported (PR #96109)

2024-06-19 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -emit-llvm -triple powerpc64le-unknown-unknown -verify %s chenzheng1030 wrote: nit: can you also add run lines for AIX 32 and 64 bit? https://github.com/llvm/llvm-project/pull/96109

[clang] [PPC][InlineASM] Mark the 'a' constraint as unsupported (PR #96109)

2024-06-19 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/96109 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support -mno-red-zone option (PR #94581)

2024-06-06 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. The small LIT cases seem all good. Based on that, the patch LGTM. If possible, can you run some big applications with `-mno-redzone` to double confirm the functionality? I am not so sure about its quality since the option seems not b

[clang] [PowerPC] Support -mno-red-zone option (PR #94581)

2024-06-06 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: > No. `-disable-red-zone` does nothing but add `noredzone` IR attribute to > functions. We need to add cases to test for `noredzone` behavior on PPC (arm > and x86 have). Yeah, go ahead to add some backend tests first to make sure we have good functionality for `noredzone

[clang] [PowerPC] Support -mno-red-zone option (PR #94581)

2024-06-06 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/94581 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PowerPC] Support -mno-red-zone option (PR #94581)

2024-06-06 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: Are there backend cases that shows with -disable-red-zone, the final assembly is still correct? https://github.com/llvm/llvm-project/pull/94581 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
@@ -743,6 +743,20 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) { CallerType.Func = CallerDecl->getType()->getAs(); } + if (Context.getTargetInfo().getTriple().isPPC()) { +if (Context.getTargetInfo().getTriple().isOSAIX()) + return Diag(St->

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
@@ -743,6 +743,20 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) { CallerType.Func = CallerDecl->getType()->getAs(); } + if (Context.getTargetInfo().getTriple().isPPC()) { +if (Context.getTargetInfo().getTriple().isOSAIX()) + return Diag(St->

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 deleted https://github.com/llvm/llvm-project/pull/93267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
@@ -743,6 +743,20 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) { CallerType.Func = CallerDecl->getType()->getAs(); } + if (Context.getTargetInfo().getTriple().isPPC()) { +if (Context.getTargetInfo().getTriple().isOSAIX()) + return Diag(St->

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: PPC buildbot fails at another place with above fix: https://lab.llvm.org/buildbot/#/builders/230/builds/29066 Commit 2b1d1c51f6e321267cc86e9db7808298c59caf0e to fix the failure. https://github.com/llvm/llvm-project/pull/81545 ___

[clang] 2b1d1c5 - [NFC] Fix PPC buildbot failure https://lab.llvm.org/buildbot/#/builders/230/builds/29066

2024-05-29 Thread Chen Zheng via cfe-commits
Author: Chen Zheng Date: 2024-05-29T21:52:55-04:00 New Revision: 2b1d1c51f6e321267cc86e9db7808298c59caf0e URL: https://github.com/llvm/llvm-project/commit/2b1d1c51f6e321267cc86e9db7808298c59caf0e DIFF: https://github.com/llvm/llvm-project/commit/2b1d1c51f6e321267cc86e9db7808298c59caf0e.diff LO

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
chenzheng1030 wrote: Patch updated... https://github.com/llvm/llvm-project/pull/93267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/93267 >From 17505893b2b48969512e3c2e8433a6446429f65e Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Thu, 23 May 2024 22:59:48 -0400 Subject: [PATCH 1/2] [PowerPC] Diagnose musttail instead of crash inside backe

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-29 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/93267 >From 17505893b2b48969512e3c2e8433a6446429f65e Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Thu, 23 May 2024 22:59:48 -0400 Subject: [PATCH 1/2] [PowerPC] Diagnose musttail instead of crash inside backe

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/92997 >From 7c1e44455a343cef3c5ab0da22c9971888cf Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 22 May 2024 02:37:04 -0400 Subject: [PATCH 1/3] [PowerPC] Support -fpatchable-function-entry For now only

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,49 @@ +; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32 +; RUN: llc -mtriple=powerpc64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=CHECK,PPC64 + +define void @f0() { +; CHECK-LABEL: f0: +; CHECK-NOT: nop

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -6,15 +6,20 @@ // RUN: %clang -target loongarch64 %s -fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s // RUN: %clang -target riscv32 %s -fpatchable-function-entry=1,0 -c -### 2>&1 | FileCheck %s // RUN: %clang -target riscv64 %s -fpatchable-function-entry=1,0 -c

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify %s + +// expected-error@+1 {{'patchable_function_entry' attribute is not yet supported on AIX}} +__attribute__((patchable_function_entry(0))) void f(); chenzheng1030 wrote:

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/92997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -6681,7 +6681,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, StringRef S0 = A->getValue(), S = S0; unsigned Size, Offset = 0; if (!Triple.isAArch64() && !Triple.isLoongArch() && !Triple.isRISCV() && -!Triple.isX86()) +!Triple.

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,49 @@ +; RUN: llc -mtriple=powerpc-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=CHECK,PPC32 chenzheng1030 wrote: Thank you, changed the triple. Little endian is not going to be supported in this patch. https://github.com/llvm/llvm-proje

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 commented: > So PPC64 can use ELFv2 for Triple::OpenBSD. We probably want to diagnose this > OS for PPC64, since with ELFv2 we might emit separate local and global entry > points which means only certain values can be passed to > -fpatchable-function-entry opti

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/92997 >From 751d80c61f0e42daa3796a8270e186153dd9413f Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 22 May 2024 02:37:04 -0400 Subject: [PATCH 1/3] [PowerPC] Support -fpatchable-function-entry For now only

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-24 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/93267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-23 Thread Chen Zheng via cfe-commits
@@ -3833,6 +3833,11 @@ def note_cannot_use_trivial_abi_reason : Note< "it is polymorphic|" "it has a base of a non-trivial class type|it has a virtual base|" "it has a __weak field|it has a field of a non-trivial class type}1">; +def warn_ppc_musttail_maybe_ignored: Warni

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-05-23 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 created https://github.com/llvm/llvm-project/pull/93267 musttail does not often possible to be generated on PPC targets as when calling to a function defined in another module, PPC needs to restore the TOC pointer. To restore the TOC pointer, compiler needs to

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 updated https://github.com/llvm/llvm-project/pull/92997 >From 751d80c61f0e42daa3796a8270e186153dd9413f Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Wed, 22 May 2024 02:37:04 -0400 Subject: [PATCH 1/2] [PowerPC] Support -fpatchable-function-entry For now only

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-22 Thread Chen Zheng via cfe-commits
@@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -fsyntax-only -verify %s + +// expected-error@+1 {{'patchable_function_entry' attribute is not yet supported on AIX}} +__attribute__((patchable_function_entry(0))) void f(); chenzheng1030 wrote:

[clang] [llvm] [PowerPC] Support -fpatchable-function-entry (PR #92997)

2024-05-21 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 created https://github.com/llvm/llvm-project/pull/92997 For now only PPC big endian Linux 32 and 64 bit are supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes #63220 Fixes #57031

[clang] [llvm] [PowerPC][AIX] 64-bit large code-model support for toc-data (PR #90619)

2024-05-15 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/90619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC][AIX] 64-bit large code-model support for toc-data (PR #90619)

2024-05-15 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/90619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [PowerPC][AIX] 64-bit large code-model support for toc-data (PR #90619)

2024-05-15 Thread Chen Zheng via cfe-commits
@@ -479,14 +479,6 @@ static void addTocDataOptions(const llvm::opt::ArgList &Args, return false; }(); - // Currently only supported for small code model. - if (TOCDataGloballyinEffect && - (Args.getLastArgValue(options::OPT_mcmodel_EQ).equals("large") || -

[clang] [llvm] [PowerPC][AIX] 64-bit large code-model support for toc-data (PR #90619)

2024-05-15 Thread Chen Zheng via cfe-commits
@@ -6167,16 +6166,12 @@ void PPCDAGToDAGISel::Select(SDNode *N) { SDNode *Tmp = CurDAG->getMachineNode( isPPC64 ? PPC::ADDIStocHA8 : PPC::ADDIStocHA, dl, VT, TOCbase, GA); -// On AIX if the symbol has the toc-data attribute it will be defined -// in the TOC

[clang] [llvm] [PowerPC][AIX] 64-bit large code-model support for toc-data (PR #90619)

2024-05-15 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 approved this pull request. LGTM just some nits. I don't think it needs another review for them from my side. Please commit when @diggerlin is also happy. Thanks very much for adding this support. https://github.com/llvm/llvm-project/pull/90619 ___

[clang] [llvm] [PowerPC][AIX] 64-bit large code-model support for toc-data (PR #90619)

2024-05-15 Thread Chen Zheng via cfe-commits
@@ -1292,8 +1291,9 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) { unsigned Op = MI->getOpcode(); -// Change the opcode to load address for tocdata -TmpInst.setOpcode(Op == PPC::ADDItocL8 ? PPC::ADDI8 : PPC::LA); +// Change the opcode to load

[clang] [llvm] [PowerPC][AIX] 64-bit large code-model support for toc-data (PR #90619)

2024-05-15 Thread Chen Zheng via cfe-commits
https://github.com/chenzheng1030 edited https://github.com/llvm/llvm-project/pull/90619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   >