Page MenuHomePhabricator

tmsriram (Sriraman Tallam)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 6 2016, 10:26 AM (171 w, 1 d)

Recent Activity

Feb 6 2019

tmsriram accepted D57799: Support R_X86_64_PC8 and R_X86_64_PC16..
Feb 6 2019, 5:58 AM · Restricted Project

Sep 20 2018

tmsriram added inline comments to D52322: Pass code-model through Module IR to LTO which will use is.
Sep 20 2018, 4:17 PM

May 31 2018

tmsriram committed rL333676: Relax GOTPCREL relocations for tail jmp instructions..
Relax GOTPCREL relocations for tail jmp instructions.
May 31 2018, 11:16 AM
tmsriram closed D47563: Relax GOTPCREL relocations for tail jmp instructions.
May 31 2018, 11:16 AM
tmsriram added a reviewer for D47563: Relax GOTPCREL relocations for tail jmp instructions: efriedma.
May 31 2018, 9:53 AM

May 30 2018

tmsriram created D47563: Relax GOTPCREL relocations for tail jmp instructions.
May 30 2018, 4:03 PM

May 8 2018

tmsriram committed rLLD331828: Fix test by adding -triple=x86_64-unknown-linux.
Fix test by adding -triple=x86_64-unknown-linux
May 8 2018, 5:24 PM
tmsriram committed rL331828: Fix test by adding -triple=x86_64-unknown-linux.
Fix test by adding -triple=x86_64-unknown-linux
May 8 2018, 5:24 PM
tmsriram committed rLLD331823: New option -z keep-text-section-prefix to keep text sections with prefixes….
New option -z keep-text-section-prefix to keep text sections with prefixes…
May 8 2018, 4:23 PM
tmsriram committed rL331823: New option -z keep-text-section-prefix to keep text sections with prefixes….
New option -z keep-text-section-prefix to keep text sections with prefixes…
May 8 2018, 4:23 PM
tmsriram closed D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.
May 8 2018, 4:23 PM

May 4 2018

tmsriram updated the diff for D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.

Updated test.

May 4 2018, 1:48 PM
tmsriram updated the diff for D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.

Updated with more comments and nits fixed.

May 4 2018, 11:31 AM
tmsriram updated the diff for D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.

Add check for nokeep-text-section-prefix

May 4 2018, 11:23 AM
tmsriram updated the diff for D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.

Add back the test that was omitted in the last update.

May 4 2018, 9:59 AM

May 3 2018

tmsriram updated the diff for D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.

New option -z keep-text-section-prefix.

May 3 2018, 2:55 PM

Apr 20 2018

tmsriram added inline comments to D45902: Add "-z lazy" and "-z relro"..
Apr 20 2018, 1:58 PM
tmsriram added a comment to D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.
In D45841#1072734, @pcc wrote:
In D45841#1072712, @pcc wrote:

Note that this ordering isn't necessarily best for every architecture. On ARM for example it is best to put the hot sections in the middle (see also D44969).

When you say "this ordering" I am confused because currently there is no ordering of the output sections with prefix ".text". Looking at it, seems like the order in which they were seen is the order in the final binary.

Yes, I meant the ordering imposed by this patch which would be hot followed by unlikely, startup, etc.

Apr 20 2018, 10:38 AM

Apr 19 2018

tmsriram added a comment to D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.
In D45841#1072712, @pcc wrote:

Note that this ordering isn't necessarily best for every architecture. On ARM for example it is best to put the hot sections in the middle (see also D44969).

Apr 19 2018, 3:53 PM
tmsriram created D45841: Keep the output text sections with prefixes ".text.hot" , ".text.unlikely", ".text.startup", ".text.exit" separate.
Apr 19 2018, 3:17 PM

Apr 10 2018

tmsriram committed rL329768: Simplification of libcall like printf->puts must check for RtLibUseGOT metadata..
Simplification of libcall like printf->puts must check for RtLibUseGOT metadata.
Apr 10 2018, 4:38 PM
tmsriram closed D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.
Apr 10 2018, 4:38 PM
tmsriram committed rL329765: GOTPCREL references must always use RIP..
GOTPCREL references must always use RIP.
Apr 10 2018, 3:53 PM
tmsriram closed D45460: With -fno-plt, GOTPCREL references must use RIP .
Apr 10 2018, 3:53 PM
tmsriram updated the diff for D45460: With -fno-plt, GOTPCREL references must use RIP .

Simplify test and condition.

Apr 10 2018, 2:57 PM

Apr 9 2018

tmsriram added a comment to D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.

Ping.

Apr 9 2018, 4:35 PM
tmsriram created D45460: With -fno-plt, GOTPCREL references must use RIP .
Apr 9 2018, 3:04 PM

Apr 5 2018

tmsriram updated the diff for D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.

Simplify patch to get Module from F.getParent()

Apr 5 2018, 9:48 AM

Apr 4 2018

tmsriram added a comment to D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.

Ping.

Apr 4 2018, 3:17 PM

Apr 3 2018

tmsriram added a comment to D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.

Thinking a bit more about this:

From the user perspective, the files compiled with -fno-plt should not be responsible for producing a plt. Currently we cannot represent that in the IR. To do that something like RtLibUseGOT would have to be a function attribute on the *caller*. When llvm would decide to call a runtime function to implement llvm.foo, it would check the function using llvm.foo to find out if it should use a got or a plt.

A very similar issue exists for dso_local. If a file is compiled with -fPIC and another without, a function from one but not the other could make dso_local calls to the runtime.

Using these functions attributes would allow a direct mapping of what happens in the non lto case, but would be annoying to work with (what should the inliner do?).

And that is just for the cases where -fno-plt is used in the command line. With a no-plt attribute it could just disappear . Assume we have a no-plt attribute in C and someone adds it to memcpy in a translation unit. An llvm optimization can remove a memcpy that ends up being recreated during codgen and the attribute is lost. There is no good way of avoiding this.

Apr 3 2018, 11:08 AM

Apr 2 2018

tmsriram added a comment to D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.

I am not sure I understand. Shouldn't this just copy nonlazybind from printf to puts?

I didn't see that happen anywhere, inferLibFuncAttribues is where the attributes are added to the simplified function.

So maybe this is the wrong place to make the change?

Given that we have nonlazybind on each GV, if we are replacing the printf GV with the puts GV we should copy nonlazybind from one to the other.

Apr 2 2018, 5:54 PM
tmsriram added a comment to D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.

I am not sure I understand. Shouldn't this just copy nonlazybind from printf to puts?

Apr 2 2018, 5:39 PM
tmsriram added inline comments to D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.
Apr 2 2018, 5:34 PM
tmsriram added inline comments to D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.
Apr 2 2018, 4:55 PM
tmsriram created D45180: libcalls must check for "RtLibUseGOT" metadata during simplification.
Apr 2 2018, 12:35 PM

Feb 23 2018

tmsriram committed rL325962: Intrinsics calls should avoid the PLT when "RtLibUseGOT" metadata is present..
Intrinsics calls should avoid the PLT when "RtLibUseGOT" metadata is present.
Feb 23 2018, 1:34 PM
tmsriram closed D42216: Use New Module Metadata String "AvoidPLT" to avoid calls via PLT.
Feb 23 2018, 1:34 PM
tmsriram committed rL325961: Set Module Metadata "RtLibUseGOT" when fno-plt is used..
Set Module Metadata "RtLibUseGOT" when fno-plt is used.
Feb 23 2018, 1:30 PM
tmsriram committed rC325961: Set Module Metadata "RtLibUseGOT" when fno-plt is used..
Set Module Metadata "RtLibUseGOT" when fno-plt is used.
Feb 23 2018, 1:30 PM
tmsriram closed D42217: Set Module Metadata "AvoidPLT" when -fno-plt is used..
Feb 23 2018, 1:30 PM
tmsriram added a comment to D42217: Set Module Metadata "AvoidPLT" when -fno-plt is used..

Ping.

Feb 23 2018, 11:12 AM

Feb 21 2018

tmsriram added a comment to D42217: Set Module Metadata "AvoidPLT" when -fno-plt is used..

Ping. This patch goes with https://reviews.llvm.org/D42216, Rafael can you approve this too if you think it is ok? Thanks.

Feb 21 2018, 9:45 AM

Feb 20 2018

tmsriram updated the diff for D42217: Set Module Metadata "AvoidPLT" when -fno-plt is used..

Updated patch.

Feb 20 2018, 1:59 PM
tmsriram updated the diff for D42216: Use New Module Metadata String "AvoidPLT" to avoid calls via PLT.

Patch updated.

Feb 20 2018, 11:29 AM

Jan 29 2018

tmsriram updated the diff for D42216: Use New Module Metadata String "AvoidPLT" to avoid calls via PLT.

Updated patch.

Jan 29 2018, 2:26 PM
tmsriram updated the diff for D42216: Use New Module Metadata String "AvoidPLT" to avoid calls via PLT.

Updated to incorporate Rafael's changes.

Jan 29 2018, 12:35 PM

Jan 25 2018

tmsriram updated the diff for D42216: Use New Module Metadata String "AvoidPLT" to avoid calls via PLT.

Rafael's change included and test case updated. "Avoid PLT" changed to "RtLibUseGOT".

Jan 25 2018, 2:57 PM

Jan 18 2018

tmsriram updated the diff for D42217: Set Module Metadata "AvoidPLT" when -fno-plt is used..

METADATA tag changed to "RtLibUseGOT". Also see: https://reviews.llvm.org/D42224/

Jan 18 2018, 3:14 PM

Jan 17 2018

tmsriram created D42217: Set Module Metadata "AvoidPLT" when -fno-plt is used..
Jan 17 2018, 4:51 PM
tmsriram created D42216: Use New Module Metadata String "AvoidPLT" to avoid calls via PLT.
Jan 17 2018, 4:49 PM

Nov 7 2017

tmsriram committed rL317639: Attribute nonlazybind should not affect calls to functions with hidden….
Attribute nonlazybind should not affect calls to functions with hidden…
Nov 7 2017, 4:01 PM
tmsriram closed D39625: Attribute nonlazybind should not affect calls to functions with hidden visibility by committing rL317639: Attribute nonlazybind should not affect calls to functions with hidden….
Nov 7 2017, 4:01 PM
tmsriram committed rL317627: Change noplt.c to work for non-x86 targets..
Change noplt.c to work for non-x86 targets.
Nov 7 2017, 2:35 PM
tmsriram closed D39759: Remove x86 specific code from noplt.c by committing rL317627: Change noplt.c to work for non-x86 targets..
Nov 7 2017, 2:35 PM
tmsriram added a comment to D39759: Remove x86 specific code from noplt.c.

More information here. This breaks non-x86 builds like PPC because:

Nov 7 2017, 2:18 PM
tmsriram created D39759: Remove x86 specific code from noplt.c.
Nov 7 2017, 1:52 PM
tmsriram committed rL317605: New clang option -fno-plt which avoids the PLT and lazy binding while making….
New clang option -fno-plt which avoids the PLT and lazy binding while making…
Nov 7 2017, 11:38 AM
tmsriram closed D39079: New clang option -fno-plt to avoid PLT for external calls by committing rL317605: New clang option -fno-plt which avoids the PLT and lazy binding while making….
Nov 7 2017, 11:38 AM
tmsriram updated the diff for D39625: Attribute nonlazybind should not affect calls to functions with hidden visibility.

Fix comment as suggested.

Nov 7 2017, 10:26 AM

Nov 6 2017

tmsriram updated the diff for D39625: Attribute nonlazybind should not affect calls to functions with hidden visibility.

Change shouldAssumeDSOLocal to be aware of nonlazybind attribute.

Nov 6 2017, 12:07 PM

Nov 3 2017

tmsriram created D39625: Attribute nonlazybind should not affect calls to functions with hidden visibility.
Nov 3 2017, 4:38 PM

Nov 2 2017

tmsriram committed rL317292: Avoid PLT for external calls when attribute nonlazybind is used..
Avoid PLT for external calls when attribute nonlazybind is used.
Nov 2 2017, 5:11 PM
tmsriram closed D39065: Support nonlazybind attribute for X86 64-bit ELF (invoked via -fno-plt) by committing rL317292: Avoid PLT for external calls when attribute nonlazybind is used..
Nov 2 2017, 5:11 PM

Oct 31 2017

tmsriram added a comment to D39079: New clang option -fno-plt to avoid PLT for external calls.

Ping. How do we take this forward?

Oct 31 2017, 11:38 AM

Oct 24 2017

tmsriram added a comment to D39079: New clang option -fno-plt to avoid PLT for external calls.
In D39079#905468, @rnk wrote:

It also increases the pressure on the branch predictor, so it is not really black and white.

I don't understand this objection. I'm assuming that the PLT stub is an indirect jump through the PLTGOT,
not a hotpatched stub that jumps directly to the definition chosen by the loader. This is the ELF model
that I'm familiar with, especially since calls to code more than 2GB away generally need to be indirect anyway.

Correct, so all local calls to the same function go via the same location and share the predication of the indirect jump.

Oct 24 2017, 1:41 PM
tmsriram added a comment to D39079: New clang option -fno-plt to avoid PLT for external calls.
In D39079#905468, @rnk wrote:

It also increases the pressure on the branch predictor, so it is not really black and white.

I don't understand this objection. I'm assuming that the PLT stub is an indirect jump through the PLTGOT, not a hotpatched stub that jumps directly to the definition chosen by the loader. This is the ELF model that I'm familiar with, especially since calls to code more than 2GB away generally need to be indirect anyway.

Oct 24 2017, 11:12 AM
tmsriram added a comment to D39079: New clang option -fno-plt to avoid PLT for external calls.
In D39079#905396, @rnk wrote:

Why again is this a good idea?

It saves the direct jump to the PLT, reducing icache pressure, which is a major cost in some workloads.

It also increases the pressure on the branch predictor, so it is not really black and white.

Oct 24 2017, 10:59 AM
tmsriram added a comment to D39079: New clang option -fno-plt to avoid PLT for external calls.
In D39079#905423, @rnk wrote:

Let me phrase it differently. What is this patch (and the matching backend PR) supposed to achieve? There are effectively two ways to get rid of PLT entries:
(1) Bind references locally. This is effectively what -Bsymbolic does and what is breaking the ELF interposition rules.
(2) Do an indirect call via the GOT. Requires knowing what an external symbol is, making it non-attractive for anything but LTO, since it will create performance issues for all non-local accesses (i.e. anything private).

This patch does 2. According to @tmsriram, clever linkers can turn the indirect call back into a nop+call_pcrel32. If this isn't universal, the user must know what their linker supports. I don't see how it causes performance issues for non-local calls, since the PLT will do a jump through the GOT anyway.

Oct 24 2017, 10:56 AM
tmsriram added a comment to D39079: New clang option -fno-plt to avoid PLT for external calls.

Why again is this a good idea? This is an even worse hack than -Bsymbolic, the latter at least is visible in ELF header without code inspection. This is breaking core premises of ELF.

Oct 24 2017, 10:16 AM
tmsriram added a comment to D39079: New clang option -fno-plt to avoid PLT for external calls.

Noting that, as @vit9696 pointed out in D38554, this does not suppress uses of the PLT that occur from backend/optimizer-generated functions (e.g., calls into compiler-rt and similar).

Oct 24 2017, 10:13 AM

Oct 23 2017

tmsriram added inline comments to D39079: New clang option -fno-plt to avoid PLT for external calls.
Oct 23 2017, 3:38 PM
tmsriram updated the diff for D39079: New clang option -fno-plt to avoid PLT for external calls.

Added test test/CodeGen/noplt.c

Oct 23 2017, 3:38 PM
tmsriram added a comment to D39079: New clang option -fno-plt to avoid PLT for external calls.

Ping.

Oct 23 2017, 11:44 AM
tmsriram added a comment to D39065: Support nonlazybind attribute for X86 64-bit ELF (invoked via -fno-plt).

Ping.

Oct 23 2017, 11:44 AM

Oct 18 2017

tmsriram created D39079: New clang option -fno-plt to avoid PLT for external calls.
Oct 18 2017, 9:49 PM
tmsriram created D39065: Support nonlazybind attribute for X86 64-bit ELF (invoked via -fno-plt).
Oct 18 2017, 11:32 AM

Apr 24 2017

tmsriram added a comment to D30759: With PIE on x86_64, keep hot local arrays on the stack.

> In theory, the C/C++ standards require behavior equivalent to -fno-merge-all-constants. In practice, code doesn't actually depend on that, so we made the decision many years ago to turn on -fmerge-all-constants by default.

Understood. Does it seem reasonable/useful to fix this along the
lines of GCC, -fmerge-constants and -fmerge-all-constants where the
latter applies to const arrays and a warning that this is happening
when the latter option is used?

-fmerge-all-constants has exactly the same meaning in clang and gcc. And it's generally beneficial for both codesize and performance, so turning it off to pursue performance is a bad idea.

I would suggest finding some other approach to solve your issue later in the optimization pipeline, preferably in a manner which is sensitive to register pressure. Maybe put the code in ConstantHoisting? You don't lose any useful information by promoting the alloca to a global constant; you can easily recreate it

Apr 24 2017, 3:00 PM

Mar 8 2017

tmsriram created D30759: With PIE on x86_64, keep hot local arrays on the stack.
Mar 8 2017, 2:39 PM

Oct 19 2016

tmsriram closed D19996: New clang option -mpie-copy-relocationss to indicate support for linker copy relocations when linking as PIE by committing rL284638: New clang option -mpie-copy-relocations to use copy relocations for PIE builds..
Oct 19 2016, 1:33 PM
tmsriram committed rL284638: New clang option -mpie-copy-relocations to use copy relocations for PIE builds..
New clang option -mpie-copy-relocations to use copy relocations for PIE builds.
Oct 19 2016, 1:33 PM
tmsriram updated the diff for D19996: New clang option -mpie-copy-relocationss to indicate support for linker copy relocations when linking as PIE.
  • Fix Help text.
  • Fix indentation.
Oct 19 2016, 11:58 AM
tmsriram added inline comments to D19996: New clang option -mpie-copy-relocationss to indicate support for linker copy relocations when linking as PIE.
Oct 19 2016, 11:51 AM
tmsriram updated the diff for D19996: New clang option -mpie-copy-relocationss to indicate support for linker copy relocations when linking as PIE.
  • Changed help text to "Avail copy relocations support for PIE builds"
  • Removed mno-pie... as a CC1 option
  • Removed help text from mno-pie..
Oct 19 2016, 11:41 AM

Oct 14 2016

tmsriram updated the diff for D19996: New clang option -mpie-copy-relocationss to indicate support for linker copy relocations when linking as PIE.
  • Option name changed to -mpie-copy-relocations
  • Option sets MCPIECopyRelocations in MCOptions
Oct 14 2016, 5:14 PM

Oct 13 2016

tmsriram committed rL284160: New llc option pie-copy-relocations to optimize access to extern globals..
New llc option pie-copy-relocations to optimize access to extern globals.
Oct 13 2016, 2:04 PM
tmsriram closed D24849: Make CanUseCopyRelocWithPIE a llc option, -pie-copy-relocations by committing rL284160: New llc option pie-copy-relocations to optimize access to extern globals..
Oct 13 2016, 2:03 PM
tmsriram updated the diff for D24849: Make CanUseCopyRelocWithPIE a llc option, -pie-copy-relocations.

Check if GV not null before checking its type.

Oct 13 2016, 1:48 PM

Oct 12 2016

tmsriram updated the diff for D24849: Make CanUseCopyRelocWithPIE a llc option, -pie-copy-relocations.
  • Check for isa<GlobalVariable> rather than !isa<Function>
  • Test case for Global Alias is not required as alias implies the aliased object is defined and is hence DSO local.
Oct 12 2016, 3:11 PM

Oct 3 2016

tmsriram updated the diff for D24849: Make CanUseCopyRelocWithPIE a llc option, -pie-copy-relocations.
  • Removed cl::opt from library code
  • Created MCTargetOptions member MCPIECopyRelocations instead.
  • New llc command-line option -pie-copy-relocations to enable it.
  • I will add a clang option separately to enable this.
Oct 3 2016, 11:41 AM

Sep 30 2016

tmsriram added a comment to D24849: Make CanUseCopyRelocWithPIE a llc option, -pie-copy-relocations.

Ping.

Sep 30 2016, 10:36 AM

Sep 23 2016

tmsriram updated subscribers of D24849: Make CanUseCopyRelocWithPIE a llc option, -pie-copy-relocations.

Can you give a little bit more context? How do you plan to use this option?

Sep 23 2016, 1:32 PM

Sep 22 2016

tmsriram retitled D24849: Make CanUseCopyRelocWithPIE a llc option, -pie-copy-relocations from to Make CanUseCopyRelocWithPIE a llvm option, -pie-copy-relocations.
Sep 22 2016, 3:30 PM

Sep 15 2016

tmsriram committed rL281640: [PM] Port CFGViewer and CFGPrinter to the new Pass Manager.
[PM] Port CFGViewer and CFGPrinter to the new Pass Manager
Sep 15 2016, 11:44 AM
tmsriram closed D24592: [PM] Port CFGViewer and CFGPrinter to the new Pass Manager by committing rL281640: [PM] Port CFGViewer and CFGPrinter to the new Pass Manager.
Sep 15 2016, 11:44 AM

Sep 14 2016

tmsriram retitled D24592: [PM] Port CFGViewer and CFGPrinter to the new Pass Manager from to [PM] Port CFGViewer and CFGPrinter to the new Pass Manager.
Sep 14 2016, 3:07 PM

May 12 2016

tmsriram added a comment to D20217: Represent runtime preemption in the IR..

Do you guys think this is a reasonable direction? If so I will add bitcode serialization support and upgrade and plug it to the other object formats.

May 12 2016, 12:33 PM

May 6 2016

tmsriram added a comment to D19995: Optimize access to global variable references in PIE mode when linker supports copy relocations for PIE.

The semantic argument against using copy relocations by default is that they hard-code the size of the variable at link time. What's the story here for that?

May 6 2016, 12:11 PM
tmsriram added a comment to D19995: Optimize access to global variable references in PIE mode when linker supports copy relocations for PIE.

Sorry for the long reply, but I think it is critical we get this right.

When a variable/function is defined in a shared library, either the library or the main program has to use a got. The other one can then use direct accesses.

May 6 2016, 10:37 AM

May 5 2016

tmsriram updated D19995: Optimize access to global variable references in PIE mode when linker supports copy relocations for PIE.
May 5 2016, 2:27 PM
tmsriram retitled D19996: New clang option -mpie-copy-relocationss to indicate support for linker copy relocations when linking as PIE from to New clang option -mpiecopyrelocs to indicate support for linker copy relocations when linking as PIE.
May 5 2016, 2:25 PM