Page MenuHomePhabricator
Feed Advanced Search

Jan 15 2019

mgrang added a comment to D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
In D53541#1356904, @rnk wrote:

What about the three stack pointer case of stack realignment plus a dynamic alloca? Typically this is the case where recoverfp is necessary.

@rnk Sorry, I missed your comment earlier. I am not sure what scenario the three stack pointer case is. Could you please give me a test case for it?

I think you just need a local variable with an alignment greater than the ABI provides, something like:

struct Foo {
  Foo();
  int x, y, z;
};
int filter(int);
void may_throw();
void seh_byval(int n) {
  Foo __declspec(align(32)) o;
  __try {
    may_throw();
  } __except(filter(o.x)) {
  }
}
Jan 15 2019, 10:24 AM

Jan 14 2019

mgrang committed rL351147: [COFF, ARM64] Add __byteswap intrinsics.
[COFF, ARM64] Add __byteswap intrinsics
Jan 14 2019, 5:30 PM
mgrang committed rC351147: [COFF, ARM64] Add __byteswap intrinsics.
[COFF, ARM64] Add __byteswap intrinsics
Jan 14 2019, 5:30 PM
mgrang closed D56685: [COFF, ARM64] Add __byteswap intrinsics.
Jan 14 2019, 5:30 PM
mgrang added a comment to D56685: [COFF, ARM64] Add __byteswap intrinsics.

Verified that this compiles when both intrin.h and stdlib.h from the Microsoft SDK are included, in either order.

Jan 14 2019, 5:24 PM
mgrang updated the diff for D56685: [COFF, ARM64] Add __byteswap intrinsics.
Jan 14 2019, 5:24 PM
mgrang updated the diff for D56685: [COFF, ARM64] Add __byteswap intrinsics.
Jan 14 2019, 4:53 PM
mgrang committed rC351137: [Sema] Change std::sort to llvm::sort.
[Sema] Change std::sort to llvm::sort
Jan 14 2019, 3:50 PM
mgrang committed rL351137: [Sema] Change std::sort to llvm::sort.
[Sema] Change std::sort to llvm::sort
Jan 14 2019, 3:49 PM
mgrang committed rC351135: [COFF, ARM64] Add __nop intrinsic.
[COFF, ARM64] Add __nop intrinsic
Jan 14 2019, 3:30 PM
mgrang committed rL351135: [COFF, ARM64] Add __nop intrinsic.
[COFF, ARM64] Add __nop intrinsic
Jan 14 2019, 3:30 PM
mgrang closed D56671: [COFF, ARM64] Add __nop intrinsic.
Jan 14 2019, 3:30 PM
mgrang abandoned D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].

_bytswap intrinsics are added in D56685. Abandoning this patch.

Jan 14 2019, 3:28 PM
mgrang created D56685: [COFF, ARM64] Add __byteswap intrinsics.
Jan 14 2019, 3:27 PM
mgrang added a comment to D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].

I have implemented __nop intrinsic in D56671

Jan 14 2019, 10:09 AM
mgrang created D56671: [COFF, ARM64] Add __nop intrinsic.
Jan 14 2019, 10:09 AM

Jan 11 2019

mgrang retitled D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64] from [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[short/long/uint64] to [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].
Jan 11 2019, 4:27 PM
mgrang updated the diff for D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].
Jan 11 2019, 4:26 PM
mgrang added a comment to D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].

Have you verified this matches MSVC? (IIRC the only reason we include stdlib.h on x86 is so we can define _mm_malloc.)

Jan 11 2019, 4:25 PM
mgrang created D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64].
Jan 11 2019, 4:04 PM
mgrang updated the diff for D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
Jan 11 2019, 11:20 AM
mgrang added inline comments to D56463: [SEH] Pass the frame pointer from SEH finally to finally functions.
Jan 11 2019, 10:32 AM

Jan 10 2019

mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

Added test cases for localescape and try-finally. Will add try-except test case soon.

Jan 10 2019, 5:18 PM
mgrang accepted D56468: [EarlyIfConversion] Don't if-convert unconditional branches..

LGTM. I have verified that this patch resolves the problem in our custom code base.

Jan 10 2019, 3:21 PM
mgrang added a comment to D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
In D53541#1282900, @rnk wrote:

Updated the patch with the following changes:

  1. Emit llvm.x86.seh.recoverfp only for non-aarch64 targets. For aarch64 windows, the parent fp is always passed in x1. So we don't need a separate instrinsic to recover the fp.

What about the three stack pointer case of stack realignment plus a dynamic alloca? Typically this is the case where recoverfp is necessary.

Jan 10 2019, 12:31 PM
mgrang updated the diff for D53541: [COFF, ARM64] Do not emit x86_seh_recoverfp intrinsic.
Jan 10 2019, 10:55 AM

Jan 9 2019

mgrang committed rL350798: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
[AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc
Jan 9 2019, 9:03 PM
mgrang closed D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Jan 9 2019, 9:03 PM
mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Jan 9 2019, 6:51 PM
mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Jan 9 2019, 6:35 PM
mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Jan 9 2019, 6:34 PM

Jan 8 2019

mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Jan 8 2019, 3:46 PM
mgrang added a comment to rLLDB350679: Change std::sort to llvm::sort to detect non-determinism..

Thanks for doing this. llvm::sort also takes a range-based argument. So I guess we can drop the begin/end from all arguments to llvm::sort

llvm::sort(names.begin(), names.end())  ==>  llvm::sort(names)
Jan 8 2019, 3:36 PM
mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Jan 8 2019, 11:35 AM
mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

Addressed comments. The MCSymbol for the frame offset is now lowered in the assembler. D56037 needs to merge first.
I am now working on test cases. Will push them soon.

Jan 8 2019, 11:10 AM

Jan 7 2019

mgrang committed rL350606: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
[MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc.
Jan 7 2019, 8:52 PM
mgrang closed D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Jan 7 2019, 8:51 PM
mgrang updated the diff for D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Jan 7 2019, 3:46 PM
mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Jan 7 2019, 10:24 AM

Jan 4 2019

mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Jan 4 2019, 12:11 PM
mgrang added inline comments to D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Jan 4 2019, 11:39 AM
mgrang added a comment to D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
In D56037#1346032, @rnk wrote:

Still needs tests, right?

Jan 4 2019, 10:36 AM

Jan 2 2019

mgrang added a comment to D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..

Ping2 for reviews please.

Jan 2 2019, 11:27 AM

Dec 26 2018

mgrang updated the diff for D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Dec 26 2018, 1:07 PM
mgrang added a comment to D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..

Ping for reviews please.

Dec 26 2018, 10:00 AM

Dec 21 2018

mgrang added a comment to D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.

I am not sure what kind of tests I should add for this patch. This is one of the patches needed for adding SEH support to LLVM (D53540).

Dec 21 2018, 4:33 PM
mgrang created D56037: [AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc.
Dec 21 2018, 4:32 PM
mgrang updated the diff for D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Dec 21 2018, 3:52 PM
mgrang updated the diff for D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Dec 21 2018, 3:10 PM
mgrang retitled D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc. from [COFF, ARM64] Support resolving signed fixups for :abs_g0_s: etc. to [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Dec 21 2018, 2:57 PM
mgrang created D56029: [MC] [AArch64] Support resolving signed fixups for :abs_g0_s: etc..
Dec 21 2018, 2:55 PM

Dec 20 2018

mgrang accepted D55906: [MC] [AArch64] Correctly resolve ":abs_g1:3" etc..

LGTM. I have verified that this patch fixes the error if the label is defined before the use (mentioned in D55896).

Dec 20 2018, 11:26 AM
mgrang accepted D55896: [MC] [AArch64] Support resolving fixups for :abs_g0: etc..

LGTM.

Dec 20 2018, 11:25 AM

Dec 19 2018

mgrang added a reviewer for D55896: [MC] [AArch64] Support resolving fixups for :abs_g0: etc.: mgrang.
Dec 19 2018, 12:35 PM
mgrang added a comment to D55896: [MC] [AArch64] Support resolving fixups for :abs_g0: etc..

This doesn't seem to work if the label is defined before the use:

Dec 19 2018, 12:34 PM

Dec 18 2018

mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 18 2018, 5:14 PM
mgrang added inline comments to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 18 2018, 5:10 PM
mgrang added inline comments to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 18 2018, 1:23 PM
mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 18 2018, 1:17 PM

Dec 11 2018

mgrang committed rL348875: [COFF, ARM64] Emit COFF function header.
[COFF, ARM64] Emit COFF function header
Dec 11 2018, 10:39 AM
mgrang closed D55535: [COFF, ARM64] Emit COFF function header.
Dec 11 2018, 10:39 AM

Dec 10 2018

mgrang added a comment to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

@dmajor My updated change fixes the crash in your testcase.

Now, I am trying to build the SEH tests released by MS: https://github.com/Microsoft/windows_seh_tests. I started with XCPT4 tests. test5 is currently failing which I am triaging now.

@mgrang, the SEH fix still causes ARM64 COFF file crash when linking with CFG enabled (/guard:cf). Seems functions are not marked as IMAGE_SYM_DTYPE_FUNCTION in ARM64 COFF which was done in both x86 and arm32 COFF (see below 2 links).

https://github.com/llvm-mirror/llvm/blob/2cc0a7da876c1d8c32775b0119e1e15aaa759b9e/lib/Target/X86/X86AsmPrinter.cpp#L67

https://github.com/llvm-mirror/llvm/blob/2cc0a7da876c1d8c32775b0119e1e15aaa759b9e/lib/Target/ARM/ARMAsmPrinter.cpp#L148

Dec 10 2018, 5:23 PM
mgrang created D55535: [COFF, ARM64] Emit COFF function header.
Dec 10 2018, 5:23 PM
mgrang added a comment to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.

@dmajor My updated change fixes the crash in your testcase.

Dec 10 2018, 4:19 PM
mgrang updated the diff for D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Dec 10 2018, 4:11 PM
mgrang added inline comments to D55467: [WebAssembly] Optimize Irreducible Control Flow.
Dec 10 2018, 2:22 PM
mgrang added a comment to D55229: [COFF] Statically link certain runtime library functions.

Ping for reviews please.

Dec 10 2018, 10:25 AM · Restricted Project, Restricted Project

Dec 5 2018

mgrang committed rC348402: Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target"".
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Dec 5 2018, 11:23 AM
mgrang committed rL348402: Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target"".
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Dec 5 2018, 11:23 AM

Dec 4 2018

mgrang added inline comments to D55229: [COFF] Statically link certain runtime library functions.
Dec 4 2018, 12:55 PM · Restricted Project, Restricted Project
mgrang updated the diff for D55229: [COFF] Statically link certain runtime library functions.
Dec 4 2018, 12:53 PM · Restricted Project, Restricted Project

Dec 3 2018

mgrang added a comment to D55229: [COFF] Statically link certain runtime library functions.
In D55229#1317333, @rnk wrote:

I think @compnerd arranged things this way. I don't know why -flto-visibility-public-std is involved, I have no idea what that does. I think we should do what MSVC does here, which is to leave _CxxThrowException unannotated and let the linker synthesize import thunks.

Here is the code in question that applies dllimport: https://github.com/llvm-git-prototype/llvm/blob/master/clang/lib/CodeGen/CodeGenModule.cpp#L2955

My suggestion would be to make it check isWindowsItaniumEnvironment so we can avoid this behavior which isn't desired under either mingw or MSVC.

Dec 3 2018, 1:35 PM · Restricted Project, Restricted Project
mgrang added a comment to D55229: [COFF] Statically link certain runtime library functions.
In D55229#1317232, @pcc wrote:

The reason why it has that name is that it was originally added to support the logic here: http://llvm-cs.pcc.me.uk/tools/clang/lib/CodeGen/CGVTables.cpp#991

It looks like it was later repurposed as a "was /MT passed to the driver" flag when the logic was added to mark runtime functions as dllimport depending on the value of the flag.

It certainly seems to make sense to rename it since the name makes no sense as a driver flag and is now being used for other purposes.

Dec 3 2018, 12:28 PM · Restricted Project, Restricted Project
mgrang added a reviewer for D55229: [COFF] Statically link certain runtime library functions: compnerd.
Dec 3 2018, 12:04 PM · Restricted Project, Restricted Project
mgrang added a comment to D55229: [COFF] Statically link certain runtime library functions.

I wonder why this flag is called -flto-visibility-public-std. It has nothing to do with -flto. While we are at it, does it make sense to rename this flag?

Dec 3 2018, 12:03 PM · Restricted Project, Restricted Project
mgrang created D55229: [COFF] Statically link certain runtime library functions.
Dec 3 2018, 12:02 PM · Restricted Project, Restricted Project

Nov 27 2018

mgrang committed rC347720: [RISCV] Mark unit tests as "requires: riscv-registered-target".
[RISCV] Mark unit tests as "requires: riscv-registered-target"
Nov 27 2018, 2:56 PM
mgrang committed rL347720: [RISCV] Mark unit tests as "requires: riscv-registered-target".
[RISCV] Mark unit tests as "requires: riscv-registered-target"
Nov 27 2018, 2:56 PM
mgrang committed rL347689: Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target"".
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Nov 27 2018, 11:17 AM
mgrang committed rC347689: Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target"".
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Nov 27 2018, 11:17 AM
mgrang committed rC347688: [RISCV] Mark unit tests as "requires: riscv-registered-target".
[RISCV] Mark unit tests as "requires: riscv-registered-target"
Nov 27 2018, 11:17 AM
mgrang committed rL347688: [RISCV] Mark unit tests as "requires: riscv-registered-target".
[RISCV] Mark unit tests as "requires: riscv-registered-target"
Nov 27 2018, 11:17 AM
mgrang closed D54816: [RISCV] Mark unit tests as "requires: riscv-registered-target".
Nov 27 2018, 11:17 AM
mgrang added a comment to D54816: [RISCV] Mark unit tests as "requires: riscv-registered-target".

Ping for reviews please.

Nov 27 2018, 10:37 AM

Nov 21 2018

mgrang created D54816: [RISCV] Mark unit tests as "requires: riscv-registered-target".
Nov 21 2018, 3:07 PM

Nov 14 2018

mgrang added inline comments to D54543: [stack-safety] Inter-Procedural Analysis implementation.
Nov 14 2018, 2:37 PM
mgrang committed rL346874: [InstCombine] Remove a couple of asserts based on incorrect assumptions.
[InstCombine] Remove a couple of asserts based on incorrect assumptions
Nov 14 2018, 9:57 AM
mgrang closed D54359: [InstCombine] Remove a couple of asserts based on incorrect assumptions.
Nov 14 2018, 9:57 AM

Nov 13 2018

mgrang updated the diff for D54359: [InstCombine] Remove a couple of asserts based on incorrect assumptions.

Addressed comments.

Nov 13 2018, 11:42 AM
mgrang added a comment to D54359: [InstCombine] Remove a couple of asserts based on incorrect assumptions.

@craig.topper Could you please review this? This is a blocker for our internal release.

Nov 13 2018, 10:51 AM

Nov 11 2018

mgrang updated the diff for D54359: [InstCombine] Remove a couple of asserts based on incorrect assumptions.

Simplified unit test.

Nov 11 2018, 11:17 AM

Nov 9 2018

mgrang updated the summary of D54359: [InstCombine] Remove a couple of asserts based on incorrect assumptions.
Nov 9 2018, 3:05 PM
mgrang added a comment to D54359: [InstCombine] Remove a couple of asserts based on incorrect assumptions.

Consider this case:

Nov 9 2018, 3:03 PM
mgrang created D54359: [InstCombine] Remove a couple of asserts based on incorrect assumptions.
Nov 9 2018, 3:03 PM

Nov 8 2018

mgrang committed rL346469: [COFF, ARM64] Add support for MSVC buffer security check.
[COFF, ARM64] Add support for MSVC buffer security check
Nov 8 2018, 6:51 PM
mgrang closed D54248: [COFF, ARM64] Add support for MSVC buffer security check.
Nov 8 2018, 6:51 PM
mgrang added inline comments to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Nov 8 2018, 12:14 PM
mgrang added inline comments to D53540: [COFF, ARM64] Implement support for SEH extensions __try/__except/__finally.
Nov 8 2018, 11:05 AM
mgrang added a comment to D54248: [COFF, ARM64] Add support for MSVC buffer security check.

Is there any existing test case for the mingw mode of the stack protector for aarch64? If not, can you add one at the same time, to show that it doesn't change with this patch (i.e. still uses __stack_chk_*).

Nov 8 2018, 11:01 AM

Nov 7 2018

mgrang created D54248: [COFF, ARM64] Add support for MSVC buffer security check.
Nov 7 2018, 5:53 PM