Page MenuHomePhabricator

MaskRay (Fangrui Song)
User

Projects

User Details

User Since
Dec 30 2016, 3:24 PM (160 w, 3 d)

Recent Activity

Today

MaskRay accepted D72829: Implement -fsemantic-interposition.

I suppose you mean whether "SemanticInterposition" should be invalidated when "PIC Level" does not exist or "PIE Level" exists. I am a bit inclined to make it more flexible/orthogonal in the backend, i.e. SemanticInterposition is in affect even if "PIE Level" is set.

OK, looks good as is, then?

Tue, Jan 28, 12:35 PM · Restricted Project, Restricted Project
MaskRay added a comment to D73228: [AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects.

To make sure I understand, this is adding a local alias as at assembly time that can be used as a fixup target. This is necessary as at assembly time all we have is a global default visibility symbol which we have to assume can be interposed, even if the code-generator has already assumed it. Are there other uses that I'm missing?

Tue, Jan 28, 12:11 PM · Restricted Project
MaskRay updated subscribers of D73228: [AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects.
Tue, Jan 28, 11:46 AM · Restricted Project
MaskRay added inline comments to D73228: [AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects.
Tue, Jan 28, 11:46 AM · Restricted Project
MaskRay added a comment to D73474: [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols.

@hans can we please cherry pick this into the llvm-10 release, if it's not too late?

It landed as 4f38ab250ff4680375c4c01db0a88c157093c665. 3238b03c197741207dea8cc3bc3273f74b448460 landed before it, but doesn't cherry-pick cleanly, where as I believe that 4f38ab250ff4680375c4c01db0a88c157093c665 does. 3238b03c197741207dea8cc3bc3273f74b448460 is NFC and not required.

Tue, Jan 28, 11:34 AM · Restricted Project
MaskRay committed rG684c216d73cd: [ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24 (authored by MaskRay).
[ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24
Tue, Jan 28, 11:10 AM
MaskRay committed rGe11b709b1922: [ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24 (authored by MaskRay).
[ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24
Tue, Jan 28, 11:10 AM
MaskRay closed D73532: [ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24.
Tue, Jan 28, 11:10 AM · Restricted Project
MaskRay updated the diff for D73228: [AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects.

Improve comment for AsmPrinter::getSymbolPreferLocal()

Tue, Jan 28, 10:58 AM · Restricted Project
MaskRay retitled D73532: [ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24 from [ELF][PPC32] Support relocatable link of R_PPC_PLTREL24 to [ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24.
Tue, Jan 28, 10:49 AM · Restricted Project
MaskRay added inline comments to D72829: Implement -fsemantic-interposition.
Tue, Jan 28, 10:39 AM · Restricted Project, Restricted Project
MaskRay added a comment to D72829: Implement -fsemantic-interposition.

@MaskRay should we add a verifier step to check that pie/pic/semanticinterposition module flags are consistent, or leave that to clang ?

Tue, Jan 28, 10:30 AM · Restricted Project, Restricted Project
MaskRay updated the diff for D73532: [ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24.

Improve tests

Tue, Jan 28, 10:02 AM · Restricted Project
MaskRay created D73532: [ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24.
Tue, Jan 28, 1:10 AM · Restricted Project

Yesterday

MaskRay updated the summary of D73518: [ELF] Mention symbol name in reportRangeError().
Mon, Jan 27, 6:27 PM · Restricted Project
MaskRay updated the summary of D73518: [ELF] Mention symbol name in reportRangeError().
Mon, Jan 27, 6:27 PM · Restricted Project
MaskRay updated the diff for D73518: [ELF] Mention symbol name in reportRangeError().

.

Mon, Jan 27, 6:23 PM · Restricted Project
MaskRay created D73518: [ELF] Mention symbol name in reportRangeError().
Mon, Jan 27, 6:21 PM · Restricted Project
MaskRay committed rG87c7863c3ec4: Reland "[StackColoring] Remap PseudoSourceValue frame indices via… (authored by MaskRay).
Reland "[StackColoring] Remap PseudoSourceValue frame indices via…
Mon, Jan 27, 4:43 PM
MaskRay committed rGc7c5da6df301: Reland "[StackColoring] Remap PseudoSourceValue frame indices via… (authored by MaskRay).
Reland "[StackColoring] Remap PseudoSourceValue frame indices via…
Mon, Jan 27, 4:37 PM
MaskRay closed D73510: Reland "[StackColoring] Remap PseudoSourceValue frame indices via MachineFunction::getPSVManager()"".
Mon, Jan 27, 4:37 PM · Restricted Project
MaskRay updated the diff for D73510: Reland "[StackColoring] Remap PseudoSourceValue frame indices via MachineFunction::getPSVManager()"".

Replace operator[] with

Mon, Jan 27, 3:56 PM · Restricted Project
MaskRay updated subscribers of D73510: Reland "[StackColoring] Remap PseudoSourceValue frame indices via MachineFunction::getPSVManager()"".
Mon, Jan 27, 3:38 PM · Restricted Project
MaskRay added a comment to D73510: Reland "[StackColoring] Remap PseudoSourceValue frame indices via MachineFunction::getPSVManager()"".

test/CodeGen/X86/catchpad-lifetime.ll (added in rL257158 @majnemer) appears to be bit-rotted. If I delete:

Mon, Jan 27, 3:38 PM · Restricted Project
MaskRay created D73510: Reland "[StackColoring] Remap PseudoSourceValue frame indices via MachineFunction::getPSVManager()"".
Mon, Jan 27, 3:20 PM · Restricted Project
MaskRay added a comment to D69876: Allow output constraints on "asm goto".

Does this depend on D69868?

Mon, Jan 27, 2:52 PM · Restricted Project, Restricted Project
MaskRay added inline comments to D73319: Add extension 'gnu_asm_goto_with_outputs'.
Mon, Jan 27, 2:52 PM · Restricted Project
MaskRay accepted D73505: [IR] Keep a double break between function decls and defs.

Thanks. b0e979724f2679e4e6f5b824144ea89289bd6d56 intended to make newpm and oldpm -print-after-all output similar. I did not realize llvm-dis output is also affected.

Mon, Jan 27, 2:18 PM · Restricted Project
MaskRay added inline comments to D73484: [llvm-readobj] - Improve error message reported by DynRegionInfo..
Mon, Jan 27, 12:15 PM · Restricted Project
MaskRay added a comment to D73228: [AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects.

Ping D73228 and D73230 (tested on a large code base).

Mon, Jan 27, 12:06 PM · Restricted Project
MaskRay added a comment to D72992: [llvm-objdump] - Add column headers for relocation printing.
and allows for better
Mon, Jan 27, 11:25 AM · Restricted Project
MaskRay added a comment to D73438: [Symbolize] Handle error after the notes loop.

Closed by commit 369ea47b9249f1843730d8d0c0ca5df46826d032

Mon, Jan 27, 11:25 AM · Restricted Project
MaskRay added inline comments to D73472: [libc] Add utils for memory functions.
Mon, Jan 27, 11:07 AM · Restricted Project
MaskRay added inline comments to D73474: [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols.
Mon, Jan 27, 10:40 AM · Restricted Project
MaskRay added inline comments to D73474: [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols.
Mon, Jan 27, 10:39 AM · Restricted Project
MaskRay accepted D73474: [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols.
Mon, Jan 27, 10:39 AM · Restricted Project
MaskRay added inline comments to D73474: [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols.
Mon, Jan 27, 10:09 AM · Restricted Project
MaskRay added a comment to D73452: [libc] Fix benchmarks CMakeLists.txt.
is too recent for current CMake version
Mon, Jan 27, 10:09 AM · Restricted Project
MaskRay accepted D73175: [llvm-readobj][test] - Remove --symbols --dyn-syms part from Object/readobj-shared-object.test..
Mon, Jan 27, 10:00 AM · Restricted Project
MaskRay added inline comments to D73175: [llvm-readobj][test] - Remove --symbols --dyn-syms part from Object/readobj-shared-object.test..
Mon, Jan 27, 10:00 AM · Restricted Project
MaskRay accepted D73281: [LLD] Avoid exiting with a locked mutex NFC.
Mon, Jan 27, 10:00 AM · Restricted Project
MaskRay added inline comments to D72829: Implement -fsemantic-interposition.
Mon, Jan 27, 9:51 AM · Restricted Project, Restricted Project
MaskRay committed rG941f20c3bd22: [MachineVerifier] Simplify and delete LLVM_VERIFY_MACHINEINSTRS from a comment. (authored by MaskRay).
[MachineVerifier] Simplify and delete LLVM_VERIFY_MACHINEINSTRS from a comment.
Mon, Jan 27, 12:33 AM

Sun, Jan 26

MaskRay added a comment to D69868: Allow "callbr" to return non-void values.

It seems that callbr (with output) will now be similar to a catchpad. It can set live-in physical register information. (See test/CodeGen/X86/{seh-catch-all.ll,seh-exception-code.ll,wineh-coreclr.ll,wineh-exceptionpointer.ll}) Is there any caveat doing this? Add @rnk to the attention list as the author of rL249492 and rL249786...

Sun, Jan 26, 10:12 PM · Restricted Project, Restricted Project
MaskRay accepted D73438: [Symbolize] Handle error after the notes loop.
Sun, Jan 26, 5:35 PM · Restricted Project

Sat, Jan 25

MaskRay added a comment to D73425: [PPC] Fix platform definitions when compiling FreeBSD powerpc64 as LE.

At a minimum, test/Driver/freebsd.c and test/Preprocessor/init-ppc64.c should be updated for powerpcle-unknown-freebsd tests.

Sat, Jan 25, 11:10 PM · Restricted Project, Restricted Project
MaskRay committed rGf15b60b3a2a2: [ELF][PPC32] Support range extension thunks with addends (authored by MaskRay).
[ELF][PPC32] Support range extension thunks with addends
Sat, Jan 25, 10:35 PM
MaskRay committed rG70389be7a029: [ELF][PPC32] Support range extension thunks with addends (authored by MaskRay).
[ELF][PPC32] Support range extension thunks with addends
Sat, Jan 25, 10:35 PM
MaskRay closed D73424: [ELF][PPC32] Support range extension thunk with addends.
Sat, Jan 25, 10:34 PM · Restricted Project
MaskRay updated the diff for D73424: [ELF][PPC32] Support range extension thunk with addends.

Simplify via getPCBias()

Sat, Jan 25, 10:04 PM · Restricted Project
MaskRay updated the diff for D73424: [ELF][PPC32] Support range extension thunk with addends.

Simplify

Sat, Jan 25, 9:37 PM · Restricted Project
MaskRay updated the diff for D73424: [ELF][PPC32] Support range extension thunk with addends.

Simplify

Sat, Jan 25, 9:31 PM · Restricted Project
MaskRay updated the diff for D73424: [ELF][PPC32] Support range extension thunk with addends.

Handle R_PPC_LOCAL24PC as well

Sat, Jan 25, 9:09 PM · Restricted Project
MaskRay created D73424: [ELF][PPC32] Support range extension thunk with addends.
Sat, Jan 25, 8:55 PM · Restricted Project
MaskRay committed rG6f8ad14521ec: [ELF][PPC32] Support canonical PLT (authored by MaskRay).
[ELF][PPC32] Support canonical PLT
Sat, Jan 25, 5:58 PM
MaskRay committed rG837e8a9c0cd0: [ELF][PPC32] Support canonical PLT (authored by MaskRay).
[ELF][PPC32] Support canonical PLT
Sat, Jan 25, 5:58 PM
MaskRay closed D73399: [ELF][PPC32] Support canonical PLT.
Sat, Jan 25, 5:58 PM · Restricted Project
MaskRay created D73422: [IR] Delete MODULE_CODE_DEPLIB.
Sat, Jan 25, 4:53 PM · Restricted Project
MaskRay updated the summary of D73399: [ELF][PPC32] Support canonical PLT.
Sat, Jan 25, 4:08 PM · Restricted Project
MaskRay updated the summary of D73399: [ELF][PPC32] Support canonical PLT.
Sat, Jan 25, 3:59 PM · Restricted Project
MaskRay updated the summary of D73399: [ELF][PPC32] Support canonical PLT.
Sat, Jan 25, 3:59 PM · Restricted Project
MaskRay updated the summary of D73399: [ELF][PPC32] Support canonical PLT.
Sat, Jan 25, 3:33 PM · Restricted Project
MaskRay updated the diff for D73399: [ELF][PPC32] Support canonical PLT.

Fix PLTresolve comments

Sat, Jan 25, 3:32 PM · Restricted Project
MaskRay updated the diff for D73399: [ELF][PPC32] Support canonical PLT.

Make glibc work

Sat, Jan 25, 3:14 PM · Restricted Project
MaskRay added inline comments to D73269: [llvm-readobj] - Add a few warnings for --gnu-hash-table..
Sat, Jan 25, 2:20 PM · Restricted Project
MaskRay updated the diff for D73399: [ELF][PPC32] Support canonical PLT.

Move canonical PLT entries to the beginning of .glink
Otherwise Symbol::getVA is not stable

Sat, Jan 25, 2:03 PM · Restricted Project
MaskRay updated the diff for D73399: [ELF][PPC32] Support canonical PLT.

Fix st_value

Sat, Jan 25, 12:41 PM · Restricted Project
MaskRay updated the summary of D73399: [ELF][PPC32] Support canonical PLT.
Sat, Jan 25, 12:23 PM · Restricted Project
MaskRay updated the summary of D73399: [ELF][PPC32] Support canonical PLT.
Sat, Jan 25, 12:20 PM · Restricted Project
MaskRay committed rGdeb5819d6249: [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it (authored by MaskRay).
[ELF] Rename relocateOne() to relocate() and pass `Relocation` to it
Sat, Jan 25, 12:02 PM
MaskRay closed D73254: [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it.
Sat, Jan 25, 12:02 PM · Restricted Project
MaskRay updated the diff for D73254: [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it.

Adopt grimar's suggestion

Sat, Jan 25, 12:02 PM · Restricted Project
MaskRay updated the diff for D73399: [ELF][PPC32] Support canonical PLT.

.

Sat, Jan 25, 11:53 AM · Restricted Project
MaskRay added inline comments to D73254: [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it.
Sat, Jan 25, 9:54 AM · Restricted Project
MaskRay added inline comments to D73269: [llvm-readobj] - Add a few warnings for --gnu-hash-table..
Sat, Jan 25, 9:49 AM · Restricted Project

Fri, Jan 24

MaskRay created D73399: [ELF][PPC32] Support canonical PLT.
Fri, Jan 24, 6:15 PM · Restricted Project
MaskRay accepted D73392: [Support] Split MallocAllocator out of Allocator.h.
Fri, Jan 24, 5:12 PM · Restricted Project
MaskRay added a comment to D73307: Unique Names for Functions with Internal Linkage.

The code change seems fine, but the test requires some changes. I haven't followed Propeller development, but hope someone with profile experience can confirm InternalLinkage is the only linkage we need to care about (otherwise the option will be a misnomer if we ever extend it) and check whether this feature is useful on its own. Does it improve profile precision?

I can comment on the usefulness aspect: we had an earlier prototype of this, which we tried on a real-world application benchmark. The binary had ~10% of local statics exhibiting duplicate names. Ensuring unique names led to observable differences in the AFDO file (i.e. some of those functions had profiles that, before, were lost for one of the duplicates, and now were correctly attributed to the different functions), and a measurable performance improvement.

Fri, Jan 24, 4:54 PM
MaskRay added a comment to D73307: Unique Names for Functions with Internal Linkage.

The code change seems fine, but the test requires some changes. I haven't followed Propeller development, but hope someone with profile experience can confirm InternalLinkage is the only linkage we need to care about (otherwise the option will be a misnomer if we ever extend it) and check whether this feature is useful on its own. Does it improve profile precision?

Fri, Jan 24, 3:50 PM
MaskRay added a reviewer for D73307: Unique Names for Functions with Internal Linkage: wmi.
Fri, Jan 24, 3:41 PM
MaskRay added inline comments to D73307: Unique Names for Functions with Internal Linkage.
Fri, Jan 24, 2:55 PM
MaskRay added inline comments to D72357: Fix llvm-objcopy when directory contains "bar"..
Fri, Jan 24, 2:45 PM · Restricted Project
MaskRay added inline comments to D72357: Fix llvm-objcopy when directory contains "bar"..
Fri, Jan 24, 2:36 PM · Restricted Project
MaskRay updated subscribers of D72357: Fix llvm-objcopy when directory contains "bar"..
Fri, Jan 24, 2:09 PM · Restricted Project
MaskRay added a comment to D72831: [llvm-mc] - Produce R_X86_64_PLT32 relocation for branches with JCC opcodes too..

CC @hans ... there was discussion in https://bugs.llvm.org/show_bug.cgi?id=44397 about whether this is worth picking to 10.0.

Fri, Jan 24, 11:38 AM · Restricted Project
MaskRay committed rG4d5a200f31d5: [PatchableFunction] Allow empty entry MachineBasicBlock (authored by MaskRay).
[PatchableFunction] Allow empty entry MachineBasicBlock
Fri, Jan 24, 10:43 AM
MaskRay committed rG5d1fe1a1a9f1: [Driver][CodeGen] Support -fpatchable-function-entry=N,M and __attribute__… (authored by MaskRay).
[Driver][CodeGen] Support -fpatchable-function-entry=N,M and __attribute__…
Fri, Jan 24, 10:43 AM
MaskRay committed rG6f4edc606b20: [X86][test] Add tests for -fpatchable-function-entry=N,M (where M>0) and its… (authored by MaskRay).
[X86][test] Add tests for -fpatchable-function-entry=N,M (where M>0) and its…
Fri, Jan 24, 10:43 AM
MaskRay committed rGbf04730dee1b: Add function attribute "patchable-function-prefix" to support -fpatchable… (authored by MaskRay).
Add function attribute "patchable-function-prefix" to support -fpatchable…
Fri, Jan 24, 10:43 AM
MaskRay committed rG0e2eea29cc4f: [AsmPrinter] Don't emit __patchable_function_entries entry if "patchable… (authored by MaskRay).
[AsmPrinter] Don't emit __patchable_function_entries entry if "patchable…
Fri, Jan 24, 10:42 AM
MaskRay committed rG6c1e479db225: [CodeGen] Move fentry-insert, xray-instrumentation and patchable-function… (authored by MaskRay).
[CodeGen] Move fentry-insert, xray-instrumentation and patchable-function…
Fri, Jan 24, 10:42 AM
MaskRay committed rG50627622856e: [XRay] Set hasSideEffects flag of PATCHABLE_FUNCTION_{ENTER,EXIT} (authored by MaskRay).
[XRay] Set hasSideEffects flag of PATCHABLE_FUNCTION_{ENTER,EXIT}
Fri, Jan 24, 10:41 AM
MaskRay accepted D73333: [llvm-ar][test] Add to llvm-ar test coverage .
Fri, Jan 24, 10:34 AM · Restricted Project
MaskRay added a comment to D72222: [Driver][CodeGen] Add -fpatchable-function-entry=N[,0].

For BTI c issue, GCC has several releases that do not work with -mbranch-protection=bti. The Linux kernel has to develop some mechanism to detect the undesirable placement of bti c, if there are -mbranch-protection=bti users. So I don't think that inconsistency in clang 10.0.0 with GCC will be a problem.

Speaking as the person implementing the Linux side of things, I think that will be a problem. Kernel-side we want consistency across compilers.

For Linux we were planning to do a very simple build-time test to rule out compilers with the broken behaviour. We would expect functional compilers to have a consistent layout for a given combination of options, and we would consider this layout to be ABI.

The compile time check would compile a trivial test file, e.g.

void function(void) { }

... with flags:

-fpatchable-function-entry=2 -mbranch-protection=bti

... and if the function entry point is a NOP, mark that compiler as broken. In practice, this will mean that the kernel build system will disable BTI support for those broken compilers.

Trying to support different layout approaches within Linux will add a fair amount of unnecessary complexity which we cannot contain in one place, and makes it more likely that support for either case will be broken in future.

For the M=0 case, I would prefer to avoid runtime detection unless really necessary.

For the M!=0 case, which I believe Linux will need to use in the near future, I realise that a runtime check will be necessary to detect the absence of a BTI. Regardless, consistent behaviour across compilers will make this significantly simpler and less error-prone.

Thanks,
Mark.

Fri, Jan 24, 10:22 AM · Restricted Project
MaskRay updated subscribers of D73301: [PatchableFunction] Allow empty entry MachineBasicBlock.

@hans OK to cherry pick this commit? We would also need d232c215669cb57f5eb4ead40a4a336220dbc429 ([AsmPrinter] Don't emit __patchable_function_entries entry if "patchable-function-entry"="0"; a GCC compatibility issue I did not notice when I implemented -fpatchable-function-entry=N,0).

Fri, Jan 24, 9:55 AM · Restricted Project
MaskRay added a comment to D73301: [PatchableFunction] Allow empty entry MachineBasicBlock.

Thanks, with this patch applied, I was able to build an allyesconfig aarch64 linux-next kernel, and the llvm test suite passes. LGTM

Fri, Jan 24, 9:55 AM · Restricted Project
MaskRay committed rG50a3ff30e158: [PatchableFunction] Allow empty entry MachineBasicBlock (authored by MaskRay).
[PatchableFunction] Allow empty entry MachineBasicBlock
Fri, Jan 24, 9:46 AM
MaskRay closed D73301: [PatchableFunction] Allow empty entry MachineBasicBlock.
Fri, Jan 24, 9:46 AM · Restricted Project
MaskRay updated the diff for D73301: [PatchableFunction] Allow empty entry MachineBasicBlock.

Simplify test

Fri, Jan 24, 9:46 AM · Restricted Project
MaskRay added inline comments to D73269: [llvm-readobj] - Add a few warnings for --gnu-hash-table..
Fri, Jan 24, 9:37 AM · Restricted Project