[PATCH] D59603: [PR40707][PR41011][OpenCL] Allow addr space spelling without double underscore in C++ mode

2019-03-26 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Looks like this may cause some unexpected failures. See 
https://bugs.llvm.org/show_bug.cgi?id=41247 for more details.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59603/new/

https://reviews.llvm.org/D59603



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D59924: [PowerPC][Clang] Port MMX intrinsics and basic test cases to Power

2019-04-08 Thread Jinsong Ji via Phabricator via cfe-commits
jsji requested changes to this revision.
jsji added a comment.
This revision now requires changes to proceed.

Since we are adding new headers that is not originated by this patch, 
please also update the description (and commit message) to include who actually 
contributed to `mmintrin.h` and other headers.
eg:headers are mostly based on headers developed by Steven Munroe, with some 
contribution of Paul Clarke, Bill Schmidt,  Jinsong, Zeson.




Comment at: clang/lib/Driver/ToolChains/PPCLinux.cpp:22
+  if (getArch() != llvm::Triple::ppc &&
+  !DriverArgs.hasArg(clang::driver::options::OPT_nostdinc) &&
+  !DriverArgs.hasArg(options::OPT_nobuiltininc)) {

Why we want to exclude these includes when `nostdinc` is on? These include 
files are NOT standard include files.



Comment at: clang/lib/Driver/ToolChains/PPCLinux.h:30
+} // end namespace toolchains
+} // namespace driver
+} // namespace clang

missing `end` in comment?



Comment at: clang/test/CodeGen/ppc-mmintrin.c:24
+// CHECK: [[REG1:[0-9a-zA-Z_%.]+]] = call <8 x i16> @vec_cmplt
+// CHECK: store <8 x i16> [[REG1]], <8 x i16>* [[REG2:[0-9a-zA-Z_%.]+]], align 
16
+// CHECK: [[REG3:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_packs

We should use `CHECK-NEXT` instead of `CHECK` here. This also apply to most of 
the following `CHECK`.



Comment at: clang/test/CodeGen/ppc-mmintrin.c:25
+// CHECK: store <8 x i16> [[REG1]], <8 x i16>* [[REG2:[0-9a-zA-Z_%.]+]], align 
16
+// CHECK: [[REG3:[0-9a-zA-Z_%.]+]] = call <16 x i8> @vec_packs
+// CHECK: store <16 x i8> [[REG3]], <16 x i8>* [[REG4:[0-9a-zA-Z_%.]+]], align 
16

Why we omit checking two `load` for `vec_packs` here?



Comment at: clang/test/CodeGen/ppc-mmintrin.c:36
+// CHECK: i64 @_mm_packs_pi16(i64 {{[0-9a-zA-Z_%.]+}}, i64 {{[0-9a-zA-Z_%.]+}})
+// CHECK: call <16 x i8> @vec_packs(short vector[8], short vector[8])
+

We should also check the `load` and make sure that the endian-specific code are 
working.



Comment at: clang/test/Headers/ppc-intrinsics.c:3
+
+// RUN: %clang -S -emit-llvm -DNO_WARN_X86_INTRINSICS -DTEST_MACRO -target 
powerpc64-gnu-linux %s -Xclang -verify -o - | FileCheck %s
+// RUN: %clang -S -emit-llvm -DNO_WARN_X86_INTRINSICS -target 
powerpc64-gnu-linux %s -Xclang -verify -x c++ -o - | FileCheck %s

Why `-DTEST_MACRO`?



Comment at: clang/test/Headers/ppc-intrinsics.c:7
+
+// RUN: NOT %clang -S -emit-llvm -target powerpc64-gnu-linux %s -o /dev/null 
2>&1 | FileCheck %s -check-prefix=CHECK-ERROR
+

NOT? 
` NOT: command not found ^`


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59924/new/

https://reviews.llvm.org/D59924



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D59924: [PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power

2019-04-09 Thread Jinsong Ji via Phabricator via cfe-commits
jsji requested changes to this revision.
jsji added a comment.
This revision now requires changes to proceed.

Please make sure you run all test before updating patch!




Comment at: clang/test/CodeGen/ppc-mmintrin.c:23
+// CHECK: i64 @_mm_packs_pu16(i64 [[REG1:[0-9a-zA-Z_%.]+]], i64 
[[REG2:[0-9a-zA-Z_%.]+]])
+// CHECK: store i64 [[REG1]], i64* [[REG3:[0-9a-zA-Z_%.]+]], align 8
+// CHECK-NEXT: store i64 [[REG2]], i64* [[REG4:[0-9a-zA-Z_%.]+]], align 8

.../clang/test/CodeGen/ppc-mmintrin.c:23:11: error: CHECK: expected string not 
found in input
// CHECK: store i64 [[REG1]], i64* [[REG3:[0-9a-zA-Z_%.]+]], align 8


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59924/new/

https://reviews.llvm.org/D59924



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D59924: [PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power

2019-04-15 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks for porting!


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59924/new/

https://reviews.llvm.org/D59924



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D59924: [PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power

2019-04-23 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D59924#1475363 , @MaskRay wrote:

> May I ask why the mmintrin.h emulation layer must be added to the clang 
> resource directory? Why can't it be provided as a standalone library like 
> https://github.com/intel/ARM_NEON_2_x86_SSE ?


The intention is to lower the porting effort for users,  so that user don't 
need to modify their source or add their own additional headers wrapper layer.

> Will you add SSE/AVX/AVX512 emulation layer to the clang resource directory 
> as follow-ups?

Yes, more headers (eg: `xmmintrin.h`,  `emmintrin.h`) will follow.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59924/new/

https://reviews.llvm.org/D59924



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D59924: [PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power

2019-04-23 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Thanks @MaskRay for help fixing and review!




Comment at: lib/Headers/ppc_wrappers/mmintrin.h:3
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal

MaskRay wrote:
> This is not Apache 2.
Ah.. This was aligned with other headers .. but forgot to update to Apache 2.

@qiucf Please update it to Apache 2 as well. Thanks.



Comment at: lib/Headers/ppc_wrappers/mmintrin.h:24
+
+/* Implemented from the specification included in the Intel C++ Compiler
+   User Guide and Reference, version 9.0.  */

MaskRay wrote:
> Is this considered a derivative work of the Intel C++ Compiler?
My understanding is that the `User Guide and Reference ` is the `specification` 
, implementation based on public specification should NOT be considered as 
`derivative` work. 

Otherwise, all codes that referenced `User Guide and Reference ` need to be 
considered derivative work?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59924/new/

https://reviews.llvm.org/D59924



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D59924: [PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power

2019-04-30 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: lib/Headers/ppc_wrappers/mmintrin.h:3
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to 
deal

jsji wrote:
> MaskRay wrote:
> > This is not Apache 2.
> Ah.. This was aligned with other headers .. but forgot to update to Apache 2.
> 
> @qiucf Please update it to Apache 2 as well. Thanks.
Updated to Apache 2 in https://reviews.llvm.org/rC359164


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59924/new/

https://reviews.llvm.org/D59924



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62121: [PowerPC] [Clang] Port SSE intrinsics to PowerPC

2019-05-30 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks for fixing.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62121/new/

https://reviews.llvm.org/D62121



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[Diffusion] rL358949: [PowerPC] [Clang] Port MMX intrinsics and basic test cases to Power

2019-06-04 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.

/cfe/trunk/lib/Driver/ToolChains/PPCLinux.cpp:26 yes, it is currently Linux 
only. I think we can extend it to include other OS like AIX later if needed. 

https://reviews.llvm.org/rL358949



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62569: [PowerPC] [Clang] Port SSE2 intrinsics to PowerPC

2019-06-07 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks for porting.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62569/new/

https://reviews.llvm.org/D62569



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64849: Add platform guards to PPC vector intrinsics headers.

2019-07-29 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64849/new/

https://reviews.llvm.org/D64849



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D65630: [PowerPC] Port SSE3, SSSE3 and SSE4 intrinsics to PowerPC.

2019-08-08 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65630/new/

https://reviews.llvm.org/D65630



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D63636: [PowerPC][Altivec] Fix offsets for vec_xl and vec_xst

2019-06-21 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

A few questions.




Comment at: lib/Headers/altivec.h:16364
   signed short *__ptr) {
-  return *(unaligned_vec_sshort *)(__ptr + __offset);
+  signed char *Adjusted = (signed char *)__ptr + __offset;
+  return *(unaligned_vec_sshort *)((signed short *)Adjusted);

Why we name it `Adjusted`?  Why not just `__addr`? 



Comment at: lib/Headers/altivec.h:16365
+  signed char *Adjusted = (signed char *)__ptr + __offset;
+  return *(unaligned_vec_sshort *)((signed short *)Adjusted);
 }

Why we want to cast it to `(signed short *)` again? Looks like unnecessary 
casting to me?



Comment at: test/CodeGen/builtins-ppc-xl-xst.c:4
+// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx -triple 
powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx 
-target-feature +power8-vector -triple powerpc64le-unknown-unknown -emit-llvm 
%s -o - | FileCheck %s -check-prefix=CHECK-P8
+#include 

Any difference for results without `power8-vector `, except for `test9` and 
`test10`?

Why not split `test9` and `test10` to another file for simplicity?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63636/new/

https://reviews.llvm.org/D63636



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D63636: [PowerPC][Altivec] Fix offsets for vec_xl and vec_xst

2019-06-22 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks for fixing.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63636/new/

https://reviews.llvm.org/D63636



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64024: [PowerPC][Altivec] Emit correct builtin for single precision vec_all_ne

2019-07-01 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. 
BTW, looks like we are missing test cases all `vector float` `vec_all*` and 
`vec_any*` and also non-vsx path?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64024/new/

https://reviews.llvm.org/D64024



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64119: [PowerPC] Support constraint code "ww"

2019-07-03 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

It is great to add `ww` for compatibility. 
However if we are going to add `ww`, looks like we should update `ws` as well?




Comment at: clang/lib/Basic/Targets/PPC.h:211
+  case 's': // VSX vector register to hold scalar double data
+  case 'w': // VSX vector register to hold scalar double data
   case 'a': // Any VSX register

Add some more comments for `w` to distinguish it from `s`?

Do we want to keep compatibility with GCC? 
According to 
https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/Machine-Constraints.html#Machine-Constraints,
 
`ww` is `FP or VSX register to perform float operations under -mvsx or 
NO_REGS.`, 
while `ws` is `VSX vector register to hold scalar double values `. 

So `ww` can use `FP` while `ws` can NOT ?



Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:14080
 return std::make_pair(0U, &PPC::VSRCRegClass);
-  } else if (Constraint == "ws" && Subtarget.hasVSX()) {
+  } else if ((Constraint == "ws" || Constraint == "ww") && Subtarget.hasVSX()) 
{
 if (VT == MVT::f32 && Subtarget.hasP8Vector())

Should we exclude `FP` for `ws` and return `VFRCRegClass` instead of 
`VSFRCRegClass` ?



Comment at: llvm/test/CodeGen/PowerPC/inlineasm-vsx-reg.ll:42
+
+define float @test_ww(float %x, float %y) {
+  %1 = tail call float asm "xsmaxdp ${0:x}, ${1:x}, ${2:x}", 
"=^ww,^ww,^ww"(float %x, float %y)

Maybe we should add another test for ws as well? The above test is actually for 
'x' modifier?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64119/new/

https://reviews.llvm.org/D64119



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64119: [PowerPC] Support constraint code "ww"

2019-07-03 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks for investigating GCC behavior.




Comment at: clang/lib/Basic/Targets/PPC.h:211
+  case 's': // VSX vector register to hold scalar double data
+  case 'w': // VSX vector register to hold scalar double data
   case 'a': // Any VSX register

MaskRay wrote:
> jsji wrote:
> > Add some more comments for `w` to distinguish it from `s`?
> > 
> > Do we want to keep compatibility with GCC? 
> > According to 
> > https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/Machine-Constraints.html#Machine-Constraints,
> >  
> > `ww` is `FP or VSX register to perform float operations under -mvsx or 
> > NO_REGS.`, 
> > while `ws` is `VSX vector register to hold scalar double values `. 
> > 
> > So `ww` can use `FP` while `ws` can NOT ?
> I played with "ws" and "ww" but can't find any behavior difference from 
> assembly produced by powerpc64le-linux-gnu-gcc. I'll keep the current form 
> (which is known to make musl fmax/fmaxf build) unless the gcc semantics are 
> clearer.
OK. Thanks. So maybe it is just the misleading doc problem of GCC.



Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:14080
 return std::make_pair(0U, &PPC::VSRCRegClass);
-  } else if (Constraint == "ws" && Subtarget.hasVSX()) {
+  } else if ((Constraint == "ws" || Constraint == "ww") && Subtarget.hasVSX()) 
{
 if (VT == MVT::f32 && Subtarget.hasP8Vector())

MaskRay wrote:
> jsji wrote:
> > Should we exclude `FP` for `ws` and return `VFRCRegClass` instead of 
> > `VSFRCRegClass` ?
> Can you elaborate on what I should do? I'm not familiar with the register 
> info stuff...
`VSFRC` contains both `F8RC` and `VFRC`. `F8RC` is FP.
So if `ws` can NOT use FP, then we should not use `VSFRC`.

However, if `ws` can use `FP` as well as you found in later GCC experiments, 
then we don't need to do this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64119/new/

https://reviews.llvm.org/D64119



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62121: [PowerPC] [Clang] Port SSE intrinsics to PowerPC

2019-05-20 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added subscribers: MaskRay, rjmccall, aaron.ballman, rnk, jyknight.
jsji added a comment.

Add more subscribers, reviews and comments are welcome and appreciated. Thanks.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62121/new/

https://reviews.llvm.org/D62121



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62121: [PowerPC] [Clang] Port SSE intrinsics to PowerPC

2019-05-28 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks for porting.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62121/new/

https://reviews.llvm.org/D62121



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62121: [PowerPC] [Clang] Port SSE intrinsics to PowerPC

2019-05-29 Thread Jinsong Ji via Phabricator via cfe-commits
jsji reopened this revision.
jsji added a comment.
This revision is now accepted and ready to land.

This has been reverted in https://reviews.llvm.org/rL361930 .


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62121/new/

https://reviews.llvm.org/D62121



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D62121: [PowerPC] [Clang] Port SSE intrinsics to PowerPC

2019-05-29 Thread Jinsong Ji via Phabricator via cfe-commits
jsji requested changes to this revision.
jsji added a comment.
This revision now requires changes to proceed.

   TEST 'Clang :: CodeGen/ppc-mm-malloc.c' FAILED 

  Script:
  --
  : 'RUN: at line 9';   
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/build/stage1/bin/clang -S 
-emit-llvm 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/CodeGen/ppc-mm-malloc.c
 -fno-discard-value-names -mllvm -disable-llvm-optzns -o - | llvm-cxxfilt | 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/build/stage1/bin/FileCheck 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/CodeGen/ppc-mm-malloc.c
  --
  Exit Code: 1
  
  Command Output (stderr):
  --
  
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/CodeGen/ppc-mm-malloc.c:21:11:
 error: CHECK: expected string not found in input
  // CHECK: define internal i8* @_mm_malloc(i64 [[REG1:[0-9a-zA-Z_%.]+]], i64 
[[REG2:[0-9a-zA-Z_%.]+]])
^
  :7:38: note: scanning from here
  define dso_local void @test_mm_malloc() #0 {
   ^
  :18:1: note: possible intended match here
  define internal noalias i8* @_mm_malloc(i64 %__size, i64 %__align) #1 {
  ^
  
  --
  
  
  Testing: 0 .. 10..
  FAIL: Clang :: Headers/ppc-sse-intrinsics.c (9324 of 48401)
   TEST 'Clang :: Headers/ppc-sse-intrinsics.c' FAILED 

  Script:
  --
  : 'RUN: at line 10';   
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/build/stage1/bin/clang -S 
-emit-llvm -DNO_WARN_X86_INTRINSICS 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/Headers/ppc-sse-intrinsics.c
 -mcpu=pwr7 -Xclang -verify
  : 'RUN: at line 11';   
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/build/stage1/bin/clang -S 
-emit-llvm -DNO_WARN_X86_INTRINSICS 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/Headers/ppc-sse-intrinsics.c
 -mcpu=pwr7 -Xclang -verify -x c++
  : 'RUN: at line 14';   not 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/build/stage1/bin/clang -S 
-emit-llvm 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/Headers/ppc-sse-intrinsics.c
 -mcpu=pwr7 -o /dev/null 2>&1 | 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/build/stage1/bin/FileCheck 
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/Headers/ppc-sse-intrinsics.c
 -check-prefix=SSE-ERROR
  --
  Exit Code: 1
  
  Command Output (stderr):
  --
  clang-9: warning: argument unused during compilation: '-mcpu=pwr7' 
[-Wunused-command-line-argument]
  clang-9: warning: argument unused during compilation: '-mcpu=pwr7' 
[-Wunused-command-line-argument]
  
/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/Headers/ppc-sse-intrinsics.c:20:15:
 error: SSE-ERROR: expected string not found in input
  // SSE-ERROR: xmmintrin.h:{{[0-9]+}}:{{[0-9]+}}: error: "Please read comment 
above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
^
  :1:1: note: scanning from here
  clang-9: warning: argument unused during compilation: '-mcpu=pwr7' 
[-Wunused-command-line-argument]
  ^


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62121/new/

https://reviews.llvm.org/D62121



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D83915: [PowerPC] Remove QPX/A2Q BGQ/BGP support

2020-07-16 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D83915#2155650 , 
@hubert.reinterpretcast wrote:

> Should we indicate planned removal in the Release Notes for version 11 and 
> actual removal in those for version 12?


Good suggestion. https://reviews.llvm.org/D83968 for adding the section in 
master, will add conent in v11 branch if approved.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83915/new/

https://reviews.llvm.org/D83915



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D83915: [PowerPC] Remove QPX/A2Q BGQ/BGP support

2020-07-17 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D83915#2156346 , @jsji wrote:

> In D83915#2155650 , 
> @hubert.reinterpretcast wrote:
>
> > Should we indicate planned removal in the Release Notes for version 11 and 
> > actual removal in those for version 12?
>
>
> Good suggestion. https://reviews.llvm.org/D83968 for adding the section in 
> master, will add conent in v11 branch if approved.


Notes added to ReleaseNotes in release/11.x in 
https://reviews.llvm.org/rG297be788a797c0ab98d9677f50e3dc57faab363b


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83915/new/

https://reviews.llvm.org/D83915



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D83915: [PowerPC] Remove QPX/A2Q BGQ/BGP support

2020-07-23 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Ping ... Any other comments? Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83915/new/

https://reviews.llvm.org/D83915



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78308: [NFC][PowerPC] Refactor ppcUserFeaturesCheck()

2020-04-16 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: clang/lib/Basic/Targets/PPC.cpp:243
+  bool Passed = CheckVSXSubfeature("+power8-vector", "-mpower8-vector");
+  Passed |= CheckVSXSubfeature("+direct-move", "-mdirect-move");
+  Passed |= CheckVSXSubfeature("+float128", "-mfloat128");

Looks like this is will cause behavior change.. And NOT NFC at all..

Before refactor, we will return false when *ANY* of the subfeature is ON.
After refactor, we will only return false, when *ALL* of the subfeature are ON, 
Passed will be set to true when any of subfeature are off .

Can you please double check?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78308/new/

https://reviews.llvm.org/D78308



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78308: [NFC][PowerPC] Refactor ppcUserFeaturesCheck()

2020-04-17 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.

LGTM. Since there is an improvement for multi errors, we should remove `[NFC]` 
in title and commit messages. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78308/new/

https://reviews.llvm.org/D78308



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79014: [clangd] Move non-clang base pieces into separate support/ lib.

2020-04-29 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.
Herald added a subscriber: wuzish.

Looks like this is causing buildbot failure when built with 
`-DBUILD_SHARED_LIBS=ON`.
http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/3077/steps/build%20stage%201/logs/stdio

  FAILED: lib/libclangDaemon.so.11git 
  : && /home/buildbots/clang.9.0.0/bin/clang++ -... && :
  
tools/clang/tools/extra/clangd/CMakeFiles/obj.clangDaemon.dir/CodeComplete.cpp.o:(.toc+0x120):
 undefined reference to `pthread_create'
  clang++: error: linker command failed with exit code 1 (use -v to see 
invocation)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79014/new/

https://reviews.llvm.org/D79014



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79014: [clangd] Move non-clang base pieces into separate support/ lib.

2020-04-29 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Thanks all, yes, it is passing now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79014/new/

https://reviews.llvm.org/D79014



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79653: [sanitizer] Enable whitelist/blacklist in new PM

2020-05-08 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added reviewers: tuktuk, vitalybuka, morehouse, kcc.
Herald added subscribers: llvm-commits, Sanitizers, cfe-commits, hiraditya.
Herald added projects: clang, Sanitizers, LLVM.

https://reviews.llvm.org/D63616 added `-fsanitize-coverage-whitelist`
and `-fsanitize-coverage-blacklist` for clang.

However, it was done only for legacy pass manager.
This patch enable it for new pass manager as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79653

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
  llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
  llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp


Index: llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
===
--- llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -322,7 +322,8 @@
 
 PreservedAnalyses ModuleSanitizerCoveragePass::run(Module &M,
ModuleAnalysisManager &MAM) 
{
-  ModuleSanitizerCoverage ModuleSancov(Options);
+  ModuleSanitizerCoverage ModuleSancov(Options, Whitelist.get(),
+   Blacklist.get());
   auto &FAM = 
MAM.getResult(M).getManager();
   auto DTCallback = [&FAM](Function &F) -> const DominatorTree * {
 return &FAM.getResult(F);
Index: llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
===
--- llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
+++ llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
@@ -18,6 +18,7 @@
 
 #include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/SpecialCaseList.h"
 #include "llvm/Transforms/Instrumentation.h"
 
 namespace llvm {
@@ -30,12 +31,26 @@
 : public PassInfoMixin {
 public:
   explicit ModuleSanitizerCoveragePass(
-  SanitizerCoverageOptions Options = SanitizerCoverageOptions())
-  : Options(Options) {}
+  SanitizerCoverageOptions Options = SanitizerCoverageOptions(),
+  const std::vector &WhitelistFiles =
+  std::vector(),
+  const std::vector &BlacklistFiles =
+  std::vector())
+  : Options(Options) {
+if (WhitelistFiles.size() > 0)
+  Whitelist = SpecialCaseList::createOrDie(WhitelistFiles,
+   *vfs::getRealFileSystem());
+if (BlacklistFiles.size() > 0)
+  Blacklist = SpecialCaseList::createOrDie(BlacklistFiles,
+   *vfs::getRealFileSystem());
+  }
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 
 private:
   SanitizerCoverageOptions Options;
+
+  std::unique_ptr Whitelist;
+  std::unique_ptr Blacklist;
 };
 
 // Insert SanitizerCoverage instrumentation.
Index: 
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
===
--- 
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
+++ 
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
@@ -51,6 +51,13 @@
 // RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fsanitize-coverage-whitelist=wl_foo.txt  
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
 // RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fsanitize-coverage-whitelist=wl_bar.txt  
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
 
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager   
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager -fsanitize-coverage-whitelist=wl_all.txt  
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager -fsanitize-coverage-whitelist=wl_none.txt 
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager -fsanitize-coverage-whitelist=wl_file.txt 
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inl

[PATCH] D79653: [sanitizer] Enable whitelist/blacklist in new PM

2020-05-09 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa72b9dfd45cd: [sanitizer] Enable whitelist/blacklist in new 
PM (authored by jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79653/new/

https://reviews.llvm.org/D79653

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
  llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
  llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp


Index: llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
===
--- llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -322,7 +322,8 @@
 
 PreservedAnalyses ModuleSanitizerCoveragePass::run(Module &M,
ModuleAnalysisManager &MAM) 
{
-  ModuleSanitizerCoverage ModuleSancov(Options);
+  ModuleSanitizerCoverage ModuleSancov(Options, Whitelist.get(),
+   Blacklist.get());
   auto &FAM = 
MAM.getResult(M).getManager();
   auto DTCallback = [&FAM](Function &F) -> const DominatorTree * {
 return &FAM.getResult(F);
Index: llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
===
--- llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
+++ llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
@@ -18,6 +18,7 @@
 
 #include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/SpecialCaseList.h"
 #include "llvm/Transforms/Instrumentation.h"
 
 namespace llvm {
@@ -30,12 +31,26 @@
 : public PassInfoMixin {
 public:
   explicit ModuleSanitizerCoveragePass(
-  SanitizerCoverageOptions Options = SanitizerCoverageOptions())
-  : Options(Options) {}
+  SanitizerCoverageOptions Options = SanitizerCoverageOptions(),
+  const std::vector &WhitelistFiles =
+  std::vector(),
+  const std::vector &BlacklistFiles =
+  std::vector())
+  : Options(Options) {
+if (WhitelistFiles.size() > 0)
+  Whitelist = SpecialCaseList::createOrDie(WhitelistFiles,
+   *vfs::getRealFileSystem());
+if (BlacklistFiles.size() > 0)
+  Blacklist = SpecialCaseList::createOrDie(BlacklistFiles,
+   *vfs::getRealFileSystem());
+  }
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 
 private:
   SanitizerCoverageOptions Options;
+
+  std::unique_ptr Whitelist;
+  std::unique_ptr Blacklist;
 };
 
 // Insert SanitizerCoverage instrumentation.
Index: 
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
===
--- 
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
+++ 
compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
@@ -51,6 +51,13 @@
 // RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fsanitize-coverage-whitelist=wl_foo.txt  
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
 // RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fsanitize-coverage-whitelist=wl_bar.txt  
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
 
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager   
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager -fsanitize-coverage-whitelist=wl_all.txt  
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager -fsanitize-coverage-whitelist=wl_none.txt 
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager -fsanitize-coverage-whitelist=wl_file.txt 
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f patterns.txt
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm 
-fsanitize-coverage=inline-8bit-counters,indirect-calls,trace-cmp,pc-table 
-fexperimental-new-pass-manager -fsanitize-coverage-whitelist=wl_foo.txt  
-fsanitize-coverage-blacklist=bl_all.txt   2>&1 | not grep -f

[PATCH] D77249: [MSan] Pass command line options to MSan with new pass manager

2020-05-11 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.
Herald added a subscriber: wuzish.

NOTE that https://reviews.llvm.org/D79445 has committed a similar fix and fixed 
most of the failures.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77249/new/

https://reviews.llvm.org/D77249



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D122377: [PowerPC][Linux] Support 16-byte lock free atomics on pwr8 and up

2022-03-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: clang/test/CodeGen/PowerPC/atomic-alignment.c:7
+// RUN:   -emit-llvm -o - %s | FileCheck %s --check-prefixes=PPC,PPC64-PWR8
 // RUN: %clang_cc1 -verify -triple powerpc64-unknown-aix -emit-llvm -o - %s | \
 // RUN:   FileCheck %s --check-prefixes=PPC,PPC64

How about AIX pwr8?



Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:126
 "ppc-quadword-atomics",
-cl::desc("enable quadword lock-free atomic operations"), cl::init(false),
+cl::desc("enable quadword lock-free atomic operations"), cl::init(true),
 cl::Hidden);

So we enable it by default , *EVEN* on AIX?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122377/new/

https://reviews.llvm.org/D122377

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D106344: [PowerPC] Implement XL compatible behavior of __compare_and_swap

2021-07-21 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Doesn't look like good enough to me,  the code sequence generated is not clean 
enough.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106344/new/

https://reviews.llvm.org/D106344

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D106344: [PowerPC] Implement XL compatible behavior of __compare_and_swap

2021-07-22 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision as: jsji.
jsji added a comment.
This revision is now accepted and ready to land.

> that looks like a historical issue which exists for 13yrs

Hmm... OK.. Let us leave it as it is for now.

Thanks for the new tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106344/new/

https://reviews.llvm.org/D106344

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D105527: libclang.so: Make SONAME independent from LLVM version

2021-07-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: clang/tools/libclang/CMakeLists.txt:79
+  set(LLVM_EXPORTED_SYMBOL_FILE)
+  set(USE_VERSION_SCRIPT TRUE)
+endif()

I think we should check LLVM_HAVE_LINK_VERSION_SCRIPT here, there are platforms 
that does NOT support VERSION_SCRIPT.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105527/new/

https://reviews.llvm.org/D105527

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D106914: [libclang] Check LLVM_HAVE_LINK_VERSION_SCRIPT

2021-07-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added reviewers: PowerPC, tstellar, MaskRay, hubert.reinterpretcast.
Herald added a subscriber: mgorny.
jsji requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

There are some platform that might not have version script support,
don't try to use version script on those.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106914

Files:
  clang/tools/libclang/CMakeLists.txt


Index: clang/tools/libclang/CMakeLists.txt
===
--- clang/tools/libclang/CMakeLists.txt
+++ clang/tools/libclang/CMakeLists.txt
@@ -76,7 +76,7 @@
 
 if (UNIX AND NOT APPLE)
   set(LLVM_EXPORTED_SYMBOL_FILE)
-  set(USE_VERSION_SCRIPT TRUE)
+  set(USE_VERSION_SCRIPT ${LLVM_HAVE_LINK_VERSION_SCRIPT})
 endif()
 
 if (LLVM_EXPORTED_SYMBOL_FILE)


Index: clang/tools/libclang/CMakeLists.txt
===
--- clang/tools/libclang/CMakeLists.txt
+++ clang/tools/libclang/CMakeLists.txt
@@ -76,7 +76,7 @@
 
 if (UNIX AND NOT APPLE)
   set(LLVM_EXPORTED_SYMBOL_FILE)
-  set(USE_VERSION_SCRIPT TRUE)
+  set(USE_VERSION_SCRIPT ${LLVM_HAVE_LINK_VERSION_SCRIPT})
 endif()
 
 if (LLVM_EXPORTED_SYMBOL_FILE)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D105527: libclang.so: Make SONAME independent from LLVM version

2021-07-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: clang/tools/libclang/CMakeLists.txt:79
+  set(LLVM_EXPORTED_SYMBOL_FILE)
+  set(USE_VERSION_SCRIPT TRUE)
+endif()

jsji wrote:
> I think we should check LLVM_HAVE_LINK_VERSION_SCRIPT here, there are 
> platforms that does NOT support VERSION_SCRIPT.
https://reviews.llvm.org/D106914 posted to fix it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105527/new/

https://reviews.llvm.org/D105527

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D106914: [libclang] Check LLVM_HAVE_LINK_VERSION_SCRIPT

2021-07-27 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe07f9342be71: [libclang] Check LLVM_HAVE_LINK_VERSION_SCRIPT 
(authored by jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106914/new/

https://reviews.llvm.org/D106914

Files:
  clang/tools/libclang/CMakeLists.txt


Index: clang/tools/libclang/CMakeLists.txt
===
--- clang/tools/libclang/CMakeLists.txt
+++ clang/tools/libclang/CMakeLists.txt
@@ -76,7 +76,7 @@
 
 if (UNIX AND NOT APPLE)
   set(LLVM_EXPORTED_SYMBOL_FILE)
-  set(USE_VERSION_SCRIPT TRUE)
+  set(USE_VERSION_SCRIPT ${LLVM_HAVE_LINK_VERSION_SCRIPT})
 endif()
 
 if (LLVM_EXPORTED_SYMBOL_FILE)


Index: clang/tools/libclang/CMakeLists.txt
===
--- clang/tools/libclang/CMakeLists.txt
+++ clang/tools/libclang/CMakeLists.txt
@@ -76,7 +76,7 @@
 
 if (UNIX AND NOT APPLE)
   set(LLVM_EXPORTED_SYMBOL_FILE)
-  set(USE_VERSION_SCRIPT TRUE)
+  set(USE_VERSION_SCRIPT ${LLVM_HAVE_LINK_VERSION_SCRIPT})
 endif()
 
 if (LLVM_EXPORTED_SYMBOL_FILE)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D106920: [AIX] Update fetch_and_add type

2021-07-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
Herald added subscribers: steven.zhang, kbarton, nemanjai.
jsji requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

It turns out that AIX kernerl are definiing int instead of unsing int
for fectch_and_add.

Legacy XL also define this to be signed.

https://www.ibm.com/docs/en/aix/7.2?topic=f-fetch-add-kernel-services

So update the type for compat.

Reviewere: hubert.reinterpretcast, Whitney, #PowerPC 



Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106920

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
  clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c


Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
@@ -16,7 +16,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i32* [[A_ADDR]], i32 [[TMP1]] 
monotonic, align 4
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_add(unsigned int a, unsigned int b) {
+void test_builtin_ppc_fetch_and_add(int a, unsigned int b) {
   __fetch_and_add(&a, b);
 }
 
@@ -31,7 +31,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i64* [[A_ADDR]], i64 [[TMP1]] 
monotonic, align 8
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_addlp(unsigned long a, unsigned long b) {
+void test_builtin_ppc_fetch_and_addlp(long a, unsigned long b) {
   __fetch_and_addlp(&a, b);
 }
 // CHECK-LABEL: @test_builtin_ppc_fetch_and_and(
Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
@@ -1,17 +1,18 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
 // REQUIRES: powerpc-registered-target
 // RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr8 \
 // RUN:  -verify %s
 
 void test_builtin_ppc_fetch_and_add2() {
-  volatile int a = 0;
+  volatile unsigned int a = 0;
   unsigned int b = 0;
 
-  __fetch_and_add(&a, b); // expected-warning {{passing 'volatile int *' to 
parameter of type 'volatile unsigned int *' converts between pointers to 
integer types with different sign}}
+  __fetch_and_add(&a, b); // expected-warning {{passing 'volatile unsigned int 
*' to parameter of type 'volatile int *' converts between pointers to integer 
types with different sign}}
 }
 
 void test_builtin_ppc_fetch_and_addlp() {
-  volatile long a = 0;
+  volatile unsigned long a = 0;
   unsigned long b = 0;
 
-  __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile long *' to 
parameter of type 'volatile unsigned long *' converts between pointers to 
integer types with different sign}}
+  __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile unsigned 
long *' to parameter of type 'volatile long *' converts between pointers to 
integer types with different sign}}
 }
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -64,8 +64,8 @@
 BUILTIN(__builtin_ppc_fsqrts, "ff", "")
 BUILTIN(__builtin_ppc_compare_and_swap, "iiD*i*i", "")
 BUILTIN(__builtin_ppc_compare_and_swaplp, "iLiD*Li*Li", "")
-BUILTIN(__builtin_ppc_fetch_and_add, "UiUiD*Ui", "")
-BUILTIN(__builtin_ppc_fetch_and_addlp, "ULiULiD*ULi", "")
+BUILTIN(__builtin_ppc_fetch_and_add, "iiD*i", "")
+BUILTIN(__builtin_ppc_fetch_and_addlp, "LiLiD*Li", "")
 BUILTIN(__builtin_ppc_fetch_and_and, "UiUiD*Ui", "")
 BUILTIN(__builtin_ppc_fetch_and_andlp, "ULiULiD*ULi", "")
 BUILTIN(__builtin_ppc_fetch_and_or, "UiUiD*Ui", "")


Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
@@ -16,7 +16,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i32* [[A_ADDR]], i32 [[TMP1]] monotonic, align 4
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_add(unsigned int a, unsigned int b) {
+void test_builtin_ppc_fetch_and_add(int a, unsigned int b) {
   __fetch_and_add(&a, b);
 }
 
@@ -31,7 +31,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i64* [[A_ADDR]], i64 [[TMP1]] monotonic, align 8
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_addlp(unsigned long a, unsigned long b) {
+void test_builtin_ppc_fetch_and_addlp(long a, unsigned long b) {
   __fetch_and_addlp(&a, b);
 }
 // CHECK-LABEL: @test_builtin_ppc_fetch_and_and(
Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
===
--- clang/te

[PATCH] D106920: [AIX] Update fetch_and_add type

2021-07-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 362197.
jsji edited the summary of this revision.
jsji added a comment.

Update tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106920/new/

https://reviews.llvm.org/D106920

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
  clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c


Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
@@ -16,7 +16,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i32* [[A_ADDR]], i32 [[TMP1]] 
monotonic, align 4
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_add(unsigned int a, unsigned int b) {
+void test_builtin_ppc_fetch_and_add(int a, int b) {
   __fetch_and_add(&a, b);
 }
 
@@ -31,7 +31,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i64* [[A_ADDR]], i64 [[TMP1]] 
monotonic, align 8
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_addlp(unsigned long a, unsigned long b) {
+void test_builtin_ppc_fetch_and_addlp(long a, long b) {
   __fetch_and_addlp(&a, b);
 }
 // CHECK-LABEL: @test_builtin_ppc_fetch_and_and(
Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
@@ -1,17 +1,18 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
 // REQUIRES: powerpc-registered-target
 // RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr8 \
 // RUN:  -verify %s
 
 void test_builtin_ppc_fetch_and_add2() {
-  volatile int a = 0;
+  volatile unsigned int a = 0;
   unsigned int b = 0;
 
-  __fetch_and_add(&a, b); // expected-warning {{passing 'volatile int *' to 
parameter of type 'volatile unsigned int *' converts between pointers to 
integer types with different sign}}
+  __fetch_and_add(&a, b); // expected-warning {{passing 'volatile unsigned int 
*' to parameter of type 'volatile int *' converts between pointers to integer 
types with different sign}}
 }
 
 void test_builtin_ppc_fetch_and_addlp() {
-  volatile long a = 0;
+  volatile unsigned long a = 0;
   unsigned long b = 0;
 
-  __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile long *' to 
parameter of type 'volatile unsigned long *' converts between pointers to 
integer types with different sign}}
+  __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile unsigned 
long *' to parameter of type 'volatile long *' converts between pointers to 
integer types with different sign}}
 }
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -64,8 +64,8 @@
 BUILTIN(__builtin_ppc_fsqrts, "ff", "")
 BUILTIN(__builtin_ppc_compare_and_swap, "iiD*i*i", "")
 BUILTIN(__builtin_ppc_compare_and_swaplp, "iLiD*Li*Li", "")
-BUILTIN(__builtin_ppc_fetch_and_add, "UiUiD*Ui", "")
-BUILTIN(__builtin_ppc_fetch_and_addlp, "ULiULiD*ULi", "")
+BUILTIN(__builtin_ppc_fetch_and_add, "iiD*i", "")
+BUILTIN(__builtin_ppc_fetch_and_addlp, "LiLiD*Li", "")
 BUILTIN(__builtin_ppc_fetch_and_and, "UiUiD*Ui", "")
 BUILTIN(__builtin_ppc_fetch_and_andlp, "ULiULiD*ULi", "")
 BUILTIN(__builtin_ppc_fetch_and_or, "UiUiD*Ui", "")


Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
@@ -16,7 +16,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i32* [[A_ADDR]], i32 [[TMP1]] monotonic, align 4
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_add(unsigned int a, unsigned int b) {
+void test_builtin_ppc_fetch_and_add(int a, int b) {
   __fetch_and_add(&a, b);
 }
 
@@ -31,7 +31,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i64* [[A_ADDR]], i64 [[TMP1]] monotonic, align 8
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_addlp(unsigned long a, unsigned long b) {
+void test_builtin_ppc_fetch_and_addlp(long a, long b) {
   __fetch_and_addlp(&a, b);
 }
 // CHECK-LABEL: @test_builtin_ppc_fetch_and_and(
Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
@@ -1,17 +1,18 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
 // REQUIRES: powerpc-registered-target
 // RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr8 \
 // RUN:  -verify %s
 
 void test_builtin_ppc_fetch_and_add2() {

[PATCH] D106920: [AIX] Update fetch_and_add type

2021-07-27 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGedbdf8e5b5aa: [AIX] Update fetch_and_add type (authored by 
jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106920/new/

https://reviews.llvm.org/D106920

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
  clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c


Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
@@ -16,7 +16,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i32* [[A_ADDR]], i32 [[TMP1]] 
monotonic, align 4
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_add(unsigned int a, unsigned int b) {
+void test_builtin_ppc_fetch_and_add(int a, int b) {
   __fetch_and_add(&a, b);
 }
 
@@ -31,7 +31,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i64* [[A_ADDR]], i64 [[TMP1]] 
monotonic, align 8
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_addlp(unsigned long a, unsigned long b) {
+void test_builtin_ppc_fetch_and_addlp(long a, long b) {
   __fetch_and_addlp(&a, b);
 }
 // CHECK-LABEL: @test_builtin_ppc_fetch_and_and(
Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
@@ -1,17 +1,18 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
 // REQUIRES: powerpc-registered-target
 // RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr8 \
 // RUN:  -verify %s
 
 void test_builtin_ppc_fetch_and_add2() {
-  volatile int a = 0;
+  volatile unsigned int a = 0;
   unsigned int b = 0;
 
-  __fetch_and_add(&a, b); // expected-warning {{passing 'volatile int *' to 
parameter of type 'volatile unsigned int *' converts between pointers to 
integer types with different sign}}
+  __fetch_and_add(&a, b); // expected-warning {{passing 'volatile unsigned int 
*' to parameter of type 'volatile int *' converts between pointers to integer 
types with different sign}}
 }
 
 void test_builtin_ppc_fetch_and_addlp() {
-  volatile long a = 0;
+  volatile unsigned long a = 0;
   unsigned long b = 0;
 
-  __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile long *' to 
parameter of type 'volatile unsigned long *' converts between pointers to 
integer types with different sign}}
+  __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile unsigned 
long *' to parameter of type 'volatile long *' converts between pointers to 
integer types with different sign}}
 }
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -64,8 +64,8 @@
 BUILTIN(__builtin_ppc_fsqrts, "ff", "")
 BUILTIN(__builtin_ppc_compare_and_swap, "iiD*i*i", "")
 BUILTIN(__builtin_ppc_compare_and_swaplp, "iLiD*Li*Li", "")
-BUILTIN(__builtin_ppc_fetch_and_add, "UiUiD*Ui", "")
-BUILTIN(__builtin_ppc_fetch_and_addlp, "ULiULiD*ULi", "")
+BUILTIN(__builtin_ppc_fetch_and_add, "iiD*i", "")
+BUILTIN(__builtin_ppc_fetch_and_addlp, "LiLiD*Li", "")
 BUILTIN(__builtin_ppc_fetch_and_and, "UiUiD*Ui", "")
 BUILTIN(__builtin_ppc_fetch_and_andlp, "ULiULiD*ULi", "")
 BUILTIN(__builtin_ppc_fetch_and_or, "UiUiD*Ui", "")


Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
@@ -16,7 +16,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i32* [[A_ADDR]], i32 [[TMP1]] monotonic, align 4
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_add(unsigned int a, unsigned int b) {
+void test_builtin_ppc_fetch_and_add(int a, int b) {
   __fetch_and_add(&a, b);
 }
 
@@ -31,7 +31,7 @@
 // CHECK-NEXT:[[TMP2:%.*]] = atomicrmw add i64* [[A_ADDR]], i64 [[TMP1]] monotonic, align 8
 // CHECK-NEXT:ret void
 //
-void test_builtin_ppc_fetch_and_addlp(unsigned long a, unsigned long b) {
+void test_builtin_ppc_fetch_and_addlp(long a, long b) {
   __fetch_and_addlp(&a, b);
 }
 // CHECK-LABEL: @test_builtin_ppc_fetch_and_and(
Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
===
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
@@ -1,17 +1,18 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
 // REQUIRES: powerpc-registered-target
 // RUN: %clang_cc1 -triple powerpc64-un

[PATCH] D107077: [PowerPC] Fix return type of XL compat CAS

2021-07-29 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision as: jsji.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107077/new/

https://reviews.llvm.org/D107077

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121441: [PowerPC][NFC] Add atomic alignments and ops tests for powerpc

2022-03-15 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision as: jsji.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121441/new/

https://reviews.llvm.org/D121441

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123498: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

2022-04-11 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

@qiongsiwu1 Please also add reviewers from other targets. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123498/new/

https://reviews.llvm.org/D123498

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123372: [PowerPC] add XLC compat builtin __abs

2022-04-19 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision as: jsji.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123372/new/

https://reviews.llvm.org/D123372

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D125386: [clang][ppc] Creating Seperate Install Target for PPC htm Headers

2022-05-11 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125386/new/

https://reviews.llvm.org/D125386

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66699: [PowerPC][Altivec] Fix constant argument for vec_dss

2019-08-23 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added reviewers: nemanjai, hfinkel.
Herald added subscribers: cfe-commits, shchenz, MaskRay, kbarton.
Herald added a project: clang.
jsji added a reviewer: PowerPC.
Herald added a subscriber: wuzish.

This is similar to vec_ct* in https://reviews.llvm.org/rL304205.

The argument must be a constant, otherwise instruction selection
will fail. always_inline is not enough for isel to always fold
everything away at -O0.

The fix is to turn the function into macros in altivec.h.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43072


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66699

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/lib/Headers/altivec.h
  clang/test/CodeGen/altivec-dss.c
  clang/test/CodeGen/builtins-ppc-error.c


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,8 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument 
to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 
5 is outside the valid range [0, 1]}}
 }
+
+void testDSS(int index) {
+  vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must 
be a constant integer}}
+
+}
Index: clang/test/CodeGen/altivec-dss.c
===
--- /dev/null
+++ clang/test/CodeGen/altivec-dss.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature 
+altivec | FileCheck %s
+
+// REQUIRES: powerpc-registered-target
+
+#include 
+
+// CHECK-LABEL: test1
+// CHECK: dss 
+void test1() {
+  vec_dss(1);
+}
Index: clang/lib/Headers/altivec.h
===
--- clang/lib/Headers/altivec.h
+++ clang/lib/Headers/altivec.h
@@ -3286,9 +3286,7 @@
 
 /* vec_dss */
 
-static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
-  __builtin_altivec_dss(__a);
-}
+#define vec_dss __builtin_altivec_dss
 
 /* vec_dssall */
 
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -55,7 +55,7 @@
 BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fIi", "")
 BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
 
-BUILTIN(__builtin_altivec_dss, "vUi", "")
+BUILTIN(__builtin_altivec_dss, "vUIi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
 BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
 BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,8 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 5 is outside the valid range [0, 1]}}
 }
+
+void testDSS(int index) {
+  vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must be a constant integer}}
+
+}
Index: clang/test/CodeGen/altivec-dss.c
===
--- /dev/null
+++ clang/test/CodeGen/altivec-dss.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec | FileCheck %s
+
+// REQUIRES: powerpc-registered-target
+
+#include 
+
+// CHECK-LABEL: test1
+// CHECK: dss 
+void test1() {
+  vec_dss(1);
+}
Index: clang/lib/Headers/altivec.h
===
--- clang/lib/Headers/altivec.h
+++ clang/lib/Headers/altivec.h
@@ -3286,9 +3286,7 @@
 
 /* vec_dss */
 
-static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
-  __builtin_altivec_dss(__a);
-}
+#define vec_dss __builtin_altivec_dss
 
 /* vec_dssall */
 
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -55,7 +55,7 @@
 BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fIi", "")
 BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
 
-BUILTIN(__builtin_altivec_dss, "vUi", "")
+BUILTIN(__builtin_altivec_dss, "vUIi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
 BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
 BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66748: [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*

2019-08-26 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added reviewers: nemanjai, hfinkel, echristo.
Herald added subscribers: cfe-commits, shchenz, MaskRay, kbarton.
Herald added a project: clang.
jsji added a reviewer: PowerPC.
Herald added a subscriber: wuzish.

This is follow up of https://reviews.llvm.org/D66699.
We might get ISEL ICE if we call vec_dss with non const 3rd arg.

  Cannot select: intrinsic %llvm.ppc.altivec.dst

We should check the constraints in clang and generate better error
messages.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66748

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/test/CodeGen/builtins-ppc-error.c


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,11 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument 
to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 
5 is outside the valid range [0, 1]}}
 }
+
+
+void testDST(int index) {
+  vec_dst(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dst' must be a constant integer}}
+  vec_dstt(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dstt' must be a constant integer}}
+  vec_dstst(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dstst' must be a constant integer}}
+  vec_dststt(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dststt' must be a constant integer}}
+}
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -57,10 +57,10 @@
 
 BUILTIN(__builtin_altivec_dss, "vUi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
-BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")
+BUILTIN(__builtin_altivec_dst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstt, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dststt, "vvC*iUIi", "")
 
 BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "")
 


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,11 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 5 is outside the valid range [0, 1]}}
 }
+
+
+void testDST(int index) {
+  vec_dst(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dst' must be a constant integer}}
+  vec_dstt(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dstt' must be a constant integer}}
+  vec_dstst(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dstst' must be a constant integer}}
+  vec_dststt(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dststt' must be a constant integer}}
+}
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -57,10 +57,10 @@
 
 BUILTIN(__builtin_altivec_dss, "vUi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
-BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")
+BUILTIN(__builtin_altivec_dst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstt, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dststt, "vvC*iUIi", "")
 
 BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "")
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66699: [PowerPC][Altivec] Fix constant argument for vec_dss

2019-09-02 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Ping..


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66699/new/

https://reviews.llvm.org/D66699



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66748: [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*

2019-09-02 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Ping..


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66748/new/

https://reviews.llvm.org/D66748



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66699: [PowerPC][Altivec] Fix constant argument for vec_dss

2019-09-03 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 218479.
jsji added a comment.

Add range check and test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66699/new/

https://reviews.llvm.org/D66699

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/lib/Headers/altivec.h
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/altivec-dss.c
  clang/test/CodeGen/builtins-ppc-error.c


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,8 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument 
to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 
5 is outside the valid range [0, 1]}}
 }
+
+void testDSS(int index) {
+  vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must 
be a constant integer}}
+  vec_dss(5); //expected-error {{argument value 5 is outside the valid range 
[0, 3]}}
+}
Index: clang/test/CodeGen/altivec-dss.c
===
--- /dev/null
+++ clang/test/CodeGen/altivec-dss.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature 
+altivec | FileCheck %s
+
+// REQUIRES: powerpc-registered-target
+
+#include 
+
+// CHECK-LABEL: test1
+// CHECK: dss 
+void test1() {
+  vec_dss(1);
+}
Index: clang/lib/Sema/SemaChecking.cpp
===
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -3220,6 +3220,8 @@
   case PPC::BI__builtin_altivec_crypto_vshasigmad:
 return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 15);
+  case PPC::BI__builtin_altivec_dss:
+return SemaBuiltinConstantArgRange(TheCall, 0, 0, 3);
   case PPC::BI__builtin_tbegin:
   case PPC::BI__builtin_tend: i = 0; l = 0; u = 1; break;
   case PPC::BI__builtin_tsr: i = 0; l = 0; u = 7; break;
Index: clang/lib/Headers/altivec.h
===
--- clang/lib/Headers/altivec.h
+++ clang/lib/Headers/altivec.h
@@ -3286,9 +3286,7 @@
 
 /* vec_dss */
 
-static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
-  __builtin_altivec_dss(__a);
-}
+#define vec_dss __builtin_altivec_dss
 
 /* vec_dssall */
 
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -55,7 +55,7 @@
 BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fIi", "")
 BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
 
-BUILTIN(__builtin_altivec_dss, "vUi", "")
+BUILTIN(__builtin_altivec_dss, "vUIi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
 BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
 BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,8 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 5 is outside the valid range [0, 1]}}
 }
+
+void testDSS(int index) {
+  vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must be a constant integer}}
+  vec_dss(5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+}
Index: clang/test/CodeGen/altivec-dss.c
===
--- /dev/null
+++ clang/test/CodeGen/altivec-dss.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec | FileCheck %s
+
+// REQUIRES: powerpc-registered-target
+
+#include 
+
+// CHECK-LABEL: test1
+// CHECK: dss 
+void test1() {
+  vec_dss(1);
+}
Index: clang/lib/Sema/SemaChecking.cpp
===
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -3220,6 +3220,8 @@
   case PPC::BI__builtin_altivec_crypto_vshasigmad:
 return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 15);
+  case PPC::BI__builtin_altivec_dss:
+return SemaBuiltinConstantArgRange(TheCall, 0, 0, 3);
   case PPC::BI__builtin_tbegin:
   case PPC::BI__builtin_tend: i = 0; l = 0; u = 1; break;
   case PPC::BI__builtin_tsr: i = 0; l = 0; u = 7; break;
Index: clang/lib/Headers/altivec.h
===
--- clang/lib/Headers/altivec.h
+++ clang/lib/Headers

[PATCH] D66699: [PowerPC][Altivec] Fix constant argument for vec_dss

2019-09-03 Thread Jinsong Ji via Phabricator via cfe-commits
jsji marked 2 inline comments as done.
jsji added inline comments.



Comment at: clang/test/CodeGen/builtins-ppc-error.c:78
+void testDSS(int index) {
+  vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must 
be a constant integer}}
+

wuzish wrote:
> It would be better if add range constraint check at 
> Sema::CheckPPCBuiltinFunctionCall
Good point, Done. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66699/new/

https://reviews.llvm.org/D66699



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66748: [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*

2019-09-03 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 218485.
jsji added a comment.

Add range check and tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66748/new/

https://reviews.llvm.org/D66748

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/builtins-ppc-error.c


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,15 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument 
to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 
5 is outside the valid range [0, 1]}}
 }
+
+
+void testDST(int index) {
+  vec_dst(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dst' must be a constant integer}}
+  vec_dst(&vsi, index, 5); //expected-error {{argument value 5 is outside the 
valid range [0, 3]}}
+  vec_dstt(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dstt' must be a constant integer}}
+  vec_dstt(&vsi, index, 5); //expected-error {{argument value 5 is outside the 
valid range [0, 3]}}
+  vec_dstst(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dstst' must be a constant integer}}
+  vec_dstst(&vsi, index, 5); //expected-error {{argument value 5 is outside 
the valid range [0, 3]}}
+  vec_dststt(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dststt' must be a constant integer}}
+  vec_dststt(&vsi, index, 5); //expected-error {{argument value 5 is outside 
the valid range [0, 3]}}
+}
Index: clang/lib/Sema/SemaChecking.cpp
===
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -3227,6 +3227,11 @@
   case PPC::BI__builtin_tabortdci:
 return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
+  case PPC::BI__builtin_altivec_dst:
+  case PPC::BI__builtin_altivec_dstt:
+  case PPC::BI__builtin_altivec_dstst:
+  case PPC::BI__builtin_altivec_dststt:
+return SemaBuiltinConstantArgRange(TheCall, 2, 0, 3);
   case PPC::BI__builtin_vsx_xxpermdi:
   case PPC::BI__builtin_vsx_xxsldwi:
 return SemaBuiltinVSX(TheCall);
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -57,10 +57,10 @@
 
 BUILTIN(__builtin_altivec_dss, "vUi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
-BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")
+BUILTIN(__builtin_altivec_dst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstt, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dststt, "vvC*iUIi", "")
 
 BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "")
 


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,15 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 5 is outside the valid range [0, 1]}}
 }
+
+
+void testDST(int index) {
+  vec_dst(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dst' must be a constant integer}}
+  vec_dst(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+  vec_dstt(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dstt' must be a constant integer}}
+  vec_dstt(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+  vec_dstst(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dstst' must be a constant integer}}
+  vec_dstst(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+  vec_dststt(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dststt' must be a constant integer}}
+  vec_dststt(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+}
Index: clang/lib/Sema/SemaChecking.cpp
===
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -3227,6 +3227,11 @@
   case PPC::BI__builtin_tabortdci:
 return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
+  ca

[PATCH] D66699: [PowerPC][Altivec] Fix constant argument for vec_dss

2019-09-04 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
jsji marked an inline comment as done.
Closed by commit rL370902: [PowerPC][Altivec] Fix constant argument for vec_dss 
(authored by jsji, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66699?vs=218479&id=218684#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66699/new/

https://reviews.llvm.org/D66699

Files:
  cfe/trunk/include/clang/Basic/BuiltinsPPC.def
  cfe/trunk/lib/Headers/altivec.h
  cfe/trunk/lib/Sema/SemaChecking.cpp
  cfe/trunk/test/CodeGen/altivec-dss.c
  cfe/trunk/test/CodeGen/builtins-ppc-error.c


Index: cfe/trunk/test/CodeGen/builtins-ppc-error.c
===
--- cfe/trunk/test/CodeGen/builtins-ppc-error.c
+++ cfe/trunk/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,8 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument 
to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 
5 is outside the valid range [0, 1]}}
 }
+
+void testDSS(int index) {
+  vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must 
be a constant integer}}
+  vec_dss(5); //expected-error {{argument value 5 is outside the valid range 
[0, 3]}}
+}
Index: cfe/trunk/test/CodeGen/altivec-dss.c
===
--- cfe/trunk/test/CodeGen/altivec-dss.c
+++ cfe/trunk/test/CodeGen/altivec-dss.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature 
+altivec | FileCheck %s
+
+// REQUIRES: powerpc-registered-target
+
+#include 
+
+// CHECK-LABEL: test1
+// CHECK: dss 
+void test1() {
+  vec_dss(1);
+}
Index: cfe/trunk/lib/Sema/SemaChecking.cpp
===
--- cfe/trunk/lib/Sema/SemaChecking.cpp
+++ cfe/trunk/lib/Sema/SemaChecking.cpp
@@ -3220,6 +3220,8 @@
   case PPC::BI__builtin_altivec_crypto_vshasigmad:
 return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 15);
+  case PPC::BI__builtin_altivec_dss:
+return SemaBuiltinConstantArgRange(TheCall, 0, 0, 3);
   case PPC::BI__builtin_tbegin:
   case PPC::BI__builtin_tend: i = 0; l = 0; u = 1; break;
   case PPC::BI__builtin_tsr: i = 0; l = 0; u = 7; break;
Index: cfe/trunk/lib/Headers/altivec.h
===
--- cfe/trunk/lib/Headers/altivec.h
+++ cfe/trunk/lib/Headers/altivec.h
@@ -3286,9 +3286,7 @@
 
 /* vec_dss */
 
-static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
-  __builtin_altivec_dss(__a);
-}
+#define vec_dss __builtin_altivec_dss
 
 /* vec_dssall */
 
Index: cfe/trunk/include/clang/Basic/BuiltinsPPC.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsPPC.def
+++ cfe/trunk/include/clang/Basic/BuiltinsPPC.def
@@ -55,7 +55,7 @@
 BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fIi", "")
 BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
 
-BUILTIN(__builtin_altivec_dss, "vUi", "")
+BUILTIN(__builtin_altivec_dss, "vUIi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
 BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
 BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")


Index: cfe/trunk/test/CodeGen/builtins-ppc-error.c
===
--- cfe/trunk/test/CodeGen/builtins-ppc-error.c
+++ cfe/trunk/test/CodeGen/builtins-ppc-error.c
@@ -73,3 +73,8 @@
   __builtin_unpack_vector_int128(vsllli, index); //expected-error {{argument to '__builtin_unpack_vector_int128' must be a constant integer}}
   __builtin_unpack_vector_int128(vsllli, 5); //expected-error {{argument value 5 is outside the valid range [0, 1]}}
 }
+
+void testDSS(int index) {
+  vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must be a constant integer}}
+  vec_dss(5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+}
Index: cfe/trunk/test/CodeGen/altivec-dss.c
===
--- cfe/trunk/test/CodeGen/altivec-dss.c
+++ cfe/trunk/test/CodeGen/altivec-dss.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec | FileCheck %s
+
+// REQUIRES: powerpc-registered-target
+
+#include 
+
+// CHECK-LABEL: test1
+// CHECK: dss 
+void test1() {
+  vec_dss(1);
+}
Index: cfe/trunk/lib/Sema/SemaChecking.cpp
===
--- cfe/trunk/lib/Sema/SemaChecking.cpp
+++ cfe/trunk/lib/Sema/SemaChecking.cpp
@@ -3220,6 +3220,8 @@
   case PPC::BI__builtin_altivec_crypto_vshasigmad:
 return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) ||
SemaBuiltinCon

[PATCH] D66748: [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*

2019-09-04 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 218696.
jsji added a comment.

Rebase to ToT.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66748/new/

https://reviews.llvm.org/D66748

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/builtins-ppc-error.c


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -78,3 +78,14 @@
   vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must 
be a constant integer}}
   vec_dss(5); //expected-error {{argument value 5 is outside the valid range 
[0, 3]}}
 }
+
+void testDST(int index) {
+  vec_dst(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dst' must be a constant integer}}
+  vec_dst(&vsi, index, 5); //expected-error {{argument value 5 is outside the 
valid range [0, 3]}}
+  vec_dstt(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dstt' must be a constant integer}}
+  vec_dstt(&vsi, index, 5); //expected-error {{argument value 5 is outside the 
valid range [0, 3]}}
+  vec_dstst(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dstst' must be a constant integer}}
+  vec_dstst(&vsi, index, 5); //expected-error {{argument value 5 is outside 
the valid range [0, 3]}}
+  vec_dststt(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dststt' must be a constant integer}}
+  vec_dststt(&vsi, index, 5); //expected-error {{argument value 5 is outside 
the valid range [0, 3]}}
+}
Index: clang/lib/Sema/SemaChecking.cpp
===
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -3231,6 +3231,11 @@
   case PPC::BI__builtin_tabortdci:
 return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
+  case PPC::BI__builtin_altivec_dst:
+  case PPC::BI__builtin_altivec_dstt:
+  case PPC::BI__builtin_altivec_dstst:
+  case PPC::BI__builtin_altivec_dststt:
+return SemaBuiltinConstantArgRange(TheCall, 2, 0, 3);
   case PPC::BI__builtin_vsx_xxpermdi:
   case PPC::BI__builtin_vsx_xxsldwi:
 return SemaBuiltinVSX(TheCall);
Index: clang/include/clang/Basic/BuiltinsPPC.def
===
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -57,10 +57,10 @@
 
 BUILTIN(__builtin_altivec_dss, "vUIi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
-BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")
+BUILTIN(__builtin_altivec_dst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstt, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dststt, "vvC*iUIi", "")
 
 BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "")
 


Index: clang/test/CodeGen/builtins-ppc-error.c
===
--- clang/test/CodeGen/builtins-ppc-error.c
+++ clang/test/CodeGen/builtins-ppc-error.c
@@ -78,3 +78,14 @@
   vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must be a constant integer}}
   vec_dss(5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
 }
+
+void testDST(int index) {
+  vec_dst(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dst' must be a constant integer}}
+  vec_dst(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+  vec_dstt(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dstt' must be a constant integer}}
+  vec_dstt(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+  vec_dstst(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dstst' must be a constant integer}}
+  vec_dstst(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+  vec_dststt(&vsi, index, index); //expected-error {{argument to '__builtin_altivec_dststt' must be a constant integer}}
+  vec_dststt(&vsi, index, 5); //expected-error {{argument value 5 is outside the valid range [0, 3]}}
+}
Index: clang/lib/Sema/SemaChecking.cpp
===
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -3231,6 +3231,11 @@
   case PPC::BI__builtin_tabortdci:
 return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
+  case PPC::BI__builtin_altivec_dst:
+  case PPC::BI__builtin_altivec_dstt:
+  case PPC::BI__builtin_altivec_dstst:
+  case PPC::BI__builtin_altivec_dststt:
+   

[PATCH] D66748: [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*

2019-09-04 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370912: [PowerPC][Altivec][Clang] Check compile-time 
constant for vec_dst* (authored by jsji, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66748?vs=218696&id=218718#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66748/new/

https://reviews.llvm.org/D66748

Files:
  cfe/trunk/include/clang/Basic/BuiltinsPPC.def
  cfe/trunk/lib/Sema/SemaChecking.cpp
  cfe/trunk/test/CodeGen/builtins-ppc-error.c


Index: cfe/trunk/lib/Sema/SemaChecking.cpp
===
--- cfe/trunk/lib/Sema/SemaChecking.cpp
+++ cfe/trunk/lib/Sema/SemaChecking.cpp
@@ -3231,6 +3231,11 @@
   case PPC::BI__builtin_tabortdci:
 return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
+  case PPC::BI__builtin_altivec_dst:
+  case PPC::BI__builtin_altivec_dstt:
+  case PPC::BI__builtin_altivec_dstst:
+  case PPC::BI__builtin_altivec_dststt:
+return SemaBuiltinConstantArgRange(TheCall, 2, 0, 3);
   case PPC::BI__builtin_vsx_xxpermdi:
   case PPC::BI__builtin_vsx_xxsldwi:
 return SemaBuiltinVSX(TheCall);
Index: cfe/trunk/include/clang/Basic/BuiltinsPPC.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsPPC.def
+++ cfe/trunk/include/clang/Basic/BuiltinsPPC.def
@@ -57,10 +57,10 @@
 
 BUILTIN(__builtin_altivec_dss, "vUIi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
-BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")
+BUILTIN(__builtin_altivec_dst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstt, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dststt, "vvC*iUIi", "")
 
 BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "")
 
Index: cfe/trunk/test/CodeGen/builtins-ppc-error.c
===
--- cfe/trunk/test/CodeGen/builtins-ppc-error.c
+++ cfe/trunk/test/CodeGen/builtins-ppc-error.c
@@ -78,3 +78,14 @@
   vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must 
be a constant integer}}
   vec_dss(5); //expected-error {{argument value 5 is outside the valid range 
[0, 3]}}
 }
+
+void testDST(int index) {
+  vec_dst(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dst' must be a constant integer}}
+  vec_dst(&vsi, index, 5); //expected-error {{argument value 5 is outside the 
valid range [0, 3]}}
+  vec_dstt(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dstt' must be a constant integer}}
+  vec_dstt(&vsi, index, 5); //expected-error {{argument value 5 is outside the 
valid range [0, 3]}}
+  vec_dstst(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dstst' must be a constant integer}}
+  vec_dstst(&vsi, index, 5); //expected-error {{argument value 5 is outside 
the valid range [0, 3]}}
+  vec_dststt(&vsi, index, index); //expected-error {{argument to 
'__builtin_altivec_dststt' must be a constant integer}}
+  vec_dststt(&vsi, index, 5); //expected-error {{argument value 5 is outside 
the valid range [0, 3]}}
+}


Index: cfe/trunk/lib/Sema/SemaChecking.cpp
===
--- cfe/trunk/lib/Sema/SemaChecking.cpp
+++ cfe/trunk/lib/Sema/SemaChecking.cpp
@@ -3231,6 +3231,11 @@
   case PPC::BI__builtin_tabortdci:
 return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31) ||
SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
+  case PPC::BI__builtin_altivec_dst:
+  case PPC::BI__builtin_altivec_dstt:
+  case PPC::BI__builtin_altivec_dstst:
+  case PPC::BI__builtin_altivec_dststt:
+return SemaBuiltinConstantArgRange(TheCall, 2, 0, 3);
   case PPC::BI__builtin_vsx_xxpermdi:
   case PPC::BI__builtin_vsx_xxsldwi:
 return SemaBuiltinVSX(TheCall);
Index: cfe/trunk/include/clang/Basic/BuiltinsPPC.def
===
--- cfe/trunk/include/clang/Basic/BuiltinsPPC.def
+++ cfe/trunk/include/clang/Basic/BuiltinsPPC.def
@@ -57,10 +57,10 @@
 
 BUILTIN(__builtin_altivec_dss, "vUIi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
-BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
-BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")
+BUILTIN(__builtin_altivec_dst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstt, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dstst, "vvC*iUIi", "")
+BUILTIN(__builtin_altivec_dststt, "vvC*iUIi", "")
 
 BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "")
 
Index: cfe/trunk/test/CodeGen/builtins-ppc-error.c
==

[PATCH] D72707: [clang][OpenCL] Fix covered switch warning

2020-01-14 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added a reviewer: svenvh.
Herald added subscribers: cfe-commits, Anastasia, yaxunl.
Herald added a project: clang.
jsji edited the summary of this revision.

-Werror clang build is broken now.

tools/clang/lib/Sema/OpenCLBuiltins.inc:11824:5: error: default label in
switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]

  default:

We don't need default now, since all enumeration values are covered.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72707

Files:
  clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp


Index: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
===
--- clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -751,9 +751,7 @@
   }
 
   // End of switch statement.
-  OS << "default:\n"
- << "  llvm_unreachable(\"OpenCL builtin type not handled yet\");\n"
- << "  } // end of switch (Ty.ID)\n\n";
+  OS << "  } // end of switch (Ty.ID)\n\n";
 
   // Step 2.
   // Add ExtVector types if this was a generic type, as the switch statement


Index: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
===
--- clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -751,9 +751,7 @@
   }
 
   // End of switch statement.
-  OS << "default:\n"
- << "  llvm_unreachable(\"OpenCL builtin type not handled yet\");\n"
- << "  } // end of switch (Ty.ID)\n\n";
+  OS << "  } // end of switch (Ty.ID)\n\n";
 
   // Step 2.
   // Add ExtVector types if this was a generic type, as the switch statement
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D72707: [clang][OpenCL] Fix covered switch warning

2020-01-14 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe2b8e2113a49: [clang][OpenCL] Fix covered switch warning 
(authored by jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72707/new/

https://reviews.llvm.org/D72707

Files:
  clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp


Index: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
===
--- clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -751,9 +751,7 @@
   }
 
   // End of switch statement.
-  OS << "default:\n"
- << "  llvm_unreachable(\"OpenCL builtin type not handled yet\");\n"
- << "  } // end of switch (Ty.ID)\n\n";
+  OS << "  } // end of switch (Ty.ID)\n\n";
 
   // Step 2.
   // Add ExtVector types if this was a generic type, as the switch statement


Index: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
===
--- clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -751,9 +751,7 @@
   }
 
   // End of switch statement.
-  OS << "default:\n"
- << "  llvm_unreachable(\"OpenCL builtin type not handled yet\");\n"
- << "  } // end of switch (Ty.ID)\n\n";
+  OS << "  } // end of switch (Ty.ID)\n\n";
 
   // Step 2.
   // Add ExtVector types if this was a generic type, as the switch statement
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D89242: [PowerPC] [Clang] Port SSE4.1-compatible insert intrinsics

2020-11-08 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision as: jsji.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89242/new/

https://reviews.llvm.org/D89242

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D92329: [PowerPC][Clang] Remove QPX support

2020-11-30 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
Herald added subscribers: cfe-commits, dang, shchenz, kbarton, nemanjai.
Herald added a project: clang.
jsji requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

Clean up QPX code in clang missed in https://reviews.llvm.org/D83915


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92329

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/include/clang/Driver/Options.td
  clang/lib/AST/ASTContext.cpp
  clang/lib/Basic/Targets/PPC.h
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/ppc64-elf-abi.c
  clang/test/CodeGen/ppc64-qpx-vector.c
  clang/test/Driver/linux-ld.c
  clang/test/Driver/ppc-features.cpp
  clang/test/OpenMP/simd_metadata.c

Index: clang/test/OpenMP/simd_metadata.c
===
--- clang/test/OpenMP/simd_metadata.c
+++ clang/test/OpenMP/simd_metadata.c
@@ -5,7 +5,6 @@
 // RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
 // RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -target-feature +avx512f -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX512
 // RUN: %clang_cc1 -fopenmp -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC
-// RUN: %clang_cc1 -fopenmp -triple powerpc64-unknown-unknown -target-abi elfv1-qpx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC-QPX
 
 // RUN: %clang_cc1 -fopenmp-simd -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86
 // RUN: %clang_cc1 -fopenmp-simd -triple x86_64-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
@@ -14,7 +13,6 @@
 // RUN: %clang_cc1 -fopenmp-simd -triple i386-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
 // RUN: %clang_cc1 -fopenmp-simd -triple i386-unknown-unknown -target-feature +avx512f -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX512
 // RUN: %clang_cc1 -fopenmp-simd -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC
-// RUN: %clang_cc1 -fopenmp-simd -triple powerpc64-unknown-unknown -target-abi elfv1-qpx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC-QPX
 
 void h1(float *c, float *a, double b[], int size)
 {
@@ -28,14 +26,12 @@
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
   // CHECK-NEXT: load
 
   // X86-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 16) ]
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 32) ]
   for (int i = 0; i < size; ++i) {
 c[i] = a[i] * a[i] + b[i] * b[t];
 ++t;
@@ -50,14 +46,12 @@
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
   // CHECK-NEXT: load
 
   // X86-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 16) ]
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 32) ]
   for (int i = 0; i < size; ++i) {
 c[i] = a[i] * a[i] + b[i] * b[t];
 ++t;
@@ -72,14 +66,12 @@
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "ali

[PATCH] D92329: [PowerPC][Clang] Remove QPX support

2020-11-30 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 308405.
jsji added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fix llvm test as well


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92329/new/

https://reviews.llvm.org/D92329

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/include/clang/Driver/Options.td
  clang/lib/AST/ASTContext.cpp
  clang/lib/Basic/Targets/PPC.h
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/ppc64-elf-abi.c
  clang/test/CodeGen/ppc64-qpx-vector.c
  clang/test/Driver/linux-ld.c
  clang/test/Driver/ppc-features.cpp
  clang/test/OpenMP/simd_metadata.c
  llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-only-for-real.ll

Index: llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-only-for-real.ll
===
--- llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-only-for-real.ll
+++ llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-only-for-real.ll
@@ -55,8 +55,8 @@
 
 declare signext i32 @bar(i32*, i32*) #2
 
-attributes #0 = { nounwind "target-cpu"="a2q" "target-features"="+qpx,-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
+attributes #0 = { nounwind "target-features"="-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
 attributes #1 = { argmemonly nounwind }
-attributes #2 = { "target-cpu"="a2q" "target-features"="+qpx,-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
+attributes #2 = { "target-features"="-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
 attributes #3 = { nounwind }
 
Index: clang/test/OpenMP/simd_metadata.c
===
--- clang/test/OpenMP/simd_metadata.c
+++ clang/test/OpenMP/simd_metadata.c
@@ -5,7 +5,6 @@
 // RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
 // RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -target-feature +avx512f -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX512
 // RUN: %clang_cc1 -fopenmp -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC
-// RUN: %clang_cc1 -fopenmp -triple powerpc64-unknown-unknown -target-abi elfv1-qpx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC-QPX
 
 // RUN: %clang_cc1 -fopenmp-simd -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86
 // RUN: %clang_cc1 -fopenmp-simd -triple x86_64-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
@@ -14,7 +13,6 @@
 // RUN: %clang_cc1 -fopenmp-simd -triple i386-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
 // RUN: %clang_cc1 -fopenmp-simd -triple i386-unknown-unknown -target-feature +avx512f -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX512
 // RUN: %clang_cc1 -fopenmp-simd -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC
-// RUN: %clang_cc1 -fopenmp-simd -triple powerpc64-unknown-unknown -target-abi elfv1-qpx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC-QPX
 
 void h1(float *c, float *a, double b[], int size)
 {
@@ -28,14 +26,12 @@
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
   // CHECK-NEXT: load
 
   // X86-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 16) ]
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 32) ]
   for (int i = 0; i < size; ++i) {
 c[i] = a[i] * a[i] + b[i] * b[t];
 ++t;
@@ -50,14 +46,12 @@
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
   // CHECK-NEX

[PATCH] D92329: [PowerPC][Clang] Remove QPX support

2020-12-07 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb49b8f096c03: [PowerPC][Clang] Remove QPX support (authored 
by jsji).

Changed prior to commit:
  https://reviews.llvm.org/D92329?vs=308405&id=309908#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92329/new/

https://reviews.llvm.org/D92329

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/include/clang/Driver/Options.td
  clang/lib/AST/ASTContext.cpp
  clang/lib/Basic/Targets/PPC.h
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/ppc64-elf-abi.c
  clang/test/CodeGen/ppc64-qpx-vector.c
  clang/test/Driver/linux-ld.c
  clang/test/Driver/ppc-features.cpp
  clang/test/OpenMP/simd_metadata.c
  llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-only-for-real.ll

Index: llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-only-for-real.ll
===
--- llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-only-for-real.ll
+++ llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-only-for-real.ll
@@ -55,8 +55,8 @@
 
 declare signext i32 @bar(i32*, i32*) #2
 
-attributes #0 = { nounwind "target-cpu"="a2q" "target-features"="+qpx,-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
+attributes #0 = { nounwind "target-features"="-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
 attributes #1 = { argmemonly nounwind }
-attributes #2 = { "target-cpu"="a2q" "target-features"="+qpx,-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
+attributes #2 = { "target-features"="-altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" }
 attributes #3 = { nounwind }
 
Index: clang/test/OpenMP/simd_metadata.c
===
--- clang/test/OpenMP/simd_metadata.c
+++ clang/test/OpenMP/simd_metadata.c
@@ -5,7 +5,6 @@
 // RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
 // RUN: %clang_cc1 -fopenmp -triple i386-unknown-unknown -target-feature +avx512f -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX512
 // RUN: %clang_cc1 -fopenmp -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC
-// RUN: %clang_cc1 -fopenmp -triple powerpc64-unknown-unknown -target-abi elfv1-qpx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC-QPX
 
 // RUN: %clang_cc1 -fopenmp-simd -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86
 // RUN: %clang_cc1 -fopenmp-simd -triple x86_64-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
@@ -14,7 +13,6 @@
 // RUN: %clang_cc1 -fopenmp-simd -triple i386-unknown-unknown -target-feature +avx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX
 // RUN: %clang_cc1 -fopenmp-simd -triple i386-unknown-unknown -target-feature +avx512f -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=X86-AVX512
 // RUN: %clang_cc1 -fopenmp-simd -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC
-// RUN: %clang_cc1 -fopenmp-simd -triple powerpc64-unknown-unknown -target-abi elfv1-qpx -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=PPC-QPX
 
 void h1(float *c, float *a, double b[], int size)
 {
@@ -28,14 +26,12 @@
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
   // CHECK-NEXT: load
 
   // X86-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 16) ]
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call void @llvm.assume(i1 true) [ "align"(double* [[PTR6:%.*]], {{i64|i32}} 32) ]
   for (int i = 0; i < size; ++i) {
 c[i] = a[i] * a[i] + b[i] * b[t];
 ++t;
@@ -50,14 +46,12 @@
   // X86-AVX-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 32) ]
   // X86-AVX512-NEXT:call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 64) ]
   // PPC-NEXT:   call void @llvm.assume(i1 true) [ "align"(float* [[PTR5:%.*]], {{i64|i32}} 16) ]
-  // PPC-QPX-NEXT:   call voi

[PATCH] D102560: [AIX][clang-repl][test] Mark unsupported pending XCOFF64 integrated-as

2021-05-15 Thread Jinsong Ji via Phabricator via cfe-commits
jsji accepted this revision.
jsji added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102560/new/

https://reviews.llvm.org/D102560

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102647: [Driver][test] Don't assume integrated-as

2021-05-17 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added reviewers: PowerPC, thakis, MaskRay, phosek, hubert.reinterpretcast.
jsji requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The tests of fdebug-compilation-dir and -ffile-compilation-dir for `-x
assembler` are assuming integrated-as.
If the platform set the no-itegrated-as by default, then this test will
fail.

Add the -integrated-as to aviod relying on the platform defaults.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102647

Files:
  clang/test/Driver/clang_f_opts.c


Index: clang/test/Driver/clang_f_opts.c
===
--- clang/test/Driver/clang_f_opts.c
+++ clang/test/Driver/clang_f_opts.c
@@ -516,10 +516,10 @@
 
 // RUN: %clang -### -S -fdebug-compilation-dir . %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
 // RUN: %clang -### -S -fdebug-compilation-dir=. %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -fdebug-compilation-dir . -x assembler %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -fdebug-compilation-dir=. -x assembler %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -fdebug-compilation-dir . -x assembler %s 
2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -fdebug-compilation-dir=. -x assembler %s 
2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
 // RUN: %clang -### -S -ffile-compilation-dir=. %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -ffile-compilation-dir=. -x assembler %s 2>&1 | FileCheck 
-check-prefixes=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -ffile-compilation-dir=. -x assembler %s 
2>&1 | FileCheck -check-prefixes=CHECK-DEBUG-COMPILATION-DIR %s
 // CHECK-DEBUG-COMPILATION-DIR: "-fdebug-compilation-dir=."
 // CHECK-DEBUG-COMPILATION-DIR-NOT: "-ffile-compilation-dir=."
 


Index: clang/test/Driver/clang_f_opts.c
===
--- clang/test/Driver/clang_f_opts.c
+++ clang/test/Driver/clang_f_opts.c
@@ -516,10 +516,10 @@
 
 // RUN: %clang -### -S -fdebug-compilation-dir . %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
 // RUN: %clang -### -S -fdebug-compilation-dir=. %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -fdebug-compilation-dir . -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -fdebug-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -fdebug-compilation-dir . -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -fdebug-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
 // RUN: %clang -### -S -ffile-compilation-dir=. %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -ffile-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefixes=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -ffile-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefixes=CHECK-DEBUG-COMPILATION-DIR %s
 // CHECK-DEBUG-COMPILATION-DIR: "-fdebug-compilation-dir=."
 // CHECK-DEBUG-COMPILATION-DIR-NOT: "-ffile-compilation-dir=."
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102647: [Driver][test] Don't assume integrated-as

2021-05-17 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D102647#2764376 , @thakis wrote:

> Are there any platforms left that don't default to integrated as? Which ones? 
> Is there a tracking bug for switching them?

Thanks! Oh, I should have mentioned that in description, this is exposed on AIX 
testing.
AIX doesn't default to integrated as for now. There is no tracking but yet, but 
we have internal tracking for switching.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102647/new/

https://reviews.llvm.org/D102647

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102647: [Driver][test] Don't assume integrated-as

2021-05-17 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG82b52812471c: [Driver][test] Don't assume integrated-as 
(authored by jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102647/new/

https://reviews.llvm.org/D102647

Files:
  clang/test/Driver/clang_f_opts.c


Index: clang/test/Driver/clang_f_opts.c
===
--- clang/test/Driver/clang_f_opts.c
+++ clang/test/Driver/clang_f_opts.c
@@ -516,10 +516,10 @@
 
 // RUN: %clang -### -S -fdebug-compilation-dir . %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
 // RUN: %clang -### -S -fdebug-compilation-dir=. %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -fdebug-compilation-dir . -x assembler %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -fdebug-compilation-dir=. -x assembler %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -fdebug-compilation-dir . -x assembler %s 
2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -fdebug-compilation-dir=. -x assembler %s 
2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
 // RUN: %clang -### -S -ffile-compilation-dir=. %s 2>&1 | FileCheck 
-check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -ffile-compilation-dir=. -x assembler %s 2>&1 | FileCheck 
-check-prefixes=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -ffile-compilation-dir=. -x assembler %s 
2>&1 | FileCheck -check-prefixes=CHECK-DEBUG-COMPILATION-DIR %s
 // CHECK-DEBUG-COMPILATION-DIR: "-fdebug-compilation-dir=."
 // CHECK-DEBUG-COMPILATION-DIR-NOT: "-ffile-compilation-dir=."
 


Index: clang/test/Driver/clang_f_opts.c
===
--- clang/test/Driver/clang_f_opts.c
+++ clang/test/Driver/clang_f_opts.c
@@ -516,10 +516,10 @@
 
 // RUN: %clang -### -S -fdebug-compilation-dir . %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
 // RUN: %clang -### -S -fdebug-compilation-dir=. %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -fdebug-compilation-dir . -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -fdebug-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -fdebug-compilation-dir . -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -fdebug-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
 // RUN: %clang -### -S -ffile-compilation-dir=. %s 2>&1 | FileCheck -check-prefix=CHECK-DEBUG-COMPILATION-DIR %s
-// RUN: %clang -### -ffile-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefixes=CHECK-DEBUG-COMPILATION-DIR %s
+// RUN: %clang -### -integrated-as -ffile-compilation-dir=. -x assembler %s 2>&1 | FileCheck -check-prefixes=CHECK-DEBUG-COMPILATION-DIR %s
 // CHECK-DEBUG-COMPILATION-DIR: "-fdebug-compilation-dir=."
 // CHECK-DEBUG-COMPILATION-DIR-NOT: "-ffile-compilation-dir=."
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102654: [DebugInfo][test] Check specific func name to ignore codegen differences

2021-05-17 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added reviewers: PowerPC, dblaikie, shchenz.
jsji requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

We use `CHECK-LABEL: define` to divide input stream into functions,
this works well on most platforms.

But there are cases that some platforms (eg: AIX) may have different
codegen , especially for global constructor and descructors.

On AIX, the codegen will have two more functions: __dtor_b,
__finalize_b, which will fail the test.

The fix is to use specific function name so that we can safely ignore
those unrelated codegen differences.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102654

Files:
  clang/test/CodeGenCXX/debug-info-line.cpp


Index: clang/test/CodeGenCXX/debug-info-line.cpp
===
--- clang/test/CodeGenCXX/debug-info-line.cpp
+++ clang/test/CodeGenCXX/debug-info-line.cpp
@@ -146,7 +146,7 @@
 (fn(),   //
  bar())};
 
-// CHECK-LABEL: define
+// CHECK-LABEL: f11
 __complex double f11() {
   __complex double f;
 // CHECK: store {{.*}} !dbg [[DBG_F11:!.*]]


Index: clang/test/CodeGenCXX/debug-info-line.cpp
===
--- clang/test/CodeGenCXX/debug-info-line.cpp
+++ clang/test/CodeGenCXX/debug-info-line.cpp
@@ -146,7 +146,7 @@
 (fn(),   //
  bar())};
 
-// CHECK-LABEL: define
+// CHECK-LABEL: f11
 __complex double f11() {
   __complex double f;
 // CHECK: store {{.*}} !dbg [[DBG_F11:!.*]]
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102654: [DebugInfo][test] Check specific func name to ignore codegen differences

2021-05-17 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 346011.
jsji added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102654/new/

https://reviews.llvm.org/D102654

Files:
  clang/test/CodeGenCXX/debug-info-line.cpp


Index: clang/test/CodeGenCXX/debug-info-line.cpp
===
--- clang/test/CodeGenCXX/debug-info-line.cpp
+++ clang/test/CodeGenCXX/debug-info-line.cpp
@@ -146,7 +146,7 @@
 (fn(),   //
  bar())};
 
-// CHECK-LABEL: define
+// CHECK-LABEL: define{{.*}}f11
 __complex double f11() {
   __complex double f;
 // CHECK: store {{.*}} !dbg [[DBG_F11:!.*]]


Index: clang/test/CodeGenCXX/debug-info-line.cpp
===
--- clang/test/CodeGenCXX/debug-info-line.cpp
+++ clang/test/CodeGenCXX/debug-info-line.cpp
@@ -146,7 +146,7 @@
 (fn(),   //
  bar())};
 
-// CHECK-LABEL: define
+// CHECK-LABEL: define{{.*}}f11
 __complex double f11() {
   __complex double f;
 // CHECK: store {{.*}} !dbg [[DBG_F11:!.*]]
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102654: [DebugInfo][test] Check specific func name to ignore codegen differences

2021-05-17 Thread Jinsong Ji via Phabricator via cfe-commits
jsji marked an inline comment as done.
jsji added inline comments.



Comment at: clang/test/CodeGenCXX/debug-info-line.cpp:149
 
-// CHECK-LABEL: define
+// CHECK-LABEL: f11
 __complex double f11() {

dblaikie wrote:
> Probably flesh that out a bit. Maybe `define{{.*}}f11`?
Good idea.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102654/new/

https://reviews.llvm.org/D102654

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102654: [DebugInfo][test] Check specific func name to ignore codegen differences

2021-05-18 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
jsji marked an inline comment as done.
Closed by commit rG7d6449322ecb: [DebugInfo][test] Check specific func name to 
ignore codegen differences (authored by jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102654/new/

https://reviews.llvm.org/D102654

Files:
  clang/test/CodeGenCXX/debug-info-line.cpp


Index: clang/test/CodeGenCXX/debug-info-line.cpp
===
--- clang/test/CodeGenCXX/debug-info-line.cpp
+++ clang/test/CodeGenCXX/debug-info-line.cpp
@@ -146,7 +146,7 @@
 (fn(),   //
  bar())};
 
-// CHECK-LABEL: define
+// CHECK-LABEL: define{{.*}}f11
 __complex double f11() {
   __complex double f;
 // CHECK: store {{.*}} !dbg [[DBG_F11:!.*]]


Index: clang/test/CodeGenCXX/debug-info-line.cpp
===
--- clang/test/CodeGenCXX/debug-info-line.cpp
+++ clang/test/CodeGenCXX/debug-info-line.cpp
@@ -146,7 +146,7 @@
 (fn(),   //
  bar())};
 
-// CHECK-LABEL: define
+// CHECK-LABEL: define{{.*}}f11
 __complex double f11() {
   __complex double f;
 // CHECK: store {{.*}} !dbg [[DBG_F11:!.*]]
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102724: Revert "[AIX] Avoid structor alias; die before bad alias codegen"

2021-05-19 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

> because AIX now has an alias implementation.

Can we please include the patches or commits that implement the alias?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102724/new/

https://reviews.llvm.org/D102724

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102814: [AIX] Print printable byte list as quoted string

2021-05-19 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added reviewers: PowerPC, hubert.reinterpretcast, DiggerLin, xingxue, 
shchenz.
Herald added subscribers: hiraditya, nemanjai.
jsji requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

.byte supports string, so if the whole byte list are printable,
we can actually print the string for readability and LIT tests maintainence.

  .byte 'H,'e,'l,'l,'o,',,' ,'w,'o,'r,'l,'d

->

  .byte "Hello, world"


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102814

Files:
  clang/test/CodeGenCXX/debug-info-byval.cpp
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll
  llvm/test/CodeGen/PowerPC/aix-exception.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
  llvm/test/DebugInfo/XCOFF/empty.ll
  llvm/test/DebugInfo/XCOFF/explicit-section.ll
  llvm/test/DebugInfo/XCOFF/function-sections.ll

Index: llvm/test/DebugInfo/XCOFF/function-sections.ll
===
--- llvm/test/DebugInfo/XCOFF/function-sections.ll
+++ llvm/test/DebugInfo/XCOFF/function-sections.ll
@@ -72,7 +72,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..foo0-.foo[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'f,'o,'o# Function Name
+; CHECK-NEXT:  .byte   "foo"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect .bar[PR],2
@@ -108,7 +108,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end1:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  L..sec_end0:
@@ -258,10 +258,10 @@
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g
+; CHECK-NEXT:  .byte   "debug"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
-; CHECK-NEXT:  .byte   '1,'.,'c
+; CHECK-NEXT:  .byte   "1.c"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
 ; CHECK-NEXT:  .byte   0
Index: llvm/test/DebugInfo/XCOFF/explicit-section.ll
===
--- llvm/test/DebugInfo/XCOFF/explicit-section.ll
+++ llvm/test/DebugInfo/XCOFF/explicit-section.ll
@@ -77,7 +77,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect explicit_main_sec[PR],2
@@ -125,7 +125,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..main0-.main   # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0004   # Function name len = 4
-; CHECK-NEXT:  .byte   'm,'a,'i,'n # Function Name
+; CHECK-NEXT:  .byte   "main"  # Function Name
 ; CHECK-NEXT:  L..func_end1:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  L..sec_end0:
@@ -271,10 +271,10 @@
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g
+; CHECK-NEXT:  .byte   "debug"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
-; CHECK-NEXT:  .byte   '2,'.,'c
+; CHECK-NEXT:  .byte   "2.c"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
 ; CHECK-NEXT:  .byte   0
Index: llvm/test/DebugInfo/XCOFF/empty.ll
===
--- llvm/test/DebugInfo/XCOFF/empty.ll
+++ llvm/test/DebugInfo/XCOFF/empty.ll
@@ -71,

[PATCH] D102724: Revert "[AIX] Avoid structor alias; die before bad alias codegen"

2021-05-19 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D102724#2769756 , @jasonliu wrote:

> Good idea, fyi, this is the patch: https://reviews.llvm.org/D83252

Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102724/new/

https://reviews.llvm.org/D102724

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102814: [AIX] Print printable byte list as quoted string

2021-05-20 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 346794.
jsji added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102814/new/

https://reviews.llvm.org/D102814

Files:
  clang/test/CodeGenCXX/debug-info-byval.cpp
  llvm/include/llvm/MC/MCAsmInfo.h
  llvm/lib/MC/MCAsmInfoXCOFF.cpp
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll
  llvm/test/CodeGen/PowerPC/aix-exception.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
  llvm/test/DebugInfo/XCOFF/empty.ll
  llvm/test/DebugInfo/XCOFF/explicit-section.ll
  llvm/test/DebugInfo/XCOFF/function-sections.ll

Index: llvm/test/DebugInfo/XCOFF/function-sections.ll
===
--- llvm/test/DebugInfo/XCOFF/function-sections.ll
+++ llvm/test/DebugInfo/XCOFF/function-sections.ll
@@ -72,7 +72,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..foo0-.foo[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'f,'o,'o# Function Name
+; CHECK-NEXT:  .byte   "foo"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect .bar[PR],2
@@ -108,7 +108,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end1:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  L..sec_end0:
@@ -258,10 +258,10 @@
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g
+; CHECK-NEXT:  .byte   "debug"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
-; CHECK-NEXT:  .byte   '1,'.,'c
+; CHECK-NEXT:  .byte   "1.c"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
 ; CHECK-NEXT:  .byte   0
Index: llvm/test/DebugInfo/XCOFF/explicit-section.ll
===
--- llvm/test/DebugInfo/XCOFF/explicit-section.ll
+++ llvm/test/DebugInfo/XCOFF/explicit-section.ll
@@ -77,7 +77,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect explicit_main_sec[PR],2
@@ -125,7 +125,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..main0-.main   # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0004   # Function name len = 4
-; CHECK-NEXT:  .byte   'm,'a,'i,'n # Function Name
+; CHECK-NEXT:  .byte   "main"  # Function Name
 ; CHECK-NEXT:  L..func_end1:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  L..sec_end0:
@@ -271,10 +271,10 @@
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g
+; CHECK-NEXT:  .byte   "debug"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
-; CHECK-NEXT:  .byte   '2,'.,'c
+; CHECK-NEXT:  .byte   "2.c"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
 ; CHECK-NEXT:  .byte   0
Index: llvm/test/DebugInfo/XCOFF/empty.ll
===
--- llvm/test/DebugInfo/XCOFF/empty.ll
+++ llvm/test/DebugInfo/XCOFF/empty.ll
@@ -71,7 +71,7 @@
 ; ASM32-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; ASM32-NEXT:  .vbyte  4, L..main0-.main   # Function size
 ; ASM32-NEXT:  .vbyte  2, 0x0004   # Function name len = 4
-;

[PATCH] D102814: [AIX] Print printable byte list as quoted string

2021-05-20 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: llvm/lib/MC/MCAsmStreamer.cpp:1008
+  for (const unsigned char C : Data) {
+if (!isPrint(C))
+  return false;

This still need some slight change to deal with the ending 0 so that we can 
handle .string.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102814/new/

https://reviews.llvm.org/D102814

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102814: [AIX] Print printable byte list as quoted string

2021-05-20 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 346830.
jsji added a comment.

Update .string handling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102814/new/

https://reviews.llvm.org/D102814

Files:
  clang/test/CodeGenCXX/debug-info-byval.cpp
  llvm/include/llvm/MC/MCAsmInfo.h
  llvm/lib/MC/MCAsmInfoXCOFF.cpp
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll
  llvm/test/CodeGen/PowerPC/aix-exception.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-str.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
  llvm/test/DebugInfo/XCOFF/empty.ll
  llvm/test/DebugInfo/XCOFF/explicit-section.ll
  llvm/test/DebugInfo/XCOFF/function-sections.ll

Index: llvm/test/DebugInfo/XCOFF/function-sections.ll
===
--- llvm/test/DebugInfo/XCOFF/function-sections.ll
+++ llvm/test/DebugInfo/XCOFF/function-sections.ll
@@ -72,7 +72,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..foo0-.foo[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'f,'o,'o# Function Name
+; CHECK-NEXT:  .byte   "foo"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect .bar[PR],2
@@ -108,7 +108,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end1:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  L..sec_end0:
@@ -222,17 +222,17 @@
 ; CHECK:   .dwsect 0x7
 ; CHECK-NEXT:  L...dwstr:
 ; CHECK-NEXT:  L..info_string0:
-; CHECK-NEXT:  .byte   'c,'l,'a,'n,'g,' ,'v,'e,'r,'s,'i,'o,'n,' ,'1,'3,'.,'0,'.,'0, # string offset=0
+; CHECK-NEXT:  .string "clang version 13.0.0"  # string offset=0
 ; CHECK-NEXT:  L..info_string1:
-; CHECK-NEXT:  .byte   '1,'.,'c,   # string offset=21
+; CHECK-NEXT:  .string "1.c"   # string offset=21
 ; CHECK-NEXT:  L..info_string2:
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g, # string offset=25
+; CHECK-NEXT:  .string "debug" # string offset=25
 ; CHECK-NEXT:  L..info_string3:
-; CHECK-NEXT:  .byte   'f,'o,'o,   # string offset=31
+; CHECK-NEXT:  .string "foo"   # string offset=31
 ; CHECK-NEXT:  L..info_string4:
-; CHECK-NEXT:  .byte   'i,'n,'t,   # string offset=35
+; CHECK-NEXT:  .string "int"   # string offset=35
 ; CHECK-NEXT:  L..info_string5:
-; CHECK-NEXT:  .byte   'b,'a,'r,   # string offset=39
+; CHECK-NEXT:  .string "bar"   # string offset=39
 ; CHECK-NEXT:  .toc
 ; CHECK:   .dwsect 0x2
 ; CHECK-NEXT:  L...dwline:
@@ -258,10 +258,10 @@
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g
+; CHECK-NEXT:  .byte   "debug"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
-; CHECK-NEXT:  .byte   '1,'.,'c
+; CHECK-NEXT:  .byte   "1.c"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
 ; CHECK-NEXT:  .byte   0
Index: llvm/test/DebugInfo/XCOFF/explicit-section.ll
===
--- llvm/test/DebugInfo/XCOFF/explicit-section.ll
+++ llvm/test/DebugInfo/XCOFF/explicit-section.ll
@@ -77,7 +77,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect explicit_main_sec[PR]

[PATCH] D102814: [AIX] Print printable byte list as quoted string

2021-05-20 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: llvm/lib/MC/MCAsmStreamer.cpp:1008
+  for (const unsigned char C : Data) {
+if (!isPrint(C))
+  return false;

jsji wrote:
> This still need some slight change to deal with the ending 0 so that we can 
> handle .string.
Done.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102814/new/

https://reviews.llvm.org/D102814

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D102814: [AIX] Print printable byte list as quoted string

2021-05-20 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 346907.
jsji added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102814/new/

https://reviews.llvm.org/D102814

Files:
  clang/test/CodeGenCXX/debug-info-byval.cpp
  llvm/include/llvm/MC/MCAsmInfo.h
  llvm/lib/MC/MCAsmInfoXCOFF.cpp
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll
  llvm/test/CodeGen/PowerPC/aix-exception.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-str.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
  llvm/test/DebugInfo/XCOFF/empty.ll
  llvm/test/DebugInfo/XCOFF/explicit-section.ll
  llvm/test/DebugInfo/XCOFF/function-sections.ll

Index: llvm/test/DebugInfo/XCOFF/function-sections.ll
===
--- llvm/test/DebugInfo/XCOFF/function-sections.ll
+++ llvm/test/DebugInfo/XCOFF/function-sections.ll
@@ -72,7 +72,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..foo0-.foo[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'f,'o,'o# Function Name
+; CHECK-NEXT:  .byte   "foo"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect .bar[PR],2
@@ -108,7 +108,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end1:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  L..sec_end0:
@@ -222,17 +222,17 @@
 ; CHECK:   .dwsect 0x7
 ; CHECK-NEXT:  L...dwstr:
 ; CHECK-NEXT:  L..info_string0:
-; CHECK-NEXT:  .byte   'c,'l,'a,'n,'g,' ,'v,'e,'r,'s,'i,'o,'n,' ,'1,'3,'.,'0,'.,'0, # string offset=0
+; CHECK-NEXT:  .string "clang version 13.0.0"  # string offset=0
 ; CHECK-NEXT:  L..info_string1:
-; CHECK-NEXT:  .byte   '1,'.,'c,   # string offset=21
+; CHECK-NEXT:  .string "1.c"   # string offset=21
 ; CHECK-NEXT:  L..info_string2:
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g, # string offset=25
+; CHECK-NEXT:  .string "debug" # string offset=25
 ; CHECK-NEXT:  L..info_string3:
-; CHECK-NEXT:  .byte   'f,'o,'o,   # string offset=31
+; CHECK-NEXT:  .string "foo"   # string offset=31
 ; CHECK-NEXT:  L..info_string4:
-; CHECK-NEXT:  .byte   'i,'n,'t,   # string offset=35
+; CHECK-NEXT:  .string "int"   # string offset=35
 ; CHECK-NEXT:  L..info_string5:
-; CHECK-NEXT:  .byte   'b,'a,'r,   # string offset=39
+; CHECK-NEXT:  .string "bar"   # string offset=39
 ; CHECK-NEXT:  .toc
 ; CHECK:   .dwsect 0x2
 ; CHECK-NEXT:  L...dwline:
@@ -258,10 +258,10 @@
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g
+; CHECK-NEXT:  .byte   "debug"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
-; CHECK-NEXT:  .byte   '1,'.,'c
+; CHECK-NEXT:  .byte   "1.c"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
 ; CHECK-NEXT:  .byte   0
Index: llvm/test/DebugInfo/XCOFF/explicit-section.ll
===
--- llvm/test/DebugInfo/XCOFF/explicit-section.ll
+++ llvm/test/DebugInfo/XCOFF/explicit-section.ll
@@ -77,7 +77,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect explicit_main_sec[PR],2
@@ -

[PATCH] D102814: [AIX] Print printable byte list as quoted string

2021-05-20 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGedf4d69d3888: [AIX] Print printable byte list as quoted 
string (authored by jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102814/new/

https://reviews.llvm.org/D102814

Files:
  clang/test/CodeGenCXX/debug-info-byval.cpp
  llvm/include/llvm/MC/MCAsmInfo.h
  llvm/lib/MC/MCAsmInfoXCOFF.cpp
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll
  llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll
  llvm/test/CodeGen/PowerPC/aix-exception.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-str.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
  llvm/test/DebugInfo/XCOFF/empty.ll
  llvm/test/DebugInfo/XCOFF/explicit-section.ll
  llvm/test/DebugInfo/XCOFF/function-sections.ll

Index: llvm/test/DebugInfo/XCOFF/function-sections.ll
===
--- llvm/test/DebugInfo/XCOFF/function-sections.ll
+++ llvm/test/DebugInfo/XCOFF/function-sections.ll
@@ -72,7 +72,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..foo0-.foo[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'f,'o,'o# Function Name
+; CHECK-NEXT:  .byte   "foo"   # Function Name
 ; CHECK-NEXT:  L..func_end0:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  .csect .bar[PR],2
@@ -108,7 +108,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar[PR] # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT:  L..func_end1:
 ; CHECK-NEXT:  # -- End function
 ; CHECK-NEXT:  L..sec_end0:
@@ -222,17 +222,17 @@
 ; CHECK:   .dwsect 0x7
 ; CHECK-NEXT:  L...dwstr:
 ; CHECK-NEXT:  L..info_string0:
-; CHECK-NEXT:  .byte   'c,'l,'a,'n,'g,' ,'v,'e,'r,'s,'i,'o,'n,' ,'1,'3,'.,'0,'.,'0, # string offset=0
+; CHECK-NEXT:  .string "clang version 13.0.0"  # string offset=0
 ; CHECK-NEXT:  L..info_string1:
-; CHECK-NEXT:  .byte   '1,'.,'c,   # string offset=21
+; CHECK-NEXT:  .string "1.c"   # string offset=21
 ; CHECK-NEXT:  L..info_string2:
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g, # string offset=25
+; CHECK-NEXT:  .string "debug" # string offset=25
 ; CHECK-NEXT:  L..info_string3:
-; CHECK-NEXT:  .byte   'f,'o,'o,   # string offset=31
+; CHECK-NEXT:  .string "foo"   # string offset=31
 ; CHECK-NEXT:  L..info_string4:
-; CHECK-NEXT:  .byte   'i,'n,'t,   # string offset=35
+; CHECK-NEXT:  .string "int"   # string offset=35
 ; CHECK-NEXT:  L..info_string5:
-; CHECK-NEXT:  .byte   'b,'a,'r,   # string offset=39
+; CHECK-NEXT:  .string "bar"   # string offset=39
 ; CHECK-NEXT:  .toc
 ; CHECK:   .dwsect 0x2
 ; CHECK-NEXT:  L...dwline:
@@ -258,10 +258,10 @@
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
-; CHECK-NEXT:  .byte   'd,'e,'b,'u,'g
+; CHECK-NEXT:  .byte   "debug"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   0
-; CHECK-NEXT:  .byte   '1,'.,'c
+; CHECK-NEXT:  .byte   "1.c"
 ; CHECK-NEXT:  .byte   0
 ; CHECK-NEXT:  .byte   1
 ; CHECK-NEXT:  .byte   0
Index: llvm/test/DebugInfo/XCOFF/explicit-section.ll
===
--- llvm/test/DebugInfo/XCOFF/explicit-section.ll
+++ llvm/test/DebugInfo/XCOFF/explicit-section.ll
@@ -77,7 +77,7 @@
 ; CHECK-NEXT:  .byte   0x01# NumberOfFPParms = 0, +HasParmsOnStack
 ; CHECK-NEXT:  .vbyte  4, L..bar0-.bar # Function size
 ; CHECK-NEXT:  .vbyte  2, 0x0003   # Function name len = 3
-; CHECK-NEXT:  .byte   'b,'a,'r# Function Name
+; CHECK-NEXT:  .byte   "bar"   # Function Name
 ; CHECK-NEXT: 

[PATCH] D99901: [Driver][test] Test intended target only

2021-05-28 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D99901#2787034 , @ted wrote:

> Why would we not want to support this on other targets, like Arm? Fixes for 
> AIX shouldn't impact other things.

Feel free to update the triple to include arm , as long as the tests focus on 
gnu tool chain only.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99901/new/

https://reviews.llvm.org/D99901

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji created this revision.
jsji added reviewers: PowerPC, Whitney, w2yehia, MaskRay.
Herald added subscribers: wenlei, hiraditya, inglorion.
jsji requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

On AIX, we relied on LTO to merge the csects for profiling data/counter
sections.

AIX binder now get the namedcsect support to support the merging,
so now we can enable PGO without LTO with the new binder.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110422

Files:
  clang/lib/Driver/ToolChains/AIX.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/unsupported-option.c
  clang/test/Profile/cxx-templates.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/profiling.ll

Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===
--- llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ llvm/test/Instrumentation/InstrProfiling/profiling.ll
@@ -45,8 +45,8 @@
 ; MACHO: @__profd_foo_weak = weak hidden global
 ; COFF: @__profc_foo_weak = weak hidden global
 ; COFF: @__profd_foo_weak = private global
-; XCOFF: @__profc_foo_weak = weak hidden global
-; XCOFF: @__profd_foo_weak = weak hidden global
+; XCOFF: @__profc_foo_weak = private global
+; XCOFF: @__profd_foo_weak = private global
 define weak void @foo_weak() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -71,8 +71,8 @@
 ; MACHO: @__profd_foo_inline = linkonce_odr hidden global
 ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section ".lprfc$M", align 8
 ; COFF: @__profd_foo_inline = private global{{.*}} section ".lprfd$M", align 8
-; XCOFF: @__profc_foo_inline = linkonce_odr hidden global
-; XCOFF: @__profd_foo_inline = linkonce_odr hidden global
+; XCOFF: @__profc_foo_inline = private global
+; XCOFF: @__profd_foo_inline = private global
 define linkonce_odr void @foo_inline() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -84,8 +84,8 @@
 ; MACHO: @__profd_foo_extern = linkonce_odr hidden global
 ; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfc$M", comdat, align 8
 ; COFF: @__profd_foo_extern = private global {{.*}}section ".lprfd$M", comdat($__profc_foo_extern), align 8
-; XCOFF: @__profc_foo_extern = linkonce_odr hidden global
-; XCOFF: @__profd_foo_extern = linkonce_odr hidden global
+; XCOFF: @__profc_foo_extern = private global
+; XCOFF: @__profd_foo_extern = private global
 define available_externally void @foo_extern() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -862,6 +862,15 @@
   GlobalValue::LinkageTypes Linkage = NamePtr->getLinkage();
   GlobalValue::VisibilityTypes Visibility = NamePtr->getVisibility();
 
+  // Due to the current limitation of binder, the duplicate weak symbols in the
+  // same csect won't be discarded. When there are duplicate weak symbols,
+  // we can NOT guarantee that the relocations get resolved to the intended weak
+  // symbol, so we can not ensure the correctness of the relative CounterPtr, so
+  // we have to use private linkage for counter and data symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
   // Move the name variable to the right section. Place them in a COMDAT group
   // if the associated function is a COMDAT. This will make sure that only one
   // copy of counters of the COMDAT function will be emitted after linking. Keep
@@ -966,7 +975,7 @@
   // that other copies must have the same CFG and cannot have value profiling.
   // If no hash suffix, other profd copies may be referenced by code.
   if (NS == 0 && !(DataReferencedByCode && NeedComdat && !Renamed) &&
-  (TT.isOSBinFormatELF() ||
+  (TT.isOSBinFormatELF() || TT.isOSBinFormatXCOFF() ||
(!DataReferencedByCode && TT.isOSBinFormatCOFF( {
 Linkage = GlobalValue::PrivateLinkage;
 Visibility = GlobalValue::DefaultVisibility;
Index: clang/test/Profile/cxx-templates.cpp
===
--- clang/test/Profile/cxx-templates.cpp
+++ clang/test/Profile/cxx-templates.cpp
@@ -10,8 +10,10 @@
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-pref

[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 374867.
jsji added a comment.

Restore the limitation of sample profiling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

Files:
  clang/lib/Driver/ToolChains/AIX.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/unsupported-option.c
  clang/test/Profile/cxx-templates.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/profiling.ll

Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===
--- llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ llvm/test/Instrumentation/InstrProfiling/profiling.ll
@@ -45,8 +45,8 @@
 ; MACHO: @__profd_foo_weak = weak hidden global
 ; COFF: @__profc_foo_weak = weak hidden global
 ; COFF: @__profd_foo_weak = private global
-; XCOFF: @__profc_foo_weak = weak hidden global
-; XCOFF: @__profd_foo_weak = weak hidden global
+; XCOFF: @__profc_foo_weak = private global
+; XCOFF: @__profd_foo_weak = private global
 define weak void @foo_weak() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -71,8 +71,8 @@
 ; MACHO: @__profd_foo_inline = linkonce_odr hidden global
 ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section ".lprfc$M", align 8
 ; COFF: @__profd_foo_inline = private global{{.*}} section ".lprfd$M", align 8
-; XCOFF: @__profc_foo_inline = linkonce_odr hidden global
-; XCOFF: @__profd_foo_inline = linkonce_odr hidden global
+; XCOFF: @__profc_foo_inline = private global
+; XCOFF: @__profd_foo_inline = private global
 define linkonce_odr void @foo_inline() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -84,8 +84,8 @@
 ; MACHO: @__profd_foo_extern = linkonce_odr hidden global
 ; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfc$M", comdat, align 8
 ; COFF: @__profd_foo_extern = private global {{.*}}section ".lprfd$M", comdat($__profc_foo_extern), align 8
-; XCOFF: @__profc_foo_extern = linkonce_odr hidden global
-; XCOFF: @__profd_foo_extern = linkonce_odr hidden global
+; XCOFF: @__profc_foo_extern = private global
+; XCOFF: @__profd_foo_extern = private global
 define available_externally void @foo_extern() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -862,6 +862,15 @@
   GlobalValue::LinkageTypes Linkage = NamePtr->getLinkage();
   GlobalValue::VisibilityTypes Visibility = NamePtr->getVisibility();
 
+  // Due to the current limitation of binder, the duplicate weak symbols in the
+  // same csect won't be discarded. When there are duplicate weak symbols,
+  // we can NOT guarantee that the relocations get resolved to the intended weak
+  // symbol, so we can not ensure the correctness of the relative CounterPtr, so
+  // we have to use private linkage for counter and data symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
   // Move the name variable to the right section. Place them in a COMDAT group
   // if the associated function is a COMDAT. This will make sure that only one
   // copy of counters of the COMDAT function will be emitted after linking. Keep
@@ -966,7 +975,7 @@
   // that other copies must have the same CFG and cannot have value profiling.
   // If no hash suffix, other profd copies may be referenced by code.
   if (NS == 0 && !(DataReferencedByCode && NeedComdat && !Renamed) &&
-  (TT.isOSBinFormatELF() ||
+  (TT.isOSBinFormatELF() || TT.isOSBinFormatXCOFF() ||
(!DataReferencedByCode && TT.isOSBinFormatCOFF( {
 Linkage = GlobalValue::PrivateLinkage;
 Visibility = GlobalValue::DefaultVisibility;
Index: clang/test/Profile/cxx-templates.cpp
===
--- clang/test/Profile/cxx-templates.cpp
+++ clang/test/Profile/cxx-templates.cpp
@@ -10,8 +10,10 @@
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s
 
-// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = linkonce_odr {{(hidden|dso_local)}} global [2 x i64] zeroinitializer
-// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = linkonce_odr {{(hidden|dso_local)}} global [2 x i64] zeroinitializer
+// The linkage can be target dependent, so accept all

[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 374879.
jsji added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

Files:
  clang/lib/Driver/ToolChains/AIX.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/unsupported-option.c
  clang/test/Profile/cxx-templates.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/profiling.ll

Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===
--- llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ llvm/test/Instrumentation/InstrProfiling/profiling.ll
@@ -45,8 +45,8 @@
 ; MACHO: @__profd_foo_weak = weak hidden global
 ; COFF: @__profc_foo_weak = weak hidden global
 ; COFF: @__profd_foo_weak = private global
-; XCOFF: @__profc_foo_weak = weak hidden global
-; XCOFF: @__profd_foo_weak = weak hidden global
+; XCOFF: @__profc_foo_weak = private global
+; XCOFF: @__profd_foo_weak = private global
 define weak void @foo_weak() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -71,8 +71,8 @@
 ; MACHO: @__profd_foo_inline = linkonce_odr hidden global
 ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section ".lprfc$M", align 8
 ; COFF: @__profd_foo_inline = private global{{.*}} section ".lprfd$M", align 8
-; XCOFF: @__profc_foo_inline = linkonce_odr hidden global
-; XCOFF: @__profd_foo_inline = linkonce_odr hidden global
+; XCOFF: @__profc_foo_inline = private global
+; XCOFF: @__profd_foo_inline = private global
 define linkonce_odr void @foo_inline() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -84,8 +84,8 @@
 ; MACHO: @__profd_foo_extern = linkonce_odr hidden global
 ; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfc$M", comdat, align 8
 ; COFF: @__profd_foo_extern = private global {{.*}}section ".lprfd$M", comdat($__profc_foo_extern), align 8
-; XCOFF: @__profc_foo_extern = linkonce_odr hidden global
-; XCOFF: @__profd_foo_extern = linkonce_odr hidden global
+; XCOFF: @__profc_foo_extern = private global
+; XCOFF: @__profd_foo_extern = private global
 define available_externally void @foo_extern() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -862,6 +862,15 @@
   GlobalValue::LinkageTypes Linkage = NamePtr->getLinkage();
   GlobalValue::VisibilityTypes Visibility = NamePtr->getVisibility();
 
+  // Due to the current limitation of binder, the duplicate weak symbols in the
+  // same csect won't be discarded. When there are duplicate weak symbols,
+  // we can NOT guarantee that the relocations get resolved to the intended weak
+  // symbol, so we can not ensure the correctness of the relative CounterPtr, so
+  // we have to use private linkage for counter and data symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
   // Move the name variable to the right section. Place them in a COMDAT group
   // if the associated function is a COMDAT. This will make sure that only one
   // copy of counters of the COMDAT function will be emitted after linking. Keep
@@ -971,6 +980,17 @@
 Linkage = GlobalValue::PrivateLinkage;
 Visibility = GlobalValue::DefaultVisibility;
   }
+
+  // Due to the current limitation of binder, the duplicate weak symbols in the
+  // same csect won't be discarded. When there are duplicate weak symbols,
+  // we can NOT guarantee that the relocations get resolved to the intended weak
+  // symbol, so we can not ensure the correctness of the relative CounterPtr, so
+  // we have to use private linkage for counter and data symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
+
   auto *Data =
   new GlobalVariable(*M, DataTy, false, Linkage, nullptr, DataVarName);
   // Reference the counter variable with a label difference (link-time
Index: clang/test/Profile/cxx-templates.cpp
===
--- clang/test/Profile/cxx-templates.cpp
+++ clang/test/Profile/cxx-templates.cpp
@@ -10,8 +10,10 @@
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s

[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:869
+  // symbol, so we can not ensure the correctness of the relative CounterPtr, 
so
+  // we have to use private linkage for counter and data symbols.
+  if (TT.isOSBinFormatXCOFF()) {

MaskRay wrote:
> Then you can just keep the existing weak symbols.
> 
> The weak symbols will not be selected due to linker semantics.
Not sure what you meant? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added inline comments.



Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:869
+  // symbol, so we can not ensure the correctness of the relative CounterPtr, 
so
+  // we have to use private linkage for counter and data symbols.
+  if (TT.isOSBinFormatXCOFF()) {

jsji wrote:
> MaskRay wrote:
> > Then you can just keep the existing weak symbols.
> > 
> > The weak symbols will not be selected due to linker semantics.
> Not sure what you meant? 
To be clear, keeping the weak linkage is causing issues in our test, and we 
investigate the problem , together with AIX binder owner, and it is the 
limitation in binder support that we can't ensure the relocation getting 
resolved to the intended weak symbol. So this is what we can do right now for 
enabling PGO.

We may be able to lift it this limitation later if binder get updated and do 
what we want, but this is limitation for now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

> In other binary formats the first weak definition is selected and other weak 
> definitions are discarded.
> Do you mean that AIX ld doesn't pick the first weak definition?

No. I think this is exactly what is causing problem here.

eg: if we have two weak symbols (weak_func), and we generate the weak 
counter/data as usual:

  __llvm_prf_cnts:
  
  __profc_weak_func(1):
  
  __profc_weak_func(2):
  
  __llvm_prf_data:
  
  __profd_weak func(1):
  
  Pos_Rel __profc_weak_func  <=== Relocation to calculate the relative pointer
  
  __profd_weak_func(2):
  
  Pos_Rel __profc_weak_func  <=== Relocation to calculate the relative pointer

The relative pointer calculation in __profd_weak_fun will be wrong after 
linking.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Pos_Rel __profc_weak_func notation is just the normal relocation to symbol 
__profc_weak_func.

The relocation here is to calculate the relative pointer (offset) to 
__profc__weak_func from __profd__weak__func.

In example above, the offsets value after binding will be the same for both 
instances, as the symbol __profc__weak__func will be the one that is chosen by 
binder. Let us say it is the value of first instances.

Then when we calculate the profc_weak_func pointer for 2nd instances, we get 
garbage value.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D110422#3021535 , @MaskRay wrote:

> The description is still unclear.
>
> Say a.o has a weak `foo, __profc_foo, __profd_foo`, b.o has a weak `foo, 
> __profc_foo, __profd_foo`.
> The linker picks the definitions from `a.o`. In the PGO implementation, it 
> doesn't whether the non-discarded b.o `__profd_foo` has garbage value.

We have 3 sets weak symbols here: weak_func, profc_weak_foo, profd_weak_func. 
We can't ensure that binder always choose 3 of them from same object.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

We have verified all the profile counters in SPEC , all are OK.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-24 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

Using to `PrivateLinkage`, all the profc/profd for each weak symbol will be 
*local* to objects, and all kept in the csect,
so we won't have problem.

The downside is that we won't be able to discard the duplicated counters and 
profile data,
but those can not be discarded even if we keep the weak linkage,
due to the binder limitation of not discarding only part of the csect either .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

@MaskRay Do you have further comments or alternative solutions? Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

In D110422#3025133 , @MaskRay wrote:

> The description isn't clear why the previous `weak` symbol usage does not 
> work. Have you verified that it does not work?

Yes, we started with the `weak` symbols for `profc`/`profd` first, and tested 
it. We met problems, and we spent time investigate why they are not working.

I have update the description to include most of the details. Let me know if it 
is still unclear.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

OK, I may not describe the example clearly.

Let me use example code with offsets and llvm internal calculations as the 
example, so that you might be clearer.

Let us say we have 2 objects , which both have weak function foo (and some 
non-weak functions).

  [2054]  m   0x11ec0 .data 1  unamex
__llvm_prf_cnts
  [2056]  m   0x11ef8 .data 1weak
__profc__foo
  [1389]  m   0x110001540 .data 1  unamex
__llvm_prf_cnts
  [1391]  m   0x1100015a8 .data 1weak
__profc__foo<== chosen by binder
  
  [2290]  m   0x110001ca8 .data 1  unamex
__llvm_prf_data
  [2292]  m   0x110001ce0 .data 1weak
__profd__foo
  [1633]  m   0x110003678 .data 1  unamex
__llvm_prf_data
  [1635]  m   0x1100036b0 .data 1weak
__profd__foo<===  chosen by binder

In binding, binder chose 0x1100015a8 for `__profc__foo`, and 0x1100036b0 for 
`__profd__foo`. 
(Not the 1st in the csect, but 1st seen by binder)

At the beginning `CountersDelta` is 0xf218. ( 0x11ec0 [2054]  - 
0x110001ca8 [2290] ) .

The first record is for non-weak function, so we are OK.

Then we move forward to read foo counters, 
`CountersDelta` is then updated to 0xf1e0 ( 0xf218 - 
sizeof(Data))
`CounterPtr` is now 0x1100015a8 - 0x1100036b0 = 0xdef8

CountersOffset is now 0x1da3  ( CounterPtr - CountersDelta / 
sizeof(unit64_6))

CountersOffset > MaxNumCounters !

If we have more weak symbols, the symbols chosen by binder may be  interleaving 
in the csects,
we won't be able to calculate the CountersOffset correctly for all of them.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

> "as binder can NOT discard only part of a csect." this part caused confusion 
> to me...

OK, yeah, csect is special to XCOFF, so this is not the same concept of 
sections in ELF.

> I haven't verified but it is possible that PGO picks the first pair (zero 
> value) and have an incorrect counter for `foo`.

As I mentioned before, we verified (with `llvm-profdata show --all-functions 
--counts`) that all the counters are good.

> ---
>
> Does your example imply that the weak symbol `__profc_foo` has 2 definitions 
> with conflicting values?

No, they are identical weak functions.  Those offsets are actually from real 
example using `std::stringbuf`, 
the foo is actually 
`_ZNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEC2Ej`.

> Any idea whether the linker bug will be fixed?

Unfortunately, I just double confirmed with AIX linker (binder) owner, 
there is NO plan of lifting the limitation that binder can NOT discard only 
part of a csect.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-27 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

> "as binder can NOT discard a subset of a csect."?

Thanks, this does looks better!

> The linker (binder) doesn't have to discard a subset of csect, but it should 
> ensure there are not two non-local symbols with the same name.
> The latter is what I request.



> Without section deduplication we just end up with PDP-11 a.out extended with 
> .weak directive, it isn't too bad. Mach-O uses this model as well.
> (PE-COFF/ELF properly deduplicates in the absence of section based GC.)
> Having two non-local symbols could cause serious symbol resolution problems.

That I can definitely forward to AIX binder team, but we can't expect they 
implement it right away for us.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Enable PGO without LTO

2021-09-28 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 375688.
jsji marked an inline comment as done.
jsji added a comment.

Address comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

Files:
  clang/lib/Driver/ToolChains/AIX.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/unsupported-option.c
  clang/test/Profile/cxx-templates.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/profiling.ll

Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===
--- llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ llvm/test/Instrumentation/InstrProfiling/profiling.ll
@@ -45,8 +45,8 @@
 ; MACHO: @__profd_foo_weak = weak hidden global
 ; COFF: @__profc_foo_weak = weak hidden global
 ; COFF: @__profd_foo_weak = private global
-; XCOFF: @__profc_foo_weak = weak hidden global
-; XCOFF: @__profd_foo_weak = weak hidden global
+; XCOFF: @__profc_foo_weak = private global
+; XCOFF: @__profd_foo_weak = private global
 define weak void @foo_weak() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -71,8 +71,8 @@
 ; MACHO: @__profd_foo_inline = linkonce_odr hidden global
 ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section ".lprfc$M", align 8
 ; COFF: @__profd_foo_inline = private global{{.*}} section ".lprfd$M", align 8
-; XCOFF: @__profc_foo_inline = linkonce_odr hidden global
-; XCOFF: @__profd_foo_inline = linkonce_odr hidden global
+; XCOFF: @__profc_foo_inline = private global
+; XCOFF: @__profd_foo_inline = private global
 define linkonce_odr void @foo_inline() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -84,8 +84,8 @@
 ; MACHO: @__profd_foo_extern = linkonce_odr hidden global
 ; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfc$M", comdat, align 8
 ; COFF: @__profd_foo_extern = private global {{.*}}section ".lprfd$M", comdat($__profc_foo_extern), align 8
-; XCOFF: @__profc_foo_extern = linkonce_odr hidden global
-; XCOFF: @__profd_foo_extern = linkonce_odr hidden global
+; XCOFF: @__profc_foo_extern = private global
+; XCOFF: @__profd_foo_extern = private global
 define available_externally void @foo_extern() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -862,6 +862,15 @@
   GlobalValue::LinkageTypes Linkage = NamePtr->getLinkage();
   GlobalValue::VisibilityTypes Visibility = NamePtr->getVisibility();
 
+  // Due to the limitation of binder as of 2021/09/28, the duplicate weak
+  // symbols in the same csect won't be discarded. When there are duplicate weak
+  // symbols, we can NOT guarantee that the relocations get resolved to the
+  // intended weak symbol, so we can not ensure the correctness of the relative
+  // CounterPtr, so we have to use private linkage for counter and data symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
   // Move the name variable to the right section. Place them in a COMDAT group
   // if the associated function is a COMDAT. This will make sure that only one
   // copy of counters of the COMDAT function will be emitted after linking. Keep
@@ -971,6 +980,17 @@
 Linkage = GlobalValue::PrivateLinkage;
 Visibility = GlobalValue::DefaultVisibility;
   }
+
+  // Due to the limitation of binder as of 2021/09/28, the duplicate weak
+  // symbols in the same csect won't be discarded. When there are duplicate weak
+  // symbols, we can NOT guarantee that the relocations get resolved to the
+  // intended weak symbol, so we can not ensure the correctness of the relative
+  // CounterPtr, so we have to use private linkage for counter and data symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
+
   auto *Data =
   new GlobalVariable(*M, DataTy, false, Linkage, nullptr, DataVarName);
   // Reference the counter variable with a label difference (link-time
Index: clang/test/Profile/cxx-templates.cpp
===
--- clang/test/Profile/cxx-templates.cpp
+++ clang/test/Profile/cxx-templates.cpp
@@ -10,8 +10,10 @@
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --in

[PATCH] D110422: [AIX] Change the linkage of profiling counter/data to be private

2021-09-28 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 375709.
jsji added a comment.

Split the Driver changes to another patch, also fixed the duplicate code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

Files:
  clang/test/Profile/cxx-templates.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/profiling.ll


Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===
--- llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ llvm/test/Instrumentation/InstrProfiling/profiling.ll
@@ -45,8 +45,8 @@
 ; MACHO: @__profd_foo_weak = weak hidden global
 ; COFF: @__profc_foo_weak = weak hidden global
 ; COFF: @__profd_foo_weak = private global
-; XCOFF: @__profc_foo_weak = weak hidden global
-; XCOFF: @__profd_foo_weak = weak hidden global
+; XCOFF: @__profc_foo_weak = private global
+; XCOFF: @__profd_foo_weak = private global
 define weak void @foo_weak() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 
x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -71,8 +71,8 @@
 ; MACHO: @__profd_foo_inline = linkonce_odr hidden global
 ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section 
".lprfc$M", align 8
 ; COFF: @__profd_foo_inline = private global{{.*}} section ".lprfd$M", align 8
-; XCOFF: @__profc_foo_inline = linkonce_odr hidden global
-; XCOFF: @__profd_foo_inline = linkonce_odr hidden global
+; XCOFF: @__profc_foo_inline = private global
+; XCOFF: @__profd_foo_inline = private global
 define linkonce_odr void @foo_inline() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], 
[10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -84,8 +84,8 @@
 ; MACHO: @__profd_foo_extern = linkonce_odr hidden global
 ; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section 
".lprfc$M", comdat, align 8
 ; COFF: @__profd_foo_extern = private global {{.*}}section ".lprfd$M", 
comdat($__profc_foo_extern), align 8
-; XCOFF: @__profc_foo_extern = linkonce_odr hidden global
-; XCOFF: @__profd_foo_extern = linkonce_odr hidden global
+; XCOFF: @__profc_foo_extern = private global
+; XCOFF: @__profd_foo_extern = private global
 define available_externally void @foo_extern() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], 
[10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -862,6 +862,15 @@
   GlobalValue::LinkageTypes Linkage = NamePtr->getLinkage();
   GlobalValue::VisibilityTypes Visibility = NamePtr->getVisibility();
 
+  // Due to the limitation of binder as of 2021/09/28, the duplicate weak
+  // symbols in the same csect won't be discarded. When there are duplicate 
weak
+  // symbols, we can NOT guarantee that the relocations get resolved to the
+  // intended weak symbol, so we can not ensure the correctness of the relative
+  // CounterPtr, so we have to use private linkage for counter and data 
symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
   // Move the name variable to the right section. Place them in a COMDAT group
   // if the associated function is a COMDAT. This will make sure that only one
   // copy of counters of the COMDAT function will be emitted after linking. 
Keep
@@ -971,6 +980,7 @@
 Linkage = GlobalValue::PrivateLinkage;
 Visibility = GlobalValue::DefaultVisibility;
   }
+
   auto *Data =
   new GlobalVariable(*M, DataTy, false, Linkage, nullptr, DataVarName);
   // Reference the counter variable with a label difference (link-time
Index: clang/test/Profile/cxx-templates.cpp
===
--- clang/test/Profile/cxx-templates.cpp
+++ clang/test/Profile/cxx-templates.cpp
@@ -10,8 +10,10 @@
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s
 
-// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = linkonce_odr 
{{(hidden|dso_local)}} global [2 x i64] zeroinitializer
-// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = linkonce_odr 
{{(hidden|dso_local)}} global [2 x i64] zeroinitializer
+// The linkage can be target dependent, so accept all linkage here,
+// the linkage tests for different target are in 
llvm/test/Instrumentation/InstrProfiling/profiling.ll
+// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = {{.*}} global [2 x i64] 
zeroinitializer
+// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = {{.*}} global 

[PATCH] D110422: [AIX] Change the linkage of profiling counter/data to be private

2021-09-28 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 375716.
jsji added a comment.

Remove empty line.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

Files:
  clang/test/Profile/cxx-templates.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/profiling.ll


Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===
--- llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ llvm/test/Instrumentation/InstrProfiling/profiling.ll
@@ -45,8 +45,8 @@
 ; MACHO: @__profd_foo_weak = weak hidden global
 ; COFF: @__profc_foo_weak = weak hidden global
 ; COFF: @__profd_foo_weak = private global
-; XCOFF: @__profc_foo_weak = weak hidden global
-; XCOFF: @__profd_foo_weak = weak hidden global
+; XCOFF: @__profc_foo_weak = private global
+; XCOFF: @__profd_foo_weak = private global
 define weak void @foo_weak() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 
x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -71,8 +71,8 @@
 ; MACHO: @__profd_foo_inline = linkonce_odr hidden global
 ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section 
".lprfc$M", align 8
 ; COFF: @__profd_foo_inline = private global{{.*}} section ".lprfd$M", align 8
-; XCOFF: @__profc_foo_inline = linkonce_odr hidden global
-; XCOFF: @__profd_foo_inline = linkonce_odr hidden global
+; XCOFF: @__profc_foo_inline = private global
+; XCOFF: @__profd_foo_inline = private global
 define linkonce_odr void @foo_inline() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], 
[10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -84,8 +84,8 @@
 ; MACHO: @__profd_foo_extern = linkonce_odr hidden global
 ; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section 
".lprfc$M", comdat, align 8
 ; COFF: @__profd_foo_extern = private global {{.*}}section ".lprfd$M", 
comdat($__profc_foo_extern), align 8
-; XCOFF: @__profc_foo_extern = linkonce_odr hidden global
-; XCOFF: @__profd_foo_extern = linkonce_odr hidden global
+; XCOFF: @__profc_foo_extern = private global
+; XCOFF: @__profd_foo_extern = private global
 define available_externally void @foo_extern() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], 
[10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -862,6 +862,15 @@
   GlobalValue::LinkageTypes Linkage = NamePtr->getLinkage();
   GlobalValue::VisibilityTypes Visibility = NamePtr->getVisibility();
 
+  // Due to the limitation of binder as of 2021/09/28, the duplicate weak
+  // symbols in the same csect won't be discarded. When there are duplicate 
weak
+  // symbols, we can NOT guarantee that the relocations get resolved to the
+  // intended weak symbol, so we can not ensure the correctness of the relative
+  // CounterPtr, so we have to use private linkage for counter and data 
symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
   // Move the name variable to the right section. Place them in a COMDAT group
   // if the associated function is a COMDAT. This will make sure that only one
   // copy of counters of the COMDAT function will be emitted after linking. 
Keep
Index: clang/test/Profile/cxx-templates.cpp
===
--- clang/test/Profile/cxx-templates.cpp
+++ clang/test/Profile/cxx-templates.cpp
@@ -10,8 +10,10 @@
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s
 
-// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = linkonce_odr 
{{(hidden|dso_local)}} global [2 x i64] zeroinitializer
-// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = linkonce_odr 
{{(hidden|dso_local)}} global [2 x i64] zeroinitializer
+// The linkage can be target dependent, so accept all linkage here,
+// the linkage tests for different target are in 
llvm/test/Instrumentation/InstrProfiling/profiling.ll
+// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = {{.*}} global [2 x i64] 
zeroinitializer
+// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = {{.*}} global [2 x i64] 
zeroinitializer
 
 // T0GEN-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()
 // T0USE-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()


Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===
--- llvm/test/Instrumentation/InstrProfiling/pr

[PATCH] D110422: [AIX] Change the linkage of profiling counter/data to be private

2021-09-28 Thread Jinsong Ji via Phabricator via cfe-commits
jsji added a comment.

@MaskRay Thank you so much for your review and discussion!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D110422: [AIX] Change the linkage of profiling counter/data to be private

2021-09-28 Thread Jinsong Ji via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG25c30324e953: [AIX] Change the linkage of profiling 
counter/data to be private (authored by jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110422/new/

https://reviews.llvm.org/D110422

Files:
  clang/test/Profile/cxx-templates.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/profiling.ll


Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===
--- llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ llvm/test/Instrumentation/InstrProfiling/profiling.ll
@@ -45,8 +45,8 @@
 ; MACHO: @__profd_foo_weak = weak hidden global
 ; COFF: @__profc_foo_weak = weak hidden global
 ; COFF: @__profd_foo_weak = private global
-; XCOFF: @__profc_foo_weak = weak hidden global
-; XCOFF: @__profd_foo_weak = weak hidden global
+; XCOFF: @__profc_foo_weak = private global
+; XCOFF: @__profd_foo_weak = private global
 define weak void @foo_weak() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 
x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -71,8 +71,8 @@
 ; MACHO: @__profd_foo_inline = linkonce_odr hidden global
 ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section 
".lprfc$M", align 8
 ; COFF: @__profd_foo_inline = private global{{.*}} section ".lprfd$M", align 8
-; XCOFF: @__profc_foo_inline = linkonce_odr hidden global
-; XCOFF: @__profd_foo_inline = linkonce_odr hidden global
+; XCOFF: @__profc_foo_inline = private global
+; XCOFF: @__profd_foo_inline = private global
 define linkonce_odr void @foo_inline() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], 
[10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
@@ -84,8 +84,8 @@
 ; MACHO: @__profd_foo_extern = linkonce_odr hidden global
 ; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section 
".lprfc$M", comdat, align 8
 ; COFF: @__profd_foo_extern = private global {{.*}}section ".lprfd$M", 
comdat($__profc_foo_extern), align 8
-; XCOFF: @__profc_foo_extern = linkonce_odr hidden global
-; XCOFF: @__profd_foo_extern = linkonce_odr hidden global
+; XCOFF: @__profc_foo_extern = private global
+; XCOFF: @__profd_foo_extern = private global
 define available_externally void @foo_extern() {
   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], 
[10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
   ret void
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -862,6 +862,15 @@
   GlobalValue::LinkageTypes Linkage = NamePtr->getLinkage();
   GlobalValue::VisibilityTypes Visibility = NamePtr->getVisibility();
 
+  // Due to the limitation of binder as of 2021/09/28, the duplicate weak
+  // symbols in the same csect won't be discarded. When there are duplicate 
weak
+  // symbols, we can NOT guarantee that the relocations get resolved to the
+  // intended weak symbol, so we can not ensure the correctness of the relative
+  // CounterPtr, so we have to use private linkage for counter and data 
symbols.
+  if (TT.isOSBinFormatXCOFF()) {
+Linkage = GlobalValue::PrivateLinkage;
+Visibility = GlobalValue::DefaultVisibility;
+  }
   // Move the name variable to the right section. Place them in a COMDAT group
   // if the associated function is a COMDAT. This will make sure that only one
   // copy of counters of the COMDAT function will be emitted after linking. 
Keep
Index: clang/test/Profile/cxx-templates.cpp
===
--- clang/test/Profile/cxx-templates.cpp
+++ clang/test/Profile/cxx-templates.cpp
@@ -10,8 +10,10 @@
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s
 
-// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = linkonce_odr 
{{(hidden|dso_local)}} global [2 x i64] zeroinitializer
-// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = linkonce_odr 
{{(hidden|dso_local)}} global [2 x i64] zeroinitializer
+// The linkage can be target dependent, so accept all linkage here,
+// the linkage tests for different target are in 
llvm/test/Instrumentation/InstrProfiling/profiling.ll
+// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = {{.*}} global [2 x i64] 
zeroinitializer
+// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = {{.*}} global [2 x i64] 
zeroinitializer
 
 // T0GEN-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()
 // T0USE-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()


Index: llvm/t

  1   2   3   >