[clang] [llvm] Enable LLDB tests in pre-merge CI (PR #94208)

2024-06-03 Thread Anton Korobeynikov via cfe-commits

asl wrote:

Tagging @slydiman @vvereschaka 

https://github.com/llvm/llvm-project/pull/94208
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-03 Thread Anton Korobeynikov via cfe-commits

asl wrote:

@kbeyls Will you please summarize briefly what we discussed on the sync call 
from the license standpoint?

https://github.com/llvm/llvm-project/pull/93902
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Add arm64e ABI-defined key assignments to ptrauth.h. (PR #93901)

2024-05-30 Thread Anton Korobeynikov via cfe-commits


@@ -15,6 +15,29 @@ typedef enum {
   ptrauth_key_asib = 1,
   ptrauth_key_asda = 2,
   ptrauth_key_asdb = 3,
+
+#ifdef __APPLE__

asl wrote:

I believe these are defaults for ELF as well. So, I'd remove ifdef and decide 
on necessary gating when there will be a precedent.

https://github.com/llvm/llvm-project/pull/93901
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libunwind] [libunwind][WebAssembly] Make libunwind compilable (PR #92192)

2024-05-21 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl approved this pull request.

Ok from the generic point of view. I cannot judge if wasm-related part is ok 
though :)

https://github.com/llvm/llvm-project/pull/92192
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libunwind] [libunwind][WebAssembly] Make libunwind compilable (PR #92192)

2024-05-17 Thread Anton Korobeynikov via cfe-commits


@@ -20,7 +20,7 @@
   .text
 #endif
 
-#if !defined(__USING_SJLJ_EXCEPTIONS__)
+#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)

asl wrote:

Ok. Then does the clang change really belong here? 
`LIBUNWIND_USES_WASM_EXCEPTIONS` also seems to be unused.

https://github.com/llvm/llvm-project/pull/92192
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libunwind] [libunwind][WebAssembly] Make libunwind compilable (PR #92192)

2024-05-17 Thread Anton Korobeynikov via cfe-commits


@@ -20,7 +20,7 @@
   .text
 #endif
 
-#if !defined(__USING_SJLJ_EXCEPTIONS__)
+#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)

asl wrote:

You are defining `__USING_WASM_EXCEPTIONS__`. Why you are not using it here and 
everywhere else?

https://github.com/llvm/llvm-project/pull/92192
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MSP430][Clang] Update list of MCUs (PR #91258)

2024-05-07 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl closed https://github.com/llvm/llvm-project/pull/91258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MSP430][Clang] Update list of MCUs (PR #91258)

2024-05-07 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl approved this pull request.

Thanks!

https://github.com/llvm/llvm-project/pull/91258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MSP430][Clang] Update list of MCUs (PR #91258)

2024-05-07 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl edited https://github.com/llvm/llvm-project/pull/91258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MSP430][Clang] Update list of MCUs (PR #91258)

2024-05-06 Thread Anton Korobeynikov via cfe-commits

asl wrote:

> The python script should likely be up streamed as well. But where?

You could just put into `Target/MSP430`.

https://github.com/llvm/llvm-project/pull/91258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #86721)

2024-03-27 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl approved this pull request.

Thanks!

https://github.com/llvm/llvm-project/pull/86721
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][AArch64][FMV] PAC the stub_helper's frame on arm64e (PR #84704)

2024-03-14 Thread Anton Korobeynikov via cfe-commits

asl wrote:

Tagging @kovdan01 

Can the triple checks be generalized to checking about pauth-enabled subtarget 
feature? This way everything would work for ELF platforms eventually.

https://github.com/llvm/llvm-project/pull/84704
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #67454)

2024-03-12 Thread Anton Korobeynikov via cfe-commits

asl wrote:

> Maybe `emitRawPointerFromAddress` is better. I see a lot of functions 
> starting with `emit` in CodeGen.

Works for me!

https://github.com/llvm/llvm-project/pull/67454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #67454)

2024-03-11 Thread Anton Korobeynikov via cfe-commits

asl wrote:

> I'm not sure `extractRawPointerFromAddress` conveys the fact that the 
> function might do code-gen instead of just returning some pointer. I wonder 
> if there's a better name.
> 
> `computeRawPointerFromAddress` `genRawPointerFromAddress` 
> `generateRawPointerFromAddress` `codeGenRawPointerFromAddress`
> 
> Thoughts?

I do not have particular preference. But probably like `compute` / `gen` 
slightly more.

https://github.com/llvm/llvm-project/pull/67454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #67454)

2024-03-11 Thread Anton Korobeynikov via cfe-commits

asl wrote:

We discussed the naming thing (`extractRawPointerFromAddress` vs 
`getRawPointerFromAddress`) at pauth call and decided that it would be better 
to do this renaming now. @ahmedbougacha will coordinate that renaming.

https://github.com/llvm/llvm-project/pull/67454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #67454)

2024-03-02 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl milestoned 
https://github.com/llvm/llvm-project/pull/67454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [AArch64][PAC] Support ptrauth builtins and -fptrauth-intrinsics. (PR #65996)

2024-03-02 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl milestoned 
https://github.com/llvm/llvm-project/pull/65996
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #67454)

2024-03-01 Thread Anton Korobeynikov via cfe-commits

asl wrote:

I am ok with the changes. Though with pauth we'd probably need to rename 
`getRawPointerFromAddress` to indicate clearer that it has side effects (like 
`extractRawPointerFromAddress` or something like this)

https://github.com/llvm/llvm-project/pull/67454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [llvm] [XCOFF] Add compiler version to an auxiliary symbol table entry (PR #80162)

2024-02-06 Thread Anton Korobeynikov via cfe-commits


@@ -159,14 +159,26 @@ declare i32 @bar(i32)
 ; SYM:  Symbols [
 ; SYM-NEXT:   Symbol {
 ; SYM-NEXT: Index: 0
-; SYM-NEXT: Name: 
+; SYM-NEXT: Name: .file
 ; SYM-NEXT: Value (SymbolTableIndex): 0x0
 ; SYM-NEXT: Section: N_DEBUG
 ; SYM-NEXT: Source Language ID: TB_CPLUSPLUS (0x9)
 ; SYM32-NEXT:   CPU Version ID: TCPU_COM (0x3)
 ; SYM64-NEXT:   CPU Version ID: TCPU_PPC64 (0x2)
 ; SYM-NEXT: StorageClass: C_FILE (0x67)
-; SYM-NEXT: NumberOfAuxEntries: 0
+; SYM-NEXT: NumberOfAuxEntries: 2
+; SYM-NEXT: File Auxiliary Entry {
+; SYM-NEXT:   Index: 1
+; SYM-NEXT:   Name: 
+; SYM-NEXT:   Type: XFT_FN (0x0)
+; SYM64-NEXT: Auxiliary Type: AUX_FILE (0xFC)
+; SYM-NEXT: }
+; SYM-NEXT: File Auxiliary Entry {
+; SYM-NEXT:   Index: 2
+; SYM-NEXT:   Name: LLVM version 18.0.0git

asl wrote:

This should not be here.

https://github.com/llvm/llvm-project/pull/80162
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [llvm] [XCOFF] Add compiler version to an auxiliary symbol table entry (PR #80162)

2024-02-06 Thread Anton Korobeynikov via cfe-commits

asl wrote:

@nico How about revert?

https://github.com/llvm/llvm-project/pull/80162
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [llvm] [XCOFF] Add compiler version to an auxiliary symbol table entry (PR #80162)

2024-02-06 Thread Anton Korobeynikov via cfe-commits

asl wrote:

@stephenpeckham Apparently this was merged without waiting for buildkite 
results or ignoring its results. Linux build failed due to obvious spelling 
mistakes. Will you please next time wait until CI to finish?

Thanks!

https://github.com/llvm/llvm-project/pull/80162
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] Resolve FIXME in altivec.h (PR #78905)

2024-01-27 Thread Anton Korobeynikov via cfe-commits

asl wrote:

I do not thing this is a proper fix and that it actually improves anything. 
"Treat as signed 5-bit literal" means that:
 - Only allow literal parameters
 - Only allow integers that would fit into 5-bit signed immediate

https://github.com/llvm/llvm-project/pull/78905
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [llvm] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-16 Thread Anton Korobeynikov via cfe-commits


@@ -9,7 +9,7 @@
 /// \file
 /// Defines the Diagnostic-related interfaces.
 //
-//===--===//
+//===--===//]

asl wrote:

still unrelated change. I would suggest you to carefully check all the code in 
the PR

https://github.com/llvm/llvm-project/pull/78338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [llvm] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-16 Thread Anton Korobeynikov via cfe-commits


@@ -635,16 +635,16 @@ def execute_command(self) -> bool:
 """
 This function reads lines from STDIN and executes the first command
 that it finds.  The 2 supported commands are:
-/cherry-pick commit0   <...>

asl wrote:

You certainly could submit multiple PRs for separate changes.

https://github.com/llvm/llvm-project/pull/78338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang-tools-extra] [clang] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-16 Thread Anton Korobeynikov via cfe-commits


@@ -1098,7 +1098,10 @@ void VerifyDiagnosticConsumer::CheckDiagnostics() {
 // Produce an error if no expected-* directives could be found in the
 // source file(s) processed.
 if (Status == HasNoDirectives) {
-  Diags.Report(diag::err_verify_no_directives).setForceEmit();
+  // change here

asl wrote:

Ditto

https://github.com/llvm/llvm-project/pull/78338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [clang-tools-extra] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-16 Thread Anton Korobeynikov via cfe-commits


@@ -1404,7 +1404,7 @@ void ASTContext::InitBuiltinTypes(const TargetInfo 
,
 getTranslationUnitDecl()->addDecl(MSGuidTagDecl);
   }
 }
-
+// maybe change here also.

asl wrote:

Ditto

https://github.com/llvm/llvm-project/pull/78338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [clang-tools-extra] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-16 Thread Anton Korobeynikov via cfe-commits


@@ -635,16 +635,16 @@ def execute_command(self) -> bool:
 """
 This function reads lines from STDIN and executes the first command
 that it finds.  The 2 supported commands are:
-/cherry-pick commit0   <...>

asl wrote:

Do not include unrelated things into a PR

https://github.com/llvm/llvm-project/pull/78338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [llvm] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-16 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl requested changes to this pull request.

Ensure that PR does not contain unrelated things. See 
https://llvm.org/docs/Contributing.html#how-to-submit-a-patch for more 
information

https://github.com/llvm/llvm-project/pull/78338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] [clang] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-16 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl edited https://github.com/llvm/llvm-project/pull/78338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] [clang] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-16 Thread Anton Korobeynikov via cfe-commits


@@ -9,7 +9,9 @@
 /// \file
 /// Defines the Diagnostic-related interfaces.
 //
-//===--===//
+//===--===//]
+
+// look into this file as well

asl wrote:

Remove

https://github.com/llvm/llvm-project/pull/78338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [mlir] [compiler-rt] [clang-tools-extra] [lldb] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Anton Korobeynikov via cfe-commits


@@ -108,13 +108,9 @@ else()
   linux/HostInfoLinux.cpp
   linux/LibcGlue.cpp
   linux/Support.cpp
+  android/HostInfoAndroid.cpp
+  android/LibcGlue.cpp
   )
-if (CMAKE_SYSTEM_NAME MATCHES "Android")

asl wrote:

Not quite. It's distant enough in many aspects (from the toolchain perspective) 
to have a separate cmake system name.

https://github.com/llvm/llvm-project/pull/77216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [mlir] [compiler-rt] [clang-tools-extra] [lldb] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Anton Korobeynikov via cfe-commits


@@ -108,13 +108,9 @@ else()
   linux/HostInfoLinux.cpp
   linux/LibcGlue.cpp
   linux/Support.cpp
+  android/HostInfoAndroid.cpp
+  android/LibcGlue.cpp
   )
-if (CMAKE_SYSTEM_NAME MATCHES "Android")

asl wrote:

Well, so this is not a cmake problem then.

https://github.com/llvm/llvm-project/pull/77216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [mlir] [compiler-rt] [clang-tools-extra] [lldb] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl edited https://github.com/llvm/llvm-project/pull/77216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [mlir] [compiler-rt] [clang-tools-extra] [lldb] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Anton Korobeynikov via cfe-commits


@@ -46,64 +46,64 @@ class Triple {
   enum ArchType {
 UnknownArch,
 
-arm,// ARM (little endian): arm, armv.*, xscale

asl wrote:

You can ignore these.

https://github.com/llvm/llvm-project/pull/77216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [mlir] [compiler-rt] [clang-tools-extra] [lldb] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Anton Korobeynikov via cfe-commits


@@ -108,13 +108,9 @@ else()
   linux/HostInfoLinux.cpp
   linux/LibcGlue.cpp
   linux/Support.cpp
+  android/HostInfoAndroid.cpp
+  android/LibcGlue.cpp
   )
-if (CMAKE_SYSTEM_NAME MATCHES "Android")

asl wrote:

What is wrong with android detection? I doubt this is a proper solution

https://github.com/llvm/llvm-project/pull/77216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [mlir] [compiler-rt] [clang-tools-extra] [lldb] Fix Multiple Build Errors on different platforms (PR #77216)

2024-01-06 Thread Anton Korobeynikov via cfe-commits


@@ -46,64 +46,64 @@ class Triple {
   enum ArchType {
 UnknownArch,
 
-arm,// ARM (little endian): arm, armv.*, xscale

asl wrote:

Please do not do such large code reformatting. It makes impossible to review 
them

https://github.com/llvm/llvm-project/pull/77216
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Cygwin basic support (PR #76943)

2024-01-04 Thread Anton Korobeynikov via cfe-commits
=?utf-8?b?5b6Q5oyB5oGS?= Xu Chiheng,=?utf-8?b?5b6Q5oyB5oGS?= Xu Chiheng
Message-ID:
In-Reply-To: 


https://github.com/asl requested changes to this pull request.

This lacks tests and some references how TLS is implemented on Cygwin

https://github.com/llvm/llvm-project/pull/76943
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Cygwin basic support (PR #74868)

2023-12-31 Thread Anton Korobeynikov via cfe-commits
=?utf-8?b?5b6Q5oyB5oGS?= Xu Chiheng,=?utf-8?b?5b6Q5oyB5oGS?= Xu Chiheng
Message-ID:
In-Reply-To: 


https://github.com/asl closed https://github.com/llvm/llvm-project/pull/74868
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Cygwin] Cygwin basic support (PR #74868)

2023-12-31 Thread Anton Korobeynikov via cfe-commits
=?utf-8?b?5b6Q5oyB5oGS?= Xu Chiheng,=?utf-8?b?5b6Q5oyB5oGS?= Xu Chiheng
Message-ID:
In-Reply-To: 


asl wrote:

Will you please provide meaningful description in the PRs from now on? Since 
this is not the first time you've been asked to do this and you are ignoring 
these requests I'm closing this PR. Please do not use PRs to debug your own 
issues, this is wasting both time of reviewers as well as CI time.

Feel free to reopen when / if you will be able to fix these issues.

For more information about proper way to contribute to LLVM consider 
familiarizing yourself with:

 * https://llvm.org/docs/Contributing.html#how-to-submit-a-patch
 * https://llvm.org/docs/CodeReview.html
 
Thanks.

https://github.com/llvm/llvm-project/pull/74868
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MinGW] MinGW Value.h (PR #74982)

2023-12-31 Thread Anton Korobeynikov via cfe-commits

asl wrote:

Will you please provide meaningful description in the PRs from now on? Since 
this is not the first time you've been asked to do this and you are ignoring 
these requests I'm closing this PR. Please do not use PRs to debug your own 
issues, this is wasting both time of reviewers as well as CI time.

Feel free to reopen when / if you will be able to fix these issues.

For more information about proper way to contribute to LLVM consider 
familiarizing yourself with:

 * https://llvm.org/docs/Contributing.html#how-to-submit-a-patch
 * https://llvm.org/docs/CodeReview.html
Thanks.

https://github.com/llvm/llvm-project/pull/74982
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MinGW] MinGW Value.h (PR #74982)

2023-12-31 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl closed https://github.com/llvm/llvm-project/pull/74982
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MinGW] MinGW pthread (PR #74981)

2023-12-31 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl closed https://github.com/llvm/llvm-project/pull/74981
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [MinGW] MinGW pthread (PR #74981)

2023-12-31 Thread Anton Korobeynikov via cfe-commits

asl wrote:

@xu-chiheng  Will you please provide meaningful description in the PRs from now 
on? Since this is not the first time you've been asked to do this and you are 
ignoring these requests I'm closing this PR. Please do not use PRs to debug 
your own issues, this is wasting both time of reviewers as well as CI time.

Feel free to reopen when / if you will be able to fix these issues.

For more information about proper way to contribute to LLVM consider 
familiarizing yourself with:

 * https://llvm.org/docs/Contributing.html#how-to-submit-a-patch
 * https://llvm.org/docs/CodeReview.html
Thanks.

https://github.com/llvm/llvm-project/pull/74981
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [pseudo] lib Grammar.cpp (PR #74984)

2023-12-31 Thread Anton Korobeynikov via cfe-commits

asl wrote:

Will you please provide meaningful description in the PRs from now on? Since 
this is not the first time you've been asked to do this and you are ignoring 
these requests I'm closing this PR. Please do not use PRs to debug your own 
issues, this is wasting both time of reviewers as well as CI time.

Feel free to reopen when / if you will be able to fix these issues.

For more information about proper way to contribute to LLVM consider 
familiarizing yourself with:

 * https://llvm.org/docs/Contributing.html#how-to-submit-a-patch
 * https://llvm.org/docs/CodeReview.html
Thanks.

https://github.com/llvm/llvm-project/pull/74984
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [pseudo] lib Grammar.cpp (PR #74984)

2023-12-31 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl closed https://github.com/llvm/llvm-project/pull/74984
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [pseudo] gen Main.cpp (PR #74983)

2023-12-31 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl closed https://github.com/llvm/llvm-project/pull/74983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [pseudo] gen Main.cpp (PR #74983)

2023-12-31 Thread Anton Korobeynikov via cfe-commits

asl wrote:

Will you please provide meaningful description in the PRs from now on? Since 
this is not the first time you've been asked to do this and you are ignoring 
these requests I'm closing this PR. Please do not use PRs to debug your own 
issues, this is wasting both time of reviewers as well as CI time.

Feel free to reopen when / if you will be able to fix these issues.

For more information about proper way to contribute to LLVM consider 
familiarizing yourself with:
  * https://llvm.org/docs/Contributing.html#how-to-submit-a-patch
  * https://llvm.org/docs/CodeReview.html

Thanks.

https://github.com/llvm/llvm-project/pull/74983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[llvm] [clang] [AArch64][PAC] Support ptrauth builtins and -fptrauth-intrinsics. (PR #65996)

2023-12-04 Thread Anton Korobeynikov via cfe-commits

asl wrote:

Looks like the review stalled. Where we are here? @ahmedbougacha @ChuanqiXu9 ?

https://github.com/llvm/llvm-project/pull/65996
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #67454)

2023-11-20 Thread Anton Korobeynikov via cfe-commits


@@ -232,110 +279,133 @@ class CGBuilderTy : public CGBuilderBaseTy {
   /// where i64 is actually the target word size.
   Address CreateConstGEP(Address Addr, uint64_t Index,
  const llvm::Twine  = "") {
+llvm::Type *ElTy = Addr.getElementType();
 const llvm::DataLayout  = BB->getParent()->getParent()->getDataLayout();
-CharUnits EltSize =
-CharUnits::fromQuantity(DL.getTypeAllocSize(Addr.getElementType()));
+CharUnits EltSize = CharUnits::fromQuantity(DL.getTypeAllocSize(ElTy));
 
-return Address(CreateGEP(Addr.getElementType(), Addr.getPointer(),
- getSize(Index), Name),
+return Address(CreateGEP(ElTy, Addr.getBasePointer(), getSize(Index), 
Name),
Addr.getElementType(),
-   Addr.getAlignment().alignmentAtOffset(Index * EltSize),
-   NotKnownNonNull);
+   Addr.getAlignment().alignmentAtOffset(Index * EltSize));
   }
 
   /// Create GEP with single dynamic index. The address alignment is reduced
   /// according to the element size.
   using CGBuilderBaseTy::CreateGEP;
-  Address CreateGEP(Address Addr, llvm::Value *Index,
+  Address CreateGEP(CodeGenFunction , Address Addr, llvm::Value *Index,
 const llvm::Twine  = "") {
 const llvm::DataLayout  = BB->getParent()->getParent()->getDataLayout();
 CharUnits EltSize =
 CharUnits::fromQuantity(DL.getTypeAllocSize(Addr.getElementType()));
 
 return Address(
-CreateGEP(Addr.getElementType(), Addr.getPointer(), Index, Name),
+CreateGEP(Addr.getElementType(), Addr.getRawPointer(CGF), Index, Name),
 Addr.getElementType(),
-Addr.getAlignment().alignmentOfArrayElement(EltSize), NotKnownNonNull);
+Addr.getAlignment().alignmentOfArrayElement(EltSize));
   }
 
   /// Given a pointer to i8, adjust it by a given constant offset.
   Address CreateConstInBoundsByteGEP(Address Addr, CharUnits Offset,
  const llvm::Twine  = "") {
 assert(Addr.getElementType() == TypeCache.Int8Ty);
-return Address(CreateInBoundsGEP(Addr.getElementType(), Addr.getPointer(),
- getSize(Offset), Name),
-   Addr.getElementType(),
-   Addr.getAlignment().alignmentAtOffset(Offset),
-   Addr.isKnownNonNull());
+return Address(
+CreateInBoundsGEP(Addr.getElementType(), Addr.getBasePointer(),
+  getSize(Offset), Name),
+Addr.getElementType(), Addr.getAlignment().alignmentAtOffset(Offset),
+Addr.isKnownNonNull());
   }
+
   Address CreateConstByteGEP(Address Addr, CharUnits Offset,
  const llvm::Twine  = "") {
 assert(Addr.getElementType() == TypeCache.Int8Ty);
-return Address(CreateGEP(Addr.getElementType(), Addr.getPointer(),
+return Address(CreateGEP(Addr.getElementType(), Addr.getBasePointer(),
  getSize(Offset), Name),
Addr.getElementType(),
-   Addr.getAlignment().alignmentAtOffset(Offset),
-   NotKnownNonNull);
+   Addr.getAlignment().alignmentAtOffset(Offset));
   }
 
   using CGBuilderBaseTy::CreateConstInBoundsGEP2_32;
   Address CreateConstInBoundsGEP2_32(Address Addr, unsigned Idx0, unsigned 
Idx1,
  const llvm::Twine  = "") {
-const llvm::DataLayout  = BB->getParent()->getParent()->getDataLayout();
+return createConstGEP2_32(Addr, Idx0, Idx1, Name);
+  }
 
-auto *GEP = cast(CreateConstInBoundsGEP2_32(
-Addr.getElementType(), Addr.getPointer(), Idx0, Idx1, Name));
-llvm::APInt Offset(
-DL.getIndexSizeInBits(Addr.getType()->getPointerAddressSpace()), 0,
-/*isSigned=*/true);
-if (!GEP->accumulateConstantOffset(DL, Offset))
-  llvm_unreachable("offset of GEP with constants is always computable");
-return Address(GEP, GEP->getResultElementType(),
-   Addr.getAlignment().alignmentAtOffset(
-   CharUnits::fromQuantity(Offset.getSExtValue())),
-   Addr.isKnownNonNull());
+  using CGBuilderBaseTy::CreateConstGEP2_32;
+  Address CreateConstGEP2_32(Address Addr, unsigned Idx0, unsigned Idx1,
+ const llvm::Twine  = "") {
+return createConstGEP2_32(Addr, Idx0, Idx1, Name);
+  }
+
+  Address CreateGEP(Address Addr, ArrayRef IdxList,
+llvm::Type *ElementType, CharUnits Align,
+const Twine  = "") {
+llvm::Value *Ptr = getRawPointerFromAddress(Addr);
+return RawAddress(CreateGEP(Addr.getElementType(), Ptr, IdxList, Name),
+  ElementType, Align);
+  }
+
+  using CGBuilderBaseTy::CreateInBoundsGEP;
+  Address CreateInBoundsGEP(Address Addr, ArrayRef IdxList,
+llvm::Type *ElementType, 

[llvm] [clang] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #67454)

2023-11-20 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl requested changes to this pull request.

See the comment about function argument evaluation order that causes 
instability of the codegen with pauth.

https://github.com/llvm/llvm-project/pull/67454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (PR #67454)

2023-11-20 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl edited https://github.com/llvm/llvm-project/pull/67454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][OHOS] Keep ARM ABI selection logic in sync between Clang and LLVM (PR #68656)

2023-10-14 Thread Anton Korobeynikov via cfe-commits


@@ -519,6 +519,7 @@ StringRef ARM::computeDefaultTargetABI(const Triple , 
StringRef CPU) {
   case Triple::GNUEABIHF:
   case Triple::MuslEABI:
   case Triple::MuslEABIHF:
+  case llvm::Triple::OpenHOS:

asl wrote:

```suggestion
  case Triple::OpenHOS:
```

https://github.com/llvm/llvm-project/pull/68656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Driver] Fix detection of libc++ with empty sysroot. (PR #66947)

2023-09-27 Thread Anton Korobeynikov via cfe-commits

asl wrote:

@sam-mccall As far as I can see, the bot was green before this change: 
https://lab.llvm.org/buildbot/#/builders/119/builds/15229

Have you not received email from the buildbot?

https://github.com/llvm/llvm-project/pull/66947
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-22 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl resolved https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-15 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl closed https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-14 Thread Anton Korobeynikov via cfe-commits

asl wrote:

> Got it. Thanks. Then I am wondering how about the `retcon` ABI? I am confused 
> since the doc said the last continuation of `retcon` ABI will return a 
> nullptr to indicate it has finished. Don't we have the same problem? Or we 
> can't solve the problem in `retcon` ABI? Or we just don't want to solve that 
> in the current PR?

Ah, ok. The current PR is only for `retcon.once` coroutines. I do not have a 
good use-case for `retcon` ones and they are lowered differently enough, so I 
decided not to touch them. If / when there will be a viable usecase, I will try 
to generalize the present implementation to generic `retcon` coroutines.

https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-14 Thread Anton Korobeynikov via cfe-commits

asl wrote:

> What make me curious is the motivation case of the PR. I mean what can be 
> presented in retcon.once ABI after the PR which is impossible/hard before. 
> And how do we handle that in retcon ABI.

Well, the PR allows `recon.once` coroutines to have normal results in addition 
to yields. While it might be possible to "emulate" this functionality returning 
the value indirectly, it is not very convenient for producer (instead of just 
returning the value we'd need to allocate stack slot, pass the address, etc.) 
and might incur some overhead, as we'd essentially will need to capture both 
value to be returned and return address in the coroutine frame only to emit the 
store in the continuation part.

The particular usecase from Swift is as follows:
 - Yield pointer to some internals of an object
 - Allow the caller to modify the object via exposed pointer as necessary
 - In the coroutine continuation perform some "finalization" and return e.g. a 
pointer to a closure object with modified object being captured

https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-14 Thread Anton Korobeynikov via cfe-commits

asl wrote:

> > > Out of curiousity, why don't we have the problem in the normal return 
> > > continuation ABI?
> > 
> > 
> > The problem happens when the value is directly used in `coro.end` 
> > intrinsic. For example, when we're forwarding coroutine argument as a 
> > result. Or, when the value itself is computed before the suspend. 
> > Everything else is correctly handled by the present code due to BB split 
> > (the corresponding instructions appear in `Cleanup` block for example and 
> > correctly spilled).
> 
> I still don't understand the motivation fully. Do you say we don't have the 
> problem naturally? Or could you show some motivation examples? (In LLVM IR?)

This one is problematic:
```llvm
define {ptr, ptr} @g(ptr %buffer, ptr %ptr, i8 %val) presplitcoroutine {
entry:
  %temp = alloca i32, align 4
  %id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr 
@prototype2, ptr @allocate, ptr @deallocate)
  %hdl = call ptr @llvm.coro.begin(token %id, ptr null)
  %oldvalue = load i32, ptr %ptr
  store i32 %oldvalue, ptr %temp
  %unwind = call i1 (...) @llvm.coro.suspend.retcon.i1(ptr %temp)
  br i1 %unwind, label %cleanup, label %cont

cont:
  %newvalue = load i32, ptr %temp
  store i32 %newvalue, ptr %ptr
  br label %cleanup

cleanup:
  call i1 (ptr, i1, ...) @llvm.coro.end(ptr %hdl, i1 0, i8 %val)
  unreachable
}
```

but this one is not:
```llvm
define {ptr, ptr} @g(ptr %buffer, ptr %ptr, i8 %val) presplitcoroutine {
entry:
  %temp = alloca i32, align 4
  %id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr 
@prototype2, ptr @allocate, ptr @deallocate)
  %hdl = call ptr @llvm.coro.begin(token %id, ptr null)
  %oldvalue = load i32, ptr %ptr
  store i32 %oldvalue, ptr %temp
  %unwind = call i1 (...) @llvm.coro.suspend.retcon.i1(ptr %temp)
  br i1 %unwind, label %cleanup, label %cont

cont:
  %newvalue = load i32, ptr %temp
  store i32 %newvalue, ptr %ptr
  br label %cleanup

cleanup:
  %newval = add i8 %val, 42
  call i1 (ptr, i1, ...) @llvm.coro.end(ptr %hdl, i1 0, i8 %newval)
  unreachable
}
```

This one is problematic as well:
```llvm
define {ptr, ptr} @g(ptr %buffer, ptr %ptr, i8 %val) presplitcoroutine {
entry:
  %temp = alloca i32, align 4
  %id = call token @llvm.coro.id.retcon.once(i32 8, i32 8, ptr %buffer, ptr 
@prototype2, ptr @allocate, ptr @deallocate)
  %hdl = call ptr @llvm.coro.begin(token %id, ptr null)
  %oldvalue = load i32, ptr %ptr
  store i32 %oldvalue, ptr %temp
  %newval = add i8 %val, 42
  %unwind = call i1 (...) @llvm.coro.suspend.retcon.i1(ptr %temp)
  br i1 %unwind, label %cleanup, label %cont

cont:
  %newvalue = load i32, ptr %temp
  store i32 %newvalue, ptr %ptr
  br label %cleanup

cleanup:
  call i1 (ptr, i1, ...) @llvm.coro.end(ptr %hdl, i1 0, i8 %newval)
  unreachable
}
```

All these are "new" cases I would say, everything else is handled via current 
split approach.

https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-14 Thread Anton Korobeynikov via cfe-commits


@@ -3046,7 +3046,8 @@ void coro::buildCoroutineFrame(
   // Collect the spills for arguments and other not-materializable values.
   for (Argument  : F.args())
 for (User *U : A.users())
-  if (Checker.isDefinitionAcrossSuspend(A, U))
+  if (Checker.isDefinitionAcrossSuspend(A, U) ||
+  isa(U))

asl wrote:

Ok, I'll give it a try. Note that this will be a C++ API breaking change though 
as we will always need to pass an extra argument.

https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-14 Thread Anton Korobeynikov via cfe-commits

asl wrote:

> Out of curiousity, why don't we have the problem in the normal return 
> continuation ABI?

The problem happens when the value is directly used in `coro.end` intrinsic. 
For example, when we're forwarding coroutine argument as a result. Or, when the 
value itself is computed before the suspend. Everything else is correctly 
handled by the present code due to BB split (the corresponding instructions 
appear in `Cleanup` block for example and correctly spilled).

https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-14 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl edited https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

2023-09-14 Thread Anton Korobeynikov via cfe-commits

https://github.com/asl review_requested 
https://github.com/llvm/llvm-project/pull/66333
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] be61093 - [MSP430][Clang] Remove support for -mmcu=msp430

2021-09-28 Thread Anton Korobeynikov via cfe-commits

Author: Jozef Lawrynowicz
Date: 2021-09-28T20:47:26+03:00
New Revision: be610932fa068ed2228b0f694ae80c9294f0293f

URL: 
https://github.com/llvm/llvm-project/commit/be610932fa068ed2228b0f694ae80c9294f0293f
DIFF: 
https://github.com/llvm/llvm-project/commit/be610932fa068ed2228b0f694ae80c9294f0293f.diff

LOG: [MSP430][Clang] Remove support for -mmcu=msp430

The -mmcu= option accepts a generic MCU named "msp430", which sets the
CPU to msp430 and disables hardware multiply support.

The current purpose of accepting this value is to allow -mmcu= to be
used as an alias for -mcpu=, however there are some downsides to doing
this. -mmcu= provides additional features that will interfere
with the expected behavior if the user tries to to use it as an alias
for -mcpu=.

-mmcu=msp430 will conflict with -mhwmult=, since the "msp430" MCU is
defined to have no hardware multiply support, so the user will not be
able to set an explicit hardware multiply version.

-mmcu=msp430 will put "-Tmsp430.ld" on the linker command line, however
TI's support files do not provide a linker script with this name and so
the user would have to explicitly create it.

Differential Revision: https://reviews.llvm.org/D108299

Added: 


Modified: 
clang/include/clang/Basic/MSP430Target.def
clang/test/Driver/msp430-mmcu.c

Removed: 




diff  --git a/clang/include/clang/Basic/MSP430Target.def 
b/clang/include/clang/Basic/MSP430Target.def
index a1e192c192610..7a10be1d54c8d 100644
--- a/clang/include/clang/Basic/MSP430Target.def
+++ b/clang/include/clang/Basic/MSP430Target.def
@@ -238,8 +238,7 @@ MSP430_MCU_FEAT("msp430f4793", "32bit")
 MSP430_MCU_FEAT("msp430f4784", "32bit")
 MSP430_MCU_FEAT("msp430f4794", "32bit")
 
-// Generic MSUs
-MSP430_MCU("msp430")
+// Generic MCUs
 MSP430_MCU("msp430i2xxgeneric")
 
 #undef MSP430_MCU

diff  --git a/clang/test/Driver/msp430-mmcu.c b/clang/test/Driver/msp430-mmcu.c
index 42caacb97fadc..5f973a542dfc9 100644
--- a/clang/test/Driver/msp430-mmcu.c
+++ b/clang/test/Driver/msp430-mmcu.c
@@ -14,3 +14,9 @@
 // RUN:   | FileCheck -check-prefix=MSP430-UNSUP %s
 
 // MSP430-UNSUP: error: the clang compiler does not support 'not-a-mcu'
+
+// The generic MCU name "msp430" is not supported.
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430 2>&1 
\
+// RUN:   | FileCheck -check-prefix=MSP430 %s
+
+// MSP430: error: the clang compiler does not support 'msp430'



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


[clang] cb56fa2 - [MSP430] Update register names

2020-06-26 Thread Anton Korobeynikov via cfe-commits

Author: Anatoly Trosinenko
Date: 2020-06-26T15:32:07+03:00
New Revision: cb56fa2196c5d80ce72e8e8f6ee2a7ac80acca77

URL: 
https://github.com/llvm/llvm-project/commit/cb56fa2196c5d80ce72e8e8f6ee2a7ac80acca77
DIFF: 
https://github.com/llvm/llvm-project/commit/cb56fa2196c5d80ce72e8e8f6ee2a7ac80acca77.diff

LOG: [MSP430] Update register names

When writing a unit test on replacing standard epilogue sequences with `BR 
__mspabi_func_epilog_`, by manually asm-clobbering `rN` - `r10` for N = 
4..10, everything worked well except for seeming inability to clobber r4.

The problem was that MSP430 code generator of LLVM used an obsolete name FP for 
that register. Things were worse because when `llc` read an unknown register 
name, it silently ignored it.

That is, I cannot use `fp` register name from the C code because Clang does not 
accept it (exactly like GCC). But the accepted name `r4` is not recognised by 
`llc` (it can be used in listings passed to `llvm-mc` and even `fp` is replace 
to `r4` by `llvm-mc`). So I can specify any of `fp` or `r4` for the string 
literal of `asm(...)` but nothing in the clobber list.

This patch replaces `MSP430::FP` with `MSP430::R4` in the backend code (even 
[MSP430 EABI](http://www.ti.com/lit/an/slaa534/slaa534.pdf) doesn't mention FP 
as a register name). The R0 - R3 registers, on the other hand, are left as is 
in the backend code (after all, they have some special meaning on the ISA 
level). It is just ensured clang is renaming them as expected by the downstream 
tools. There is probably not much sense in **marking them clobbered** but 
rename them //just in case// for use at potentially different contexts.

Differential Revision: https://reviews.llvm.org/D82184

Added: 
clang/test/CodeGen/msp430-register-names.c
llvm/test/CodeGen/MSP430/inline-asm-register-names.ll

Modified: 
clang/lib/Basic/Targets/MSP430.h
llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp
llvm/lib/Target/MSP430/MSP430RegisterInfo.td
llvm/test/CodeGen/MSP430/asm-clobbers.ll

Removed: 




diff  --git a/clang/lib/Basic/Targets/MSP430.h 
b/clang/lib/Basic/Targets/MSP430.h
index 620f12d2b8e3..9d42e4d4bb18 100644
--- a/clang/lib/Basic/Targets/MSP430.h
+++ b/clang/lib/Basic/Targets/MSP430.h
@@ -64,8 +64,14 @@ class LLVM_LIBRARY_VISIBILITY MSP430TargetInfo : public 
TargetInfo {
   ArrayRef getGCCRegNames() const override;
 
   ArrayRef getGCCRegAliases() const override {
-// No aliases.
-return None;
+// Make r0 - r3 be recognized by llc (f.e., in clobber list)
+static const TargetInfo::GCCRegAlias GCCRegAliases[] = {
+{{"r0"}, "pc"},
+{{"r1"}, "sp"},
+{{"r2"}, "sr"},
+{{"r3"}, "cg"},
+};
+return llvm::makeArrayRef(GCCRegAliases);
   }
 
   bool validateAsmConstraint(const char *,

diff  --git a/clang/test/CodeGen/msp430-register-names.c 
b/clang/test/CodeGen/msp430-register-names.c
new file mode 100644
index ..106b6c933a49
--- /dev/null
+++ b/clang/test/CodeGen/msp430-register-names.c
@@ -0,0 +1,105 @@
+// Registers R0 - R3 have 
diff erent names inside the LLVM MSP430 target code.
+// Test that they are handled properly when used inside clobber lists.
+// At the time of writing, llc silently ignores unknown register names.
+
+// REQUIRES: msp430-registered-target
+// RUN: %clang -target msp430 -c %s -mllvm -stop-after=finalize-isel -o- | 
FileCheck %s
+
+void test_function(void) {
+  asm volatile(""
+   :
+   :
+   : "r0");
+  asm volatile(""
+   :
+   :
+   : "r1");
+  asm volatile(""
+   :
+   :
+   : "r2");
+  asm volatile(""
+   :
+   :
+   : "r3");
+  asm volatile(""
+   :
+   :
+   : "r4");
+  asm volatile(""
+   :
+   :
+   : "r5");
+  asm volatile(""
+   :
+   :
+   : "r6");
+  asm volatile(""
+   :
+   :
+   : "r7");
+  asm volatile(""
+   :
+   :
+   : "r8");
+  asm volatile(""
+   :
+   :
+   : "r9");
+  asm volatile(""
+   :
+   :
+   : "r10");
+  asm volatile(""
+   :
+   :
+   : "r11");
+  asm volatile(""
+   :
+   :
+   : "r12");
+  asm volatile(""
+   :
+   :
+   : "r13");
+  asm volatile(""
+   :
+   :
+   : "r14");
+  asm volatile(""
+   :
+   :
+

[clang] 6cb80fb - Revert "[MSP430] Update register names"

2020-06-22 Thread Anton Korobeynikov via cfe-commits

Author: Anton Korobeynikov
Date: 2020-06-22T13:37:22+03:00
New Revision: 6cb80fbe405264471e9bc5b6ea19694e51ae1b11

URL: 
https://github.com/llvm/llvm-project/commit/6cb80fbe405264471e9bc5b6ea19694e51ae1b11
DIFF: 
https://github.com/llvm/llvm-project/commit/6cb80fbe405264471e9bc5b6ea19694e51ae1b11.diff

LOG: Revert "[MSP430] Update register names"

This reverts commit 8f6620f663031da2bb35b788239f4b607271af84.

Added: 


Modified: 
clang/lib/Basic/Targets/MSP430.h
llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp
llvm/lib/Target/MSP430/MSP430RegisterInfo.td
llvm/test/CodeGen/MSP430/asm-clobbers.ll

Removed: 
clang/test/CodeGen/msp430-register-names.c
llvm/test/CodeGen/MSP430/inline-asm-register-names.ll



diff  --git a/clang/lib/Basic/Targets/MSP430.h 
b/clang/lib/Basic/Targets/MSP430.h
index 2c734f6b724e..620f12d2b8e3 100644
--- a/clang/lib/Basic/Targets/MSP430.h
+++ b/clang/lib/Basic/Targets/MSP430.h
@@ -64,14 +64,8 @@ class LLVM_LIBRARY_VISIBILITY MSP430TargetInfo : public 
TargetInfo {
   ArrayRef getGCCRegNames() const override;
 
   ArrayRef getGCCRegAliases() const override {
-// Make r0 - r3 be recognized by llc (f.e., in clobber list)
-static const TargetInfo::GCCRegAlias GCCRegAliases[] = {
-{{"r0"}, "pc"},
-{{"r1"}, "sp"},
-{{"r2"}, "sr"},
-{{"r3"}, "cg"},
-};
-return GCCRegAliases;
+// No aliases.
+return None;
   }
 
   bool validateAsmConstraint(const char *,

diff  --git a/clang/test/CodeGen/msp430-register-names.c 
b/clang/test/CodeGen/msp430-register-names.c
deleted file mode 100644
index 106b6c933a49..
--- a/clang/test/CodeGen/msp430-register-names.c
+++ /dev/null
@@ -1,105 +0,0 @@
-// Registers R0 - R3 have 
diff erent names inside the LLVM MSP430 target code.
-// Test that they are handled properly when used inside clobber lists.
-// At the time of writing, llc silently ignores unknown register names.
-
-// REQUIRES: msp430-registered-target
-// RUN: %clang -target msp430 -c %s -mllvm -stop-after=finalize-isel -o- | 
FileCheck %s
-
-void test_function(void) {
-  asm volatile(""
-   :
-   :
-   : "r0");
-  asm volatile(""
-   :
-   :
-   : "r1");
-  asm volatile(""
-   :
-   :
-   : "r2");
-  asm volatile(""
-   :
-   :
-   : "r3");
-  asm volatile(""
-   :
-   :
-   : "r4");
-  asm volatile(""
-   :
-   :
-   : "r5");
-  asm volatile(""
-   :
-   :
-   : "r6");
-  asm volatile(""
-   :
-   :
-   : "r7");
-  asm volatile(""
-   :
-   :
-   : "r8");
-  asm volatile(""
-   :
-   :
-   : "r9");
-  asm volatile(""
-   :
-   :
-   : "r10");
-  asm volatile(""
-   :
-   :
-   : "r11");
-  asm volatile(""
-   :
-   :
-   : "r12");
-  asm volatile(""
-   :
-   :
-   : "r13");
-  asm volatile(""
-   :
-   :
-   : "r14");
-  asm volatile(""
-   :
-   :
-   : "r15");
-  // CHECK: call void asm sideeffect "", "~{pc}"()
-  // CHECK: call void asm sideeffect "", "~{sp}"()
-  // CHECK: call void asm sideeffect "", "~{sr}"()
-  // CHECK: call void asm sideeffect "", "~{cg}"()
-  // CHECK: call void asm sideeffect "", "~{r4}"()
-  // CHECK: call void asm sideeffect "", "~{r5}"()
-  // CHECK: call void asm sideeffect "", "~{r6}"()
-  // CHECK: call void asm sideeffect "", "~{r7}"()
-  // CHECK: call void asm sideeffect "", "~{r8}"()
-  // CHECK: call void asm sideeffect "", "~{r9}"()
-  // CHECK: call void asm sideeffect "", "~{r10}"()
-  // CHECK: call void asm sideeffect "", "~{r11}"()
-  // CHECK: call void asm sideeffect "", "~{r12}"()
-  // CHECK: call void asm sideeffect "", "~{r13}"()
-  // CHECK: call void asm sideeffect "", "~{r14}"()
-  // CHECK: call void asm sideeffect "", "~{r15}"()
-  // CHECK: INLINEASM &"", {{.*}} implicit-def early-clobber $pc
-  // CHECK: INLINEASM &"", {{.*}} implicit-def early-clobber $sp
-  // CHECK: INLINEASM &"", {{.*}} implicit-def early-clobber $sr
-  // CHECK: INLINEASM &"", {{.*}} implicit-def early-clobber $cg
-  // CHECK: INLINEASM &"", {{.*}} implicit-def early-clobber $r4
-  // CHECK: INLINEASM &"", {{.*}} implicit-def early-clobber $r5
-  // CHECK: INLINEASM &"", {{.*}} implicit-def early-clobber $r6
-  // 

[clang] 8f6620f - [MSP430] Update register names

2020-06-22 Thread Anton Korobeynikov via cfe-commits

Author: Anatoly Trosinenko
Date: 2020-06-22T13:24:03+03:00
New Revision: 8f6620f663031da2bb35b788239f4b607271af84

URL: 
https://github.com/llvm/llvm-project/commit/8f6620f663031da2bb35b788239f4b607271af84
DIFF: 
https://github.com/llvm/llvm-project/commit/8f6620f663031da2bb35b788239f4b607271af84.diff

LOG: [MSP430] Update register names

When writing a unit test on replacing standard epilogue sequences with `BR 
__mspabi_func_epilog_`, by manually asm-clobbering `rN` - `r10` for N = 
4..10, everything worked well except for seeming inability to clobber r4.

The problem was that MSP430 code generator of LLVM used an obsolete name FP for 
that register. Things were worse because when `llc` read an unknown register 
name, it silently ignored it.

Differential Revision: https://reviews.llvm.org/D82184

Added: 
clang/test/CodeGen/msp430-register-names.c
llvm/test/CodeGen/MSP430/inline-asm-register-names.ll

Modified: 
clang/lib/Basic/Targets/MSP430.h
llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp
llvm/lib/Target/MSP430/MSP430RegisterInfo.td
llvm/test/CodeGen/MSP430/asm-clobbers.ll

Removed: 




diff  --git a/clang/lib/Basic/Targets/MSP430.h 
b/clang/lib/Basic/Targets/MSP430.h
index 620f12d2b8e3..2c734f6b724e 100644
--- a/clang/lib/Basic/Targets/MSP430.h
+++ b/clang/lib/Basic/Targets/MSP430.h
@@ -64,8 +64,14 @@ class LLVM_LIBRARY_VISIBILITY MSP430TargetInfo : public 
TargetInfo {
   ArrayRef getGCCRegNames() const override;
 
   ArrayRef getGCCRegAliases() const override {
-// No aliases.
-return None;
+// Make r0 - r3 be recognized by llc (f.e., in clobber list)
+static const TargetInfo::GCCRegAlias GCCRegAliases[] = {
+{{"r0"}, "pc"},
+{{"r1"}, "sp"},
+{{"r2"}, "sr"},
+{{"r3"}, "cg"},
+};
+return GCCRegAliases;
   }
 
   bool validateAsmConstraint(const char *,

diff  --git a/clang/test/CodeGen/msp430-register-names.c 
b/clang/test/CodeGen/msp430-register-names.c
new file mode 100644
index ..106b6c933a49
--- /dev/null
+++ b/clang/test/CodeGen/msp430-register-names.c
@@ -0,0 +1,105 @@
+// Registers R0 - R3 have 
diff erent names inside the LLVM MSP430 target code.
+// Test that they are handled properly when used inside clobber lists.
+// At the time of writing, llc silently ignores unknown register names.
+
+// REQUIRES: msp430-registered-target
+// RUN: %clang -target msp430 -c %s -mllvm -stop-after=finalize-isel -o- | 
FileCheck %s
+
+void test_function(void) {
+  asm volatile(""
+   :
+   :
+   : "r0");
+  asm volatile(""
+   :
+   :
+   : "r1");
+  asm volatile(""
+   :
+   :
+   : "r2");
+  asm volatile(""
+   :
+   :
+   : "r3");
+  asm volatile(""
+   :
+   :
+   : "r4");
+  asm volatile(""
+   :
+   :
+   : "r5");
+  asm volatile(""
+   :
+   :
+   : "r6");
+  asm volatile(""
+   :
+   :
+   : "r7");
+  asm volatile(""
+   :
+   :
+   : "r8");
+  asm volatile(""
+   :
+   :
+   : "r9");
+  asm volatile(""
+   :
+   :
+   : "r10");
+  asm volatile(""
+   :
+   :
+   : "r11");
+  asm volatile(""
+   :
+   :
+   : "r12");
+  asm volatile(""
+   :
+   :
+   : "r13");
+  asm volatile(""
+   :
+   :
+   : "r14");
+  asm volatile(""
+   :
+   :
+   : "r15");
+  // CHECK: call void asm sideeffect "", "~{pc}"()
+  // CHECK: call void asm sideeffect "", "~{sp}"()
+  // CHECK: call void asm sideeffect "", "~{sr}"()
+  // CHECK: call void asm sideeffect "", "~{cg}"()
+  // CHECK: call void asm sideeffect "", "~{r4}"()
+  // CHECK: call void asm sideeffect "", "~{r5}"()
+  // CHECK: call void asm sideeffect "", "~{r6}"()
+  // CHECK: call void asm sideeffect "", "~{r7}"()
+  // CHECK: call void asm sideeffect "", "~{r8}"()
+  // CHECK: call void asm sideeffect "", "~{r9}"()
+  // CHECK: call void asm sideeffect "", "~{r10}"()
+  // CHECK: call void asm sideeffect "", "~{r11}"()
+  // CHECK: call void asm sideeffect "", "~{r12}"()
+  // CHECK: call void asm sideeffect "", "~{r13}"()
+  // CHECK: call void asm sideeffect "", "~{r14}"()
+  // CHECK: call void asm sideeffect "", "~{r15}"()
+  // CHECK: INLINEASM &"", {{.*}} implicit-def early-clobber $pc
+  // 

r353877 - Disable PIC/PIE for MSP430 target

2019-02-12 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Tue Feb 12 12:46:00 2019
New Revision: 353877

URL: http://llvm.org/viewvc/llvm-project?rev=353877=rev
Log:
Disable PIC/PIE for MSP430 target

Relocatable code generation is meaningless on MSP430, as the platform is too 
small to use shared libraries.

Patch by Dmitry Mikushev!

Differential Revision: https://reviews.llvm.org/D56927

Added:
cfe/trunk/test/CodeGen/msp430-reloc.c
Modified:
cfe/trunk/lib/Driver/ToolChains/MSP430.h

Modified: cfe/trunk/lib/Driver/ToolChains/MSP430.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MSP430.h?rev=353877=353876=353877=diff
==
--- cfe/trunk/lib/Driver/ToolChains/MSP430.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/MSP430.h Tue Feb 12 12:46:00 2019
@@ -36,6 +36,10 @@ public:
  llvm::opt::ArgStringList ,
  Action::OffloadKind) const override;
 
+  bool isPICDefault() const override { return false; }
+  bool isPIEDefault() const override { return false; }
+  bool isPICDefaultForced() const override { return true; }
+
 protected:
   Tool *buildLinker() const override;
 

Added: cfe/trunk/test/CodeGen/msp430-reloc.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/msp430-reloc.c?rev=353877=auto
==
--- cfe/trunk/test/CodeGen/msp430-reloc.c (added)
+++ cfe/trunk/test/CodeGen/msp430-reloc.c Tue Feb 12 12:46:00 2019
@@ -0,0 +1,30 @@
+// REQUIRES: msp430-registered-target
+// RUN: %clang -target msp430 -fPIC -S %s -o - | FileCheck %s
+
+// Check the compilation does not crash as it was crashing before with "-fPIC" 
enabled
+
+void *alloca(unsigned int size);
+
+// CHECK: .globl foo
+short foo(char** data, char encoding)
+{
+   char* encoding_addr = alloca(sizeof(char));
+   *encoding_addr = encoding;
+
+   char tmp3 = *encoding_addr;
+   short conv2 = tmp3;
+   short and = conv2 & 0xf;
+
+   switch (and)
+   {
+   case 0 :
+   case 4 :
+   case 10 :
+   return 1;
+   case 11 :
+   return 2;
+   }
+
+   return 0;
+}
+


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


r353212 - Do not use frame pointer by default for MSP430

2019-02-05 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Tue Feb  5 12:15:03 2019
New Revision: 353212

URL: http://llvm.org/viewvc/llvm-project?rev=353212=rev
Log:
Do not use frame pointer by default for MSP430

This is suggested by 3.3.9 of MSP430 EABI document.
We do allow user to manually enable frame pointer. GCC toolchain uses the same 
behavior.

Patch by Dmitry Mikushev!

Differential Revision: https://reviews.llvm.org/D56925

Added:
cfe/trunk/test/CodeGen/msp430-fp-elim.c
Modified:
cfe/trunk/lib/Driver/ToolChains/Clang.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=353212=353211=353212=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Tue Feb  5 12:15:03 2019
@@ -519,6 +519,7 @@ static bool useFramePointerForTargetByDe
   case llvm::Triple::xcore:
   case llvm::Triple::wasm32:
   case llvm::Triple::wasm64:
+  case llvm::Triple::msp430:
 // XCore never wants frame pointers, regardless of OS.
 // WebAssembly never wants frame pointers.
 return false;

Added: cfe/trunk/test/CodeGen/msp430-fp-elim.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/msp430-fp-elim.c?rev=353212=auto
==
--- cfe/trunk/test/CodeGen/msp430-fp-elim.c (added)
+++ cfe/trunk/test/CodeGen/msp430-fp-elim.c Tue Feb  5 12:15:03 2019
@@ -0,0 +1,19 @@
+// REQUIRES: msp430-registered-target
+// RUN: %clang_cc1 -mdisable-fp-elim -triple msp430 -S %s -o - | FileCheck %s 
--check-prefix=FP_ENFORCED
+// RUN: %clang_cc1 -triple msp430 -S %s -o - | FileCheck %s 
--check-prefix=FP_DEFAULT
+
+// Check the frame pointer is not used on MSP430 by default, but can be 
forcibly turned on.
+
+// FP_ENFORCED: push r4
+// FP_ENFORCED: mov r4, r4
+// FP_ENFORCED: pop r4
+// FP_DEFAULT: .globl fp_elim_check
+// FP_DEFAULT-NOT: push r4
+// FP_DEFAULT: mov r4, r4
+// FP_DEFAULT-NOT: pop r4
+
+void fp_elim_check()
+{
+   asm volatile ("mov r4, r4");
+}
+


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


r352186 - Revert r352181 as it's breaking the bots

2019-01-25 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Fri Jan 25 02:35:35 2019
New Revision: 352186

URL: http://llvm.org/viewvc/llvm-project?rev=352186=rev
Log:
Revert r352181 as it's breaking the bots

Removed:
cfe/trunk/test/CodeGen/msp430-reloc.c
Modified:
cfe/trunk/lib/Driver/ToolChains/MSP430.h

Modified: cfe/trunk/lib/Driver/ToolChains/MSP430.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MSP430.h?rev=352186=352185=352186=diff
==
--- cfe/trunk/lib/Driver/ToolChains/MSP430.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/MSP430.h Fri Jan 25 02:35:35 2019
@@ -36,10 +36,6 @@ public:
  llvm::opt::ArgStringList ,
  Action::OffloadKind) const override;
 
-  bool isPICDefault() const override { return false; }
-  bool isPIEDefault() const override { return false; }
-  bool isPICDefaultForced() const override { return true; }
-
 protected:
   Tool *buildLinker() const override;
 

Removed: cfe/trunk/test/CodeGen/msp430-reloc.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/msp430-reloc.c?rev=352185=auto
==
--- cfe/trunk/test/CodeGen/msp430-reloc.c (original)
+++ cfe/trunk/test/CodeGen/msp430-reloc.c (removed)
@@ -1,29 +0,0 @@
-// RUN: %clang -target msp430 -fPIC -S %s -o - | FileCheck %s
-
-// Check the compilation does not crash as it was crashing before with "-fPIC" 
enabled
-
-void *alloca(unsigned int size);
-
-// CHECK: .globl foo
-short foo(char** data, char encoding)
-{
-   char* encoding_addr = alloca(sizeof(char));
-   *encoding_addr = encoding;
-
-   char tmp3 = *encoding_addr;
-   short conv2 = tmp3;
-   short and = conv2 & 0xf;
-
-   switch (and)
-   {
-   case 0 :
-   case 4 :
-   case 10 :
-   return 1;
-   case 11 :
-   return 2;
-   }
-
-   return 0;
-}
-


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


r352181 - Disable PIC/PIE for MSP430 target by default.

2019-01-25 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Fri Jan 25 01:41:20 2019
New Revision: 352181

URL: http://llvm.org/viewvc/llvm-project?rev=352181=rev
Log:
Disable PIC/PIE for MSP430 target by default.

Relocatable code generation is meaningless on MSP430, as the platform is too 
small to use shared libraries.

Patch by Dmitry Mikushev!

Differential Revision: https://reviews.llvm.org/D56927

Added:
cfe/trunk/test/CodeGen/msp430-reloc.c
Modified:
cfe/trunk/lib/Driver/ToolChains/MSP430.h

Modified: cfe/trunk/lib/Driver/ToolChains/MSP430.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MSP430.h?rev=352181=352180=352181=diff
==
--- cfe/trunk/lib/Driver/ToolChains/MSP430.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/MSP430.h Fri Jan 25 01:41:20 2019
@@ -36,6 +36,10 @@ public:
  llvm::opt::ArgStringList ,
  Action::OffloadKind) const override;
 
+  bool isPICDefault() const override { return false; }
+  bool isPIEDefault() const override { return false; }
+  bool isPICDefaultForced() const override { return true; }
+
 protected:
   Tool *buildLinker() const override;
 

Added: cfe/trunk/test/CodeGen/msp430-reloc.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/msp430-reloc.c?rev=352181=auto
==
--- cfe/trunk/test/CodeGen/msp430-reloc.c (added)
+++ cfe/trunk/test/CodeGen/msp430-reloc.c Fri Jan 25 01:41:20 2019
@@ -0,0 +1,29 @@
+// RUN: %clang -target msp430 -fPIC -S %s -o - | FileCheck %s
+
+// Check the compilation does not crash as it was crashing before with "-fPIC" 
enabled
+
+void *alloca(unsigned int size);
+
+// CHECK: .globl foo
+short foo(char** data, char encoding)
+{
+   char* encoding_addr = alloca(sizeof(char));
+   *encoding_addr = encoding;
+
+   char tmp3 = *encoding_addr;
+   short conv2 = tmp3;
+   short and = conv2 & 0xf;
+
+   switch (and)
+   {
+   case 0 :
+   case 4 :
+   case 10 :
+   return 1;
+   case 11 :
+   return 2;
+   }
+
+   return 0;
+}
+


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


r352177 - [MSP430] Ajust f32/f64 alignment according to MSP430 EABI

2019-01-25 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Fri Jan 25 00:51:53 2019
New Revision: 352177

URL: http://llvm.org/viewvc/llvm-project?rev=352177=rev
Log:
[MSP430] Ajust f32/f64 alignment according to MSP430 EABI

Patch by Kristina Bessonova!

Differential Revision: https://reviews.llvm.org/D57015

Added:
cfe/trunk/test/CodeGen/msp430-align.c
Modified:
cfe/trunk/lib/Basic/Targets/MSP430.h
cfe/trunk/test/Preprocessor/init.c

Modified: cfe/trunk/lib/Basic/Targets/MSP430.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/MSP430.h?rev=352177=352176=352177=diff
==
--- cfe/trunk/lib/Basic/Targets/MSP430.h (original)
+++ cfe/trunk/lib/Basic/Targets/MSP430.h Fri Jan 25 00:51:53 2019
@@ -33,6 +33,10 @@ public:
 LongWidth = 32;
 LongLongWidth = 64;
 LongAlign = LongLongAlign = 16;
+FloatWidth = 32;
+FloatAlign = 16;
+DoubleWidth = LongDoubleWidth = 64;
+DoubleAlign = LongDoubleAlign = 16;
 PointerWidth = 16;
 PointerAlign = 16;
 SuitableAlign = 16;
@@ -51,6 +55,8 @@ public:
 return None;
   }
 
+  bool allowsLargerPreferedTypeAlignment() const override { return false; }
+
   bool hasFeature(StringRef Feature) const override {
 return Feature == "msp430";
   }

Added: cfe/trunk/test/CodeGen/msp430-align.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/msp430-align.c?rev=352177=auto
==
--- cfe/trunk/test/CodeGen/msp430-align.c (added)
+++ cfe/trunk/test/CodeGen/msp430-align.c Fri Jan 25 00:51:53 2019
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple msp430-elf -emit-llvm %s -o - | FileCheck %s
+
+// MSP430 target prefers chars to be aligned to 8 bit and other types to 16 
bit.
+
+// CHECK: @c ={{.*}}global i8 1, align 1
+// CHECK: @s ={{.*}}global i16 266, align 2
+// CHECK: @i ={{.*}}global i16 266, align 2
+// CHECK: @l ={{.*}}global i32 16909060, align 2
+// CHECK: @ll ={{.*}}global i64 283686952306183, align 2
+// CHECK: @f ={{.*}}global float 1.00e+00, align 2
+// CHECK: @d ={{.*}}global double 1.00e+00, align 2
+// CHECK: @ld ={{.*}}global double 1.00e+00, align 2
+// CHECK: @p ={{.*}}global i8* @c, align 2
+
+char c = 1;
+short s = 266;
+int i = 266;
+long l = 16909060;
+long long ll = 283686952306183;
+float f = 1.0f;
+double d = 1.0;
+long double ld = 1.0;
+char *p = 

Modified: cfe/trunk/test/Preprocessor/init.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=352177=352176=352177=diff
==
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Fri Jan 25 00:51:53 2019
@@ -5158,7 +5158,7 @@
 // MSP430:#define __SIZE_MAX__ 65535U
 // MSP430:#define __SIZE_TYPE__ unsigned int
 // MSP430:#define __SIZE_WIDTH__ 16
-// MSP430-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U
+// MSP430-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 2U
 // MSP430:#define __UINT16_C_SUFFIX__ U
 // MSP430:#define __UINT16_MAX__ 65535U
 // MSP430:#define __UINT16_TYPE__ unsigned short


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


r351449 - CodeGen: Cast llvm.flt.rounds result to match __builtin_flt_rounds

2019-01-17 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Thu Jan 17 07:21:55 2019
New Revision: 351449

URL: http://llvm.org/viewvc/llvm-project?rev=351449=rev
Log:
CodeGen: Cast llvm.flt.rounds result to match __builtin_flt_rounds

llvm.flt.rounds returns an i32, but the builtin expects an integer. 
On targets where integers are not 32-bits clang tries to bitcast the result, 
causing an assertion failure.

The patch enables newlib build for msp430.

Patch by Edward Jones!

Differential Revision: https://reviews.llvm.org/D24461


Added:
cfe/trunk/test/CodeGen/builtins-msp430.c
Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/builtins.c

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=351449=351448=351449=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Jan 17 07:21:55 2019
@@ -2130,6 +2130,17 @@ RValue CodeGenFunction::EmitBuiltinExpr(
 return RValue::get(Builder.CreateZExt(V, ConvertType(E->getType(;
   }
 
+  case Builtin::BI__builtin_flt_rounds: {
+Value *F = CGM.getIntrinsic(Intrinsic::flt_rounds);
+
+llvm::Type *ResultType = ConvertType(E->getType());
+Value *Result = Builder.CreateCall(F);
+if (Result->getType() != ResultType)
+  Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
+ "cast");
+return RValue::get(Result);
+  }
+
   case Builtin::BI__builtin_fpclassify: {
 Value *V = EmitScalarExpr(E->getArg(5));
 llvm::Type *Ty = ConvertType(E->getArg(5)->getType());

Added: cfe/trunk/test/CodeGen/builtins-msp430.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-msp430.c?rev=351449=auto
==
--- cfe/trunk/test/CodeGen/builtins-msp430.c (added)
+++ cfe/trunk/test/CodeGen/builtins-msp430.c Thu Jan 17 07:21:55 2019
@@ -0,0 +1,10 @@
+// REQUIRES: msp430-registered-target
+// RUN: %clang_cc1 -triple msp430-unknown-unknown -emit-llvm %s -o - | 
FileCheck %s
+
+int test_builtin_flt_rounds() {
+  // CHECK: [[V0:[%A-Za-z0-9.]+]] = call i32 @llvm.flt.rounds()
+  // CHECK-DAG: [[V1:[%A-Za-z0-9.]+]] = trunc i32 [[V0]] to i16
+  // CHECK-DAG: ret i16 [[V1]]
+  return __builtin_flt_rounds();
+}
+

Modified: cfe/trunk/test/CodeGen/builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins.c?rev=351449=351448=351449=diff
==
--- cfe/trunk/test/CodeGen/builtins.c (original)
+++ cfe/trunk/test/CodeGen/builtins.c Thu Jan 17 07:21:55 2019
@@ -246,6 +246,9 @@ void test_float_builtins(float F, double
   // CHECK: fcmp uge float {{.*}}, 0x3810
   // CHECK: and i1
   // CHECK: and i1
+
+  res = __builtin_flt_rounds();
+  // CHECK: call i32 @llvm.flt.rounds(
 }
 
 // CHECK-LABEL: define void @test_float_builtin_ops


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


r351344 - [MSP430] Improve support of 'interrupt' attribute

2019-01-16 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Wed Jan 16 05:44:01 2019
New Revision: 351344

URL: http://llvm.org/viewvc/llvm-project?rev=351344=rev
Log:
[MSP430] Improve support of 'interrupt' attribute

* Accept as an argument constants in range 0..63 (aligned with TI headers and 
linker scripts provided with TI GCC toolchain).
* Emit function attribute 'interrupt'='xx' instead of aliases (used in the 
backend to create a section for particular interrupt vector).
* Add more diagnostics.

Patch by Kristina Bessonova!

Differential Revision: https://reviews.llvm.org/D56663

Added:
cfe/trunk/test/CodeGen/attr-msp430.c
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/CodeGen/TargetInfo.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/test/Sema/attr-msp430.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=351344=351343=351344=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Jan 16 05:44:01 
2019
@@ -274,6 +274,10 @@ def warn_riscv_interrupt_attribute : War
"RISC-V 'interrupt' attribute only applies to functions that have "
"%select{no parameters|a 'void' return type}0">,
InGroup;
+def warn_msp430_interrupt_attribute : Warning<
+   "MSP430 'interrupt' attribute only applies to functions that have "
+   "%select{no parameters|a 'void' return type}0">,
+   InGroup;
 def warn_unused_parameter : Warning<"unused parameter %0">,
   InGroup, DefaultIgnore;
 def warn_unused_variable : Warning<"unused variable %0">,

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=351344=351343=351344=diff
==
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Wed Jan 16 05:44:01 2019
@@ -6774,21 +6774,19 @@ void MSP430TargetCodeGenInfo::setTargetA
   if (GV->isDeclaration())
 return;
   if (const FunctionDecl *FD = dyn_cast_or_null(D)) {
-if (const MSP430InterruptAttr *attr = FD->getAttr()) {
-  // Handle 'interrupt' attribute:
-  llvm::Function *F = cast(GV);
+const auto *InterruptAttr = FD->getAttr();
+if (!InterruptAttr)
+  return;
 
-  // Step 1: Set ISR calling convention.
-  F->setCallingConv(llvm::CallingConv::MSP430_INTR);
+// Handle 'interrupt' attribute:
+llvm::Function *F = cast(GV);
 
-  // Step 2: Add attributes goodness.
-  F->addFnAttr(llvm::Attribute::NoInline);
+// Step 1: Set ISR calling convention.
+F->setCallingConv(llvm::CallingConv::MSP430_INTR);
 
-  // Step 3: Emit ISR vector alias.
-  unsigned Num = attr->getNumber() / 2;
-  llvm::GlobalAlias::create(llvm::Function::ExternalLinkage,
-"__isr_" + Twine(Num), F);
-}
+// Step 2: Add attributes goodness.
+F->addFnAttr(llvm::Attribute::NoInline);
+F->addFnAttr("interrupt", llvm::utostr(InterruptAttr->getNumber()));
   }
 }
 

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=351344=351343=351344=diff
==
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Jan 16 05:44:01 2019
@@ -5377,6 +5377,27 @@ static void handleARMInterruptAttr(Sema
 }
 
 static void handleMSP430InterruptAttr(Sema , Decl *D, const ParsedAttr ) {
+  // MSP430 'interrupt' attribute is applied to
+  // a function with no parameters and void return type.
+  if (!isFunctionOrMethod(D)) {
+S.Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)
+<< "'interrupt'" << ExpectedFunctionOrMethod;
+return;
+  }
+
+  if (hasFunctionProto(D) && getFunctionOrMethodNumParams(D) != 0) {
+S.Diag(D->getLocation(), diag::warn_msp430_interrupt_attribute)
+<< 0;
+return;
+  }
+
+  if (!getFunctionOrMethodResultType(D)->isVoidType()) {
+S.Diag(D->getLocation(), diag::warn_msp430_interrupt_attribute)
+<< 1;
+return;
+  }
+
+  // The attribute takes one integer argument.
   if (!checkAttributeNumArgs(S, AL, 1))
 return;
 
@@ -5386,8 +5407,6 @@ static void handleMSP430InterruptAttr(Se
 return;
   }
 
-  // FIXME: Check for decl - it should be void ()(void).
-
   Expr *NumParamsExpr = static_cast(AL.getArgAsExpr(0));
   llvm::APSInt NumParams(32);
   if (!NumParamsExpr->isIntegerConstantExpr(NumParams, S.Context)) {
@@ -5396,9 +5415,9 @@ static void handleMSP430InterruptAttr(Se
 << NumParamsExpr->getSourceRange();
 return;
   }
-
+  // The argument should be in range 0..63.
   unsigned Num = NumParams.getLimitedValue(255);
-  if ((Num & 

r351340 - [MSP430] Fix msp430-toolchain.c on Windows (added in r351228)

2019-01-16 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Wed Jan 16 05:28:30 2019
New Revision: 351340

URL: http://llvm.org/viewvc/llvm-project?rev=351340=rev
Log:
[MSP430] Fix msp430-toolchain.c on Windows (added in r351228)

Patch by Kristina Bessonova!

Differential Revision: https://reviews.llvm.org/D56776


Modified:
cfe/trunk/test/Driver/msp430-toolchain.c

Modified: cfe/trunk/test/Driver/msp430-toolchain.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/msp430-toolchain.c?rev=351340=351339=351340=diff
==
--- cfe/trunk/test/Driver/msp430-toolchain.c (original)
+++ cfe/trunk/test/Driver/msp430-toolchain.c Wed Jan 16 05:28:30 2019
@@ -8,44 +8,44 @@
 // RUN:   --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
 // RUN:   | FileCheck -check-prefix=MSP430 %s
 
-// MSP430: 
"{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld"
+// MSP430: 
"{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
 // MSP430: "-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430"
-// MSP430: 
"-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430"
-// MSP430: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crt0.o"
-// MSP430: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o"
+// MSP430: 
"-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}msp430-elf{{/|}}lib/430"
+// MSP430: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}msp430-elf{{/|}}lib/430{{/|}}crt0.o"
+// MSP430: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430{{/|}}crtbegin.o"
 // MSP430: "--start-group" "-lmul_none" "-lgcc" "-lc" "-lcrt" "-lnosys" 
"--end-group"
-// MSP430: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o"
-// MSP430: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crtn.o"
+// MSP430: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430{{/|}}crtend.o"
+// MSP430: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}msp430-elf{{/|}}lib/430{{/|}}crtn.o"
 
 // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nodefaultlibs \
 // RUN:   --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
 // RUN:   | FileCheck -check-prefix=MSP430-NO-DFT-LIB %s
 
-// MSP430-NO-DFT-LIB: 
"{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld"
+// MSP430-NO-DFT-LIB: 
"{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
 // MSP430-NO-DFT-LIB: 
"-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430"
-// MSP430-NO-DFT-LIB: 
"-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430"
-// MSP430-NO-DFT-LIB: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crt0.o"
-// MSP430-NO-DFT-LIB: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o"
+// MSP430-NO-DFT-LIB: 
"-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}msp430-elf{{/|}}lib/430"
+// MSP430-NO-DFT-LIB: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}msp430-elf{{/|}}lib/430{{/|}}crt0.o"
+// MSP430-NO-DFT-LIB: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430{{/|}}crtbegin.o"
 // MSP430-NO-DFT-LIB: "--start-group" "-lmul_none" "-lgcc" "--end-group"
-// MSP430-NO-DFT-LIB: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o"
-// MSP430-NO-DFT-LIB: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430/crtn.o"
+// MSP430-NO-DFT-LIB: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430{{/|}}crtend.o"
+// MSP430-NO-DFT-LIB: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}msp430-elf{{/|}}lib/430{{/|}}crtn.o"
 
 // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostartfiles \
 // RUN:   --gcc-toolchain=%S/Inputs/basic_msp430_tree 2>&1 \
 // RUN:   | FileCheck -check-prefix=MSP430-NO-START %s
 
-// MSP430-NO-START: 
"{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../bin/msp430-elf-ld"
+// MSP430-NO-START: 
"{{.*}}Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
 // MSP430-NO-START: 
"-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430"
-// MSP430-NO-START: 
"-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/lib/430"
+// MSP430-NO-START: 
"-L{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/../../..{{/|}}..{{/|}}msp430-elf{{/|}}lib/430"
 // MSP430-NO-START: "--start-group" 

Re: r351241 - CodeGen: Remove debug printf unintentionally added in r351228.

2019-01-15 Thread Anton Korobeynikov via cfe-commits
Thanks!

On Wed, Jan 16, 2019 at 12:03 AM Peter Collingbourne via cfe-commits
 wrote:
>
> Author: pcc
> Date: Tue Jan 15 12:59:59 2019
> New Revision: 351241
>
> URL: http://llvm.org/viewvc/llvm-project?rev=351241=rev
> Log:
> CodeGen: Remove debug printf unintentionally added in r351228.
>
> Modified:
> cfe/trunk/lib/CodeGen/CodeGenModule.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=351241=351240=351241=diff
> ==
> --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Jan 15 12:59:59 2019
> @@ -137,12 +137,10 @@ CodeGenModule::CodeGenModule(ASTContext
>
>// Enable TBAA unless it's suppressed. ThreadSanitizer needs TBAA even at 
> O0.
>if (LangOpts.Sanitize.has(SanitizerKind::Thread) ||
> -  (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0)) {
> -fprintf(stderr, "TBAA enabled\n");
> +  (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0))
>  TBAA.reset(new CodeGenTBAA(Context, TheModule, CodeGenOpts, 
> getLangOpts(),
> getCXXABI().getMangleContext()));
> -  }
> -
> +
>// If debug info or coverage generation is enabled, create the CGDebugInfo
>// object.
>if (CodeGenOpts.getDebugInfo() != codegenoptions::NoDebugInfo ||
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits



-- 
With best regards, Anton Korobeynikov
Department of Statistical Modelling, Saint Petersburg State University
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r351228 - [MSP430] Provide a toolchain description

2019-01-15 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Tue Jan 15 11:44:05 2019
New Revision: 351228

URL: http://llvm.org/viewvc/llvm-project?rev=351228=rev
Log:
[MSP430] Provide a toolchain description

This is an initial implementation for msp430 toolchain including
-mmcu option support
-mhwmult options support
-integrated-as by default

The toolchain uses msp430-elf-as as a linker and supports msp430-gcc toolchain 
tree.

Patch by Kristina Bessonova!

Differential Revision: https://reviews.llvm.org/D56658

Added:
cfe/trunk/include/clang/Basic/MSP430Target.def
cfe/trunk/lib/Driver/ToolChains/MSP430.cpp
cfe/trunk/lib/Driver/ToolChains/MSP430.h
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/bin/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/bin/msp430-elf-ld   (with 
props)
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/lib/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/lib/gcc/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/

cfe/trunk/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtbegin.o

cfe/trunk/test/Driver/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/7.3.1/430/crtend.o
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/msp430-elf/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/crt0.o
cfe/trunk/test/Driver/Inputs/basic_msp430_tree/msp430-elf/lib/430/crtn.o
cfe/trunk/test/Driver/msp430-hwmult.c
cfe/trunk/test/Driver/msp430-mmcu.c
cfe/trunk/test/Driver/msp430-toolchain.c
Modified:
cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/include/clang/module.modulemap
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Driver/CMakeLists.txt
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
cfe/trunk/test/Driver/no-integrated-as.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=351228=351227=351228=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Tue Jan 15 11:44:05 
2019
@@ -414,4 +414,15 @@ def err_drv_trivial_auto_var_init_zero_d
   "-ftrivial-auto-var-init=zero hasn't been enabled. Enable it at your own 
peril for benchmarking purpose only with "
   "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">;
 
+def warn_drv_msp430_hwmult_unsupported : Warning<"the given MCU does not "
+  "support hardware multiply, but -mhwmult is set to %0.">,
+   InGroup;
+def warn_drv_msp430_hwmult_mismatch : Warning<"the given MCU supports %0 "
+  "hardware multiply, but -mhwmult is set to %1.">,
+   InGroup;
+def warn_drv_msp430_hwmult_no_device : Warning<"no MCU device specified, but "
+  "'-mhwmult' is set to 'auto', assuming no hardware multiply. Use -mmcu to "
+  "specify a MSP430 device, or -mhwmult to set hardware multiply type "
+  "explicitly.">, InGroup;
+
 }

Added: cfe/trunk/include/clang/Basic/MSP430Target.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/MSP430Target.def?rev=351228=auto
==
--- cfe/trunk/include/clang/Basic/MSP430Target.def (added)
+++ cfe/trunk/include/clang/Basic/MSP430Target.def Tue Jan 15 11:44:05 2019
@@ -0,0 +1,247 @@
+//===--- MSP430Target.def - MSP430 Feature/Processor Database*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// This file defines the MSP430 devices and their features.
+//
+//===--===//
+
+#ifndef MSP430_MCU_FEAT
+#define MSP430_MCU_FEAT(NAME, HWMULT) MSP430_MCU(NAME)
+#endif
+
+#ifndef MSP430_MCU
+#define MSP430_MCU(NAME)
+#endif
+
+MSP430_MCU("msp430c111")
+MSP430_MCU("msp430c")
+MSP430_MCU("msp430c112")
+MSP430_MCU("msp430c1121")
+MSP430_MCU("msp430c1331")
+MSP430_MCU("msp430c1351")
+MSP430_MCU("msp430e112")
+MSP430_MCU("msp430f110")
+MSP430_MCU("msp430f1101")
+MSP430_MCU("msp430f1101a")
+MSP430_MCU("msp430f")
+MSP430_MCU("msp430fa")
+MSP430_MCU("msp430f112")
+MSP430_MCU("msp430f1121")
+MSP430_MCU("msp430f1121a")
+MSP430_MCU("msp430f1122")
+MSP430_MCU("msp430f1132")

r297005 - Do not include GCC "resource" directory into the set of built-in include paths on MingW.

2017-03-06 Thread Anton Korobeynikov via cfe-commits
Author: asl
Date: Mon Mar  6 03:32:56 2017
New Revision: 297005

URL: http://llvm.org/viewvc/llvm-project?rev=297005=rev
Log:
Do not include GCC "resource" directory into the set of built-in include paths 
on MingW.

Patch by Mateusz MikuĊ‚a.

Differential Revision: https://reviews.llvm.org/D29464


Modified:
cfe/trunk/lib/Driver/MinGWToolChain.cpp
cfe/trunk/test/Driver/mingw.cpp

Modified: cfe/trunk/lib/Driver/MinGWToolChain.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/MinGWToolChain.cpp?rev=297005=297004=297005=diff
==
--- cfe/trunk/lib/Driver/MinGWToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/MinGWToolChain.cpp Mon Mar  6 03:32:56 2017
@@ -148,23 +148,17 @@ void MinGW::printVerboseInfo(raw_ostream
 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++
 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32
 // c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\backward
-// c:\mingw\lib\gcc\mingw32\4.8.1\include
 // c:\mingw\include
-// c:\mingw\lib\gcc\mingw32\4.8.1\include-fixed
 // c:\mingw\mingw32\include
 
 // Windows, mingw-w64 mingw-builds
-// c:\mingw32\lib\gcc\i686-w64-mingw32\4.9.1\include
-// c:\mingw32\lib\gcc\i686-w64-mingw32\4.9.1\include-fixed
 // c:\mingw32\i686-w64-mingw32\include
 // c:\mingw32\i686-w64-mingw32\include\c++
 // c:\mingw32\i686-w64-mingw32\include\c++\i686-w64-mingw32
 // c:\mingw32\i686-w64-mingw32\include\c++\backward
 
 // Windows, mingw-w64 msys2
-// c:\msys64\mingw32\lib\gcc\i686-w64-mingw32\4.9.2\include
 // c:\msys64\mingw32\include
-// c:\msys64\mingw32\lib\gcc\i686-w64-mingw32\4.9.2\include-fixed
 // c:\msys64\mingw32\i686-w64-mingw32\include
 // c:\msys64\mingw32\include\c++\4.9.2
 // c:\msys64\mingw32\include\c++\4.9.2\i686-w64-mingw32
@@ -174,24 +168,18 @@ void MinGW::printVerboseInfo(raw_ostream
 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++
 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++/x86_64-w64-mingw32
 // /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include/c++/backward
-// /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include
-// /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0/include-fixed
 // /usr/x86_64-w64-mingw32/sys-root/mingw/include
 
 // Arch Linux
 // /usr/i686-w64-mingw32/include/c++/5.1.0
 // /usr/i686-w64-mingw32/include/c++/5.1.0/i686-w64-mingw32
 // /usr/i686-w64-mingw32/include/c++/5.1.0/backward
-// /usr/lib/gcc/i686-w64-mingw32/5.1.0/include
-// /usr/lib/gcc/i686-w64-mingw32/5.1.0/include-fixed
 // /usr/i686-w64-mingw32/include
 
 // Ubuntu
 // /usr/include/c++/4.8
 // /usr/include/c++/4.8/x86_64-w64-mingw32
 // /usr/include/c++/4.8/backward
-// /usr/lib/gcc/x86_64-w64-mingw32/4.8/include
-// /usr/lib/gcc/x86_64-w64-mingw32/4.8/include-fixed
 // /usr/x86_64-w64-mingw32/include
 
 void MinGW::AddClangSystemIncludeArgs(const ArgList ,
@@ -209,15 +197,11 @@ void MinGW::AddClangSystemIncludeArgs(co
 return;
 
   if (GetRuntimeLibType(DriverArgs) == ToolChain::RLT_Libgcc) {
-llvm::SmallString<1024> IncludeDir(GccLibDir);
-llvm::sys::path::append(IncludeDir, "include");
-addSystemInclude(DriverArgs, CC1Args, IncludeDir.c_str());
-IncludeDir += "-fixed";
 // openSUSE
 addSystemInclude(DriverArgs, CC1Args,
  Base + Arch + "/sys-root/mingw/include");
-addSystemInclude(DriverArgs, CC1Args, IncludeDir.c_str());
   }
+
   addSystemInclude(DriverArgs, CC1Args,
Base + Arch + llvm::sys::path::get_separator() + "include");
   addSystemInclude(DriverArgs, CC1Args, Base + "include");

Modified: cfe/trunk/test/Driver/mingw.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mingw.cpp?rev=297005=297004=297005=diff
==
--- cfe/trunk/test/Driver/mingw.cpp (original)
+++ cfe/trunk/test/Driver/mingw.cpp Mon Mar  6 03:32:56 2017
@@ -7,8 +7,6 @@
 // CHECK_MINGW_ORG_TREE: 
"{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|}}lib{{/|}}gcc{{/|}}mingw32{{/|}}4.8.1{{/|}}include{{/|}}c++"
 // CHECK_MINGW_ORG_TREE: 
"{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|}}lib{{/|}}gcc{{/|}}mingw32{{/|}}4.8.1{{/|}}include{{/|}}c++{{/|}}mingw32"
 // CHECK_MINGW_ORG_TREE: 
"{{.*}}{{/|}}Inputs/mingw_mingw_org_tree/mingw{{/|}}lib{{/|}}gcc{{/|}}mingw32{{/|}}4.8.1{{/|}}include{{/|}}c++{{/|}}backward"
-// CHECK_MINGW_ORG_TREE: 
"{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|}}lib{{/|}}gcc{{/|}}mingw32{{/|}}4.8.1{{/|}}include"
-// CHECK_MINGW_ORG_TREE: 
"{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|}}lib{{/|}}gcc{{/|}}mingw32{{/|}}4.8.1{{/|}}include-fixed"
 // CHECK_MINGW_ORG_TREE: 
"{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|}}mingw32{{/|}}include"
 // CHECK_MINGW_ORG_TREE: 
{{.*}}/Inputs/mingw_mingw_org_tree/mingw{{/|}}include
 
@@ -17,8 +15,6 @@
 // CHECK_MINGW_BUILDS_TREE: 

Re: [PATCH] D24084: [CMake] Cleanup libunwind lookup code.

2016-09-02 Thread Anton Korobeynikov via cfe-commits
asl added a comment.

I totally agree with Renato. What part of libc++abi requires exactly 
libunwind's unwind.h, what is the dependency?


https://reviews.llvm.org/D24084



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


Re: [PATCH] D21737: [PATCH] [CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.

2016-06-26 Thread Anton Korobeynikov via cfe-commits
asl added a comment.

Hrm? Why I'm set to review this?


Repository:
  rL LLVM

http://reviews.llvm.org/D21737



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


Re: [PATCH] D16754: Bug 15785 - OpenCL errors using vector/scalar conditionals and short integer types

2016-01-31 Thread Anton Korobeynikov via cfe-commits
asl requested changes to this revision.
asl added a comment.
This revision now requires changes to proceed.

Please don't create empty review requests. This is ridiculous.


Repository:
  rL LLVM

http://reviews.llvm.org/D16754



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