arichardson (Alexander Richardson)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 4 2015, 4:18 PM (149 w, 6 d)

Recent Activity

Fri, Jul 13

arichardson added a comment to D49084: FileCheck: Add support for variable expressions.

I case people are interested I have also implemented something similar in our fork of llvm. I chose [[@EXPR var + 0x42]] as the syntax. I also added some functions such as [[@EXPR hex(VAR)]].
Variables can either by referenced by name or if they conflict with one of the builtin functions using ${x} syntax: [[@EXPR toupper(hex(${hex}))]]

Simple functions are also on my wish-list! The main ones we care about are converting to and from hex numbers, and being able to do additions and subtractions. But I think just the basic integer and hex reading and additions would be a good start.

Fri, Jul 13, 2:06 AM

Thu, Jul 12

arichardson added a comment to D47541: Allow creating llvm::Function in non-zero address spaces.

This seems to work quite nice for me now! Nice!

I added a few inline nit comments. Apart from that it looks good to me.
Although, I don't know much about the bitcode reader/writer. Anyone else who can help out reviewing that part?

PS. I still have a few worries about how well this plays together with instrprof, we have had some hacks in that area earlier. Methods like appendToGlobalArray (in ModuleUtils.cpp) still uses PointerType::getUnqual(FnTy) to strip off the addrspace from function pointers (and afaik the size of a pointer can be different in different adress spaces).
Although, I don't think we can solve all problems right away. This patch at least gives us the power to set addrspace on functions. And that should help out if I for example want to reproduce instrprof problems on trunk (using an "experimental target" with non-zero program addrspace). So I think we can leave that for later.

Thu, Jul 12, 2:38 PM
arichardson added a comment to D49084: FileCheck: Add support for variable expressions.

I case people are interested I have also implemented something similar in our fork of llvm. I chose [[@EXPR var + 0x42]] as the syntax. I also added some functions such as [[@EXPR hex(VAR)]].
Variables can either by referenced by name or if they conflict with one of the builtin functions using ${x} syntax: [[@EXPR toupper(hex(${hex}))]]
Some examples of what it can do can be seen here: https://github.com/CTSRD-CHERI/llvm/blob/master/test/FileCheck/expressions.txt

Thu, Jul 12, 2:33 PM

Mon, Jul 9

arichardson updated the diff for D47541: Allow creating llvm::Function in non-zero address spaces.

Remove unrelated change and don't use llvm.phx.aload()

Mon, Jul 9, 11:15 AM
arichardson created D49091: Warn about usage of __has_include/__has_include_next in macro expansions.
Mon, Jul 9, 10:53 AM
arichardson updated the diff for D47541: Allow creating llvm::Function in non-zero address spaces.

Chose option 3) to handle forward-declarations.
I tried updating the address space later but that caused lots of problems.
Instead the call/invoke instruction can now accept an optional addrspace(N)
qualifier to indicate the address space of the called function.

Mon, Jul 9, 8:36 AM
arichardson created D49067: Stop wrapping __has_include in another macro.
Mon, Jul 9, 4:10 AM
arichardson added a comment to D45383: Limit types of builtins that can be redeclared..

This broke the build of FreeBSD for me due to the declaration of __builtin_return_address(unsigned int) in https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Base.h#L1281:

Mon, Jul 9, 1:53 AM · Restricted Project

Sun, Jul 8

arichardson added inline comments to D47541: Allow creating llvm::Function in non-zero address spaces.
Sun, Jul 8, 1:17 PM

Wed, Jul 4

arichardson abandoned D41821: [MIPS] Disassemble the 0xefefefef trap padding used by LLD.
Wed, Jul 4, 11:01 AM

Mon, Jul 2

arichardson added a comment to D48803: Place the BlockAddress type in the program address space.

I don't know much about the BlockAddress concept. The LangRef says things like "always has an i8* type" and "this may be passed around as an opaque pointer sized value". But I guess it would be weird if the size doesn't match the size of pointers in the program address space, so the patch makes sense to me.

I assume that this can't be reproduced for any in-tree target?
If you can't find an in-tree reproducer, then maybe you can describe the problem a little bit more instead. Such as which assert you hit, and maybe a small stack trace. That might help when trying to motivate this patch in the future.

Yes I'm not sure I can make a test for this with any of the existing targets. I'll see if I can get something with AVR since that sets program address space to 1.

Mon, Jul 2, 9:46 AM
arichardson added a comment to D47541: Allow creating llvm::Function in non-zero address spaces.

Ping? I've applied this to our fork and it has improved inlining and helps us avoid bugs due to using the wrong address space. I would very much like to have this upstream.

Mon, Jul 2, 9:44 AM

Sat, Jun 30

arichardson created D48803: Place the BlockAddress type in the program address space.
Sat, Jun 30, 6:26 AM

Mon, Jun 25

arichardson committed rL335495: Use Triple::isMIPS() instead of enumerating all Triples. NFC.
Use Triple::isMIPS() instead of enumerating all Triples. NFC
Mon, Jun 25, 9:55 AM
arichardson committed rC335495: Use Triple::isMIPS() instead of enumerating all Triples. NFC.
Use Triple::isMIPS() instead of enumerating all Triples. NFC
Mon, Jun 25, 9:54 AM
arichardson closed D48549: Use Triple::isMIPS() instead of enumerating all Triples. NFC.
Mon, Jun 25, 9:54 AM
arichardson committed rL335493: Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC.
Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC
Mon, Jun 25, 9:54 AM
arichardson closed D48548: Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC.
Mon, Jun 25, 9:54 AM
arichardson updated the diff for D48549: Use Triple::isMIPS() instead of enumerating all Triples. NFC.

Ran clang-format on the diff

Mon, Jun 25, 8:11 AM
arichardson added inline comments to D48548: Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC.
Mon, Jun 25, 8:11 AM
arichardson updated the diff for D48548: Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC.

Remove old comment

Mon, Jun 25, 8:11 AM
arichardson added a dependent revision for D48548: Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC: D48549: Use Triple::isMIPS() instead of enumerating all Triples. NFC.
Mon, Jun 25, 7:15 AM
arichardson added a dependency for D48549: Use Triple::isMIPS() instead of enumerating all Triples. NFC: D48548: Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC.
Mon, Jun 25, 7:15 AM
arichardson created D48549: Use Triple::isMIPS() instead of enumerating all Triples. NFC.
Mon, Jun 25, 7:10 AM
arichardson created D48548: Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFC.
Mon, Jun 25, 7:09 AM

Thu, Jun 21

arichardson added a reviewer for D47541: Allow creating llvm::Function in non-zero address spaces: bjope.

It would be really good if something like this could land soon as I'm currently in the process of doing a merge with upstream LLVM in our fork.
I just ran into the problem that always_inline wasn't working at -O0 for us due to functions being in AS0 but the calls in AS200 and the alwaysInliner only handles direct calls without an addressspacecast. This would be fixed if we could have functions in AS200.

Thu, Jun 21, 2:20 AM
arichardson added a comment to D37054: Require address space to be specified when creating functions (2/3).

I've extracted a patch without the Module* -> Module& changes in D47541. It would be really good if something like this could land soon since I just ran into the problem that always_inline wasn't working at -O0 for us due to functions being in AS0 but the calls in AS200 and the alwaysInliner only handles direct calls without an addressspacecast.

Thu, Jun 21, 2:18 AM

Jun 12 2018

arichardson committed rLLD334483: [ELF][MIPS] Fix TLS GOT entries for local symbols in shared libraries.
[ELF][MIPS] Fix TLS GOT entries for local symbols in shared libraries
Jun 12 2018, 1:05 AM
arichardson committed rL334483: [ELF][MIPS] Fix TLS GOT entries for local symbols in shared libraries.
[ELF][MIPS] Fix TLS GOT entries for local symbols in shared libraries
Jun 12 2018, 1:05 AM
arichardson closed D48002: [ELF][MIPS] Fix TLS GOT entries for local symbols in shared libraries.
Jun 12 2018, 1:05 AM

Jun 11 2018

arichardson created D48002: [ELF][MIPS] Fix TLS GOT entries for local symbols in shared libraries.
Jun 11 2018, 1:48 AM
arichardson added a comment to D47627: [ASTContext] Make getAddrSpaceQualType replace address spaces..

Well, the documentation mismatch is worth fixing even if the code isn't. But I think at best your use-case calls for weakening the assertion to be that any existing address space isn't *different*, yeah.

Separately, I'm not sure that's really the right representation for a Harvard architecture (which is what I assume you're trying to extend Clang to support); I think you should probably just teach the compiler that function pointers are different.

Jun 11 2018, 1:08 AM

Jun 10 2018

arichardson accepted D31528: [ELF][MIPS] Multi-GOT implementation.
Jun 10 2018, 11:15 AM · lld

May 30 2018

arichardson created D47541: Allow creating llvm::Function in non-zero address spaces.
May 30 2018, 9:35 AM

May 23 2018

arichardson added a comment to D31287: [mips] Fix atomic operations at O0, v3.

LGTM. Also looks like it should be easy to adjust our CHERI ll/sc instructions to use the same mechanism when I do the next upstream merge.

May 23 2018, 1:28 AM
arichardson accepted D31528: [ELF][MIPS] Multi-GOT implementation.

As I have mentioned before, having this patch is the difference between LLD being completely unusable for our purposes (linking FreeBSD MIPS n64) and being able to replace BFD.

May 23 2018, 1:22 AM · lld

May 16 2018

arichardson committed rL332440: Escape ]]> in xunit xml output.
Escape ]]> in xunit xml output
May 16 2018, 2:04 AM
arichardson closed D46886: Escape ]]> in xunit xml output.
May 16 2018, 2:04 AM
arichardson committed rL332439: Emit a left-shift instead of a power-of-two multiply for jump-tables.
Emit a left-shift instead of a power-of-two multiply for jump-tables
May 16 2018, 2:02 AM
arichardson closed D45760: Emit a left-shift instead of a power-of-two multiply for jump-tables.
May 16 2018, 2:02 AM

May 15 2018

arichardson added a comment to D46886: Escape ]]> in xunit xml output.

Is this an issue you are hitting? I noticed we spend a lot of time in string replace while writing the xunit files when the output is large (for instance if every test in the test suite fails). I was hoping the number of replaces we do could go down.

Besides that LGTM.

May 15 2018, 10:04 AM
arichardson created D46886: Escape ]]> in xunit xml output.
May 15 2018, 9:02 AM
arichardson updated the diff for D45760: Emit a left-shift instead of a power-of-two multiply for jump-tables.

Address review comment

May 15 2018, 8:26 AM

May 7 2018

arichardson accepted D24867: Request init/fini array on FreeBSD 12 and later.

I recently made this change for the CHERI clang fork and as far as I can tell everything works fine.

May 7 2018, 2:57 PM

Apr 20 2018

arichardson updated the diff for D45760: Emit a left-shift instead of a power-of-two multiply for jump-tables.

Perform the optimization in LegalizeDAG instead. Turns out this also fixes MSP430

Apr 20 2018, 3:12 AM
arichardson abandoned D43475: [llvm-objcopy] Implement --only-keep-debug.

This approach is wrong and I currently don't have time to work on a correct solution.

Apr 20 2018, 1:05 AM

Apr 18 2018

arichardson created D45760: Emit a left-shift instead of a power-of-two multiply for jump-tables.
Apr 18 2018, 3:24 AM

Apr 13 2018

arichardson added a comment to D31528: [ELF][MIPS] Multi-GOT implementation.

Thank you very much for updating this patch! I will be merging from upstream LLVM soon and having this rebased makes the merging so much easier.

Apr 13 2018, 2:24 AM · lld

Apr 12 2018

arichardson added a comment to D45574: Add PPC64_GLINK dynamic tag.

LGTM other than adding a gap between MIPS tags and PPC tags

Apr 12 2018, 1:40 PM

Apr 11 2018

arichardson added inline comments to D45166: [ELF] - Introduce helper for iterating over linker commands..
Apr 11 2018, 3:29 AM

Apr 10 2018

arichardson added a comment to D44093: [BUILTINS] structure pretty printer.

Ok, I found the problem. In fact the size of long is 4 bytes on your machine, but 8 bytes on mine.
This makes this // CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]], fail.
Do you know a smart way to do it without dealing with type sizes ?

Apr 10 2018, 2:49 PM
arichardson added a comment to D44093: [BUILTINS] structure pretty printer.

Ok, I found the problem. In fact the size of long is 4 bytes on your machine, but 8 bytes on mine.
This makes this // CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]], fail.
Do you know a smart way to do it without dealing with type sizes ?

Apr 10 2018, 2:49 PM
arichardson accepted D44093: [BUILTINS] structure pretty printer.

So, for the moment, we are only handling basic types. That said, for the enum in C, we will print according to the type of the enum.
In the future versions, I really want to be able to print the name of the enum so that the output is more relevent.
Anyway, the rule I followed for the moment is : if I don't recognize the type, I print it as an address.

Apr 10 2018, 10:48 AM
arichardson accepted D45490: [ADT] - Add llvm::make_mapped_range.

Seems like at -O2 clang 5.0.0 can optimize away all the optional checks (https://godbolt.org/g/rbGYrN)

Apr 10 2018, 9:36 AM
arichardson abandoned D43952: [ELF][MIPS] Don't change every dynamic relocation into R_MIPS_REL32.

This is wrong

Apr 10 2018, 9:03 AM
arichardson added inline comments to D45490: [ADT] - Add llvm::make_mapped_range.
Apr 10 2018, 8:46 AM
arichardson added a comment to D44093: [BUILTINS] structure pretty printer.

I'm also often restricted to using printf for debugging so this looks really useful!

Apr 10 2018, 8:25 AM

Apr 6 2018

arichardson added inline comments to D37054: Require address space to be specified when creating functions (2/3).
Apr 6 2018, 6:42 AM

Apr 2 2018

arichardson added inline comments to D45166: [ELF] - Introduce helper for iterating over linker commands..
Apr 2 2018, 9:42 AM

Mar 27 2018

arichardson committed rL328616: [MIPS] Add static_assert that all Fixups are handled in getFixupKind.
[MIPS] Add static_assert that all Fixups are handled in getFixupKind
Mar 27 2018, 3:11 AM
arichardson closed D44895: [MIPS] Add static_assert that all Fixups are handled in getFixupKind.
Mar 27 2018, 3:11 AM

Mar 26 2018

arichardson created D44895: [MIPS] Add static_assert that all Fixups are handled in getFixupKind.
Mar 26 2018, 6:06 AM

Mar 21 2018

arichardson added inline comments to D44761: Fix PR36793.
Mar 21 2018, 4:26 PM
arichardson committed rL328099: Change DT_* value definitions to macros in a separate file.
Change DT_* value definitions to macros in a separate file
Mar 21 2018, 7:20 AM
arichardson closed D44558: Change DT_* value definitions to macros in a separate file.
Mar 21 2018, 7:20 AM

Mar 20 2018

arichardson added inline comments to D44558: Change DT_* value definitions to macros in a separate file.
Mar 20 2018, 3:00 AM
arichardson updated the diff for D44558: Change DT_* value definitions to macros in a separate file.

Address review comments

Mar 20 2018, 2:59 AM

Mar 17 2018

arichardson created D44604: Make stdarg.h compatible with FreeBSD.
Mar 17 2018, 4:57 PM
arichardson added inline comments to D44601: LLD: Avoid segfault with --emit-relocs.
Mar 17 2018, 3:41 PM · lld

Mar 16 2018

arichardson updated the diff for D44558: Change DT_* value definitions to macros in a separate file.

Use correct version of diff

Mar 16 2018, 6:50 AM
arichardson created D44558: Change DT_* value definitions to macros in a separate file.
Mar 16 2018, 5:49 AM

Mar 14 2018

arichardson committed rL327564: [UpdateTestChecks] Handle IR variables with a '-' in the name.
[UpdateTestChecks] Handle IR variables with a '-' in the name
Mar 14 2018, 1:34 PM
arichardson closed D44459: [UpdateTestChecks] Handle IR variables with a '-' in the name.
Mar 14 2018, 1:34 PM
arichardson added a comment to D44459: [UpdateTestChecks] Handle IR variables with a '-' in the name.

It is named update_cc_test_checks.py. But do you think update_cc1_test_checks.py is a better name?

I've fixed the typo in my commit message. I think either name is fine (or even update_clang_test_checks.py).

Mar 14 2018, 1:29 PM
arichardson added a comment to D28896: [FileCheck] Add directive for checking for blank lines.

I just ran into this problem writing a test case and for now I used the workaround by @probinson but having a CHECK-EMPTY directive would make it much cleaner.

Mar 14 2018, 7:52 AM
arichardson added inline comments to D44453: Update Error Message.
Mar 14 2018, 2:43 AM
arichardson created D44459: [UpdateTestChecks] Handle IR variables with a '-' in the name.
Mar 14 2018, 2:35 AM
arichardson accepted D44400: Fix LLVM IR check lines in utils/update_cc_test_checks.py.

Just tested it and it works perfectly for me.

Mar 14 2018, 2:21 AM

Mar 13 2018

arichardson accepted D44438: [ELF] - Convert overlapping-sections.s testcase to x86 and cleanup..

The reason that this is a MIPS test case is that I work on CHERI (which extends MIPS) and therefore most of the testcases I write are derived from MIPS input.

Mar 13 2018, 2:59 PM

Mar 2 2018

arichardson added a comment to D42712: [utils] Add utils/update_cc_test_checks.py.

No need to revert, I think it is fine to improve the script in follow-up revisions. Thanks again for working on this!

Mar 2 2018, 1:01 PM
arichardson added a comment to D42712: [utils] Add utils/update_cc_test_checks.py.

LGTM, I guess the CHECK-LABEL thing can be fixed later.

Mar 2 2018, 9:40 AM
arichardson added a comment to D37054: Require address space to be specified when creating functions (2/3).

LGTM but I guess someone else should approve

Mar 2 2018, 9:35 AM
arichardson planned changes to D43952: [ELF][MIPS] Don't change every dynamic relocation into R_MIPS_REL32.

Turns out we can't emit R_MIPS_64 absolute relocations that don't need the GOT since neither glibc nor FreeBSD handle a R_MIPS_64 dynamic relocations.

Mar 2 2018, 6:55 AM
arichardson requested changes to D42712: [utils] Add utils/update_cc_test_checks.py.

If I have the following:

// RUN: %clang_cc1 -emit-llvm -o - %s -O2 | FileCheck %s
Mar 2 2018, 2:52 AM

Mar 1 2018

arichardson added inline comments to D43952: [ELF][MIPS] Don't change every dynamic relocation into R_MIPS_REL32.
Mar 1 2018, 10:21 AM
arichardson added inline comments to D43952: [ELF][MIPS] Don't change every dynamic relocation into R_MIPS_REL32.
Mar 1 2018, 10:12 AM
arichardson added a comment to D43920: Set DF_TEXTREL instead of creating an empty DT_TEXTREL..

The FreeBSD rtld supports both so this LGTM. Emitting both is probably more compatible but I'm not sure it's required. What does ld.bfd do?

Mar 1 2018, 9:58 AM
arichardson updated the diff for D43952: [ELF][MIPS] Don't change every dynamic relocation into R_MIPS_REL32.

Added the correct version of the test

Mar 1 2018, 9:41 AM
arichardson created D43952: [ELF][MIPS] Don't change every dynamic relocation into R_MIPS_REL32.
Mar 1 2018, 9:37 AM

Feb 28 2018

arichardson added a comment to D42712: [utils] Add utils/update_cc_test_checks.py.

Thanks for working on this!

Feb 28 2018, 11:31 AM

Feb 27 2018

arichardson committed rL326257: [ELF] Add llvm-readelf to the lit tool substitutions.
[ELF] Add llvm-readelf to the lit tool substitutions
Feb 27 2018, 2:05 PM
arichardson committed rLLD326257: [ELF] Add llvm-readelf to the lit tool substitutions.
[ELF] Add llvm-readelf to the lit tool substitutions
Feb 27 2018, 2:05 PM
arichardson closed D43827: [ELF] Add llvm-readelf to the lit tool substitutions.
Feb 27 2018, 2:05 PM
arichardson created D43827: [ELF] Add llvm-readelf to the lit tool substitutions.
Feb 27 2018, 9:39 AM
arichardson added inline comments to D37054: Require address space to be specified when creating functions (2/3).
Feb 27 2018, 5:40 AM
arichardson committed rL326188: Make the LLParser accept call instructions of variables in the program AS.
Make the LLParser accept call instructions of variables in the program AS
Feb 27 2018, 3:19 AM
arichardson closed D43645: Make the LLParser accept call instructions of variables in the program AS.
Feb 27 2018, 3:19 AM
arichardson committed rL326187: Don't output bitcode to stdout in 2002-07-31-SlashInString.ll test.
Don't output bitcode to stdout in 2002-07-31-SlashInString.ll test
Feb 27 2018, 3:19 AM

Feb 26 2018

arichardson added a comment to D37054: Require address space to be specified when creating functions (2/3).

Thanks for working on this, it will make life a lot easier for us when it lands.

Feb 26 2018, 4:49 AM

Feb 23 2018

arichardson committed rCXX325914: Allow passing additional compiler/linker flags for the tests.
Allow passing additional compiler/linker flags for the tests
Feb 23 2018, 7:25 AM