- User Since
- Jan 7 2013, 9:35 AM (314 w, 1 d)
This code LGTM modulo whatever version number we settle on in the tool-conventions issue.
As a follow-on, I guess we could get ambitious and add the "language" field as well. I think the only way to do that would be to sniff the language field of the DICompileUnit metadata node (it would of course only exist if there's debug info, but doing anything else seems a bit crazytown).
Yeah, thinking about this a little more, I think it makes sense. IIRC the "address" (or value of a symbol, which I think is equivalent?) in the object file/linking/executable context refers to the section offset rather than memory-mapped address even for ELF, which would make our objdump consistent with other targets too. For the purposes of LLVM internals, I think you are right that having that consistency seems best; for the users, it's possible we'll want to put some more info in the final displayed output, but we can figure out how to get that once the guts are hooked up.
Mon, Jan 14
Oh I had actually forgotten that the PC offset is the offset in the module, not the offset within the function. So for objdump either way would be ok, since you could easily find what function a particular instruction is in. I guess my point is not that the formats have to match, (since e.g. you probably wouldn't be using the same code to parse both browser output and tool output?) but if you are debugging and looking at a stack trace, you should easily be able to find the same location in an objdump-produced assembly dump.... Without a calculator (annoyance of mismatched hex/dec address formats was what originally led me to add that section to the spec :) )
Is this actually what we want?
If I'm debugging a crash in a browser, the browser shows stack traces by function index rather than file offset, in this format
So it might be better for objdump to match that format.
One difference between the multilib style and multi-arch style is whether any headers can be shared between the 2 arches. Historically at least, with bitness-flavored variants of the same architecture there were common headers used by both, and it was just the library directories that needed to be different. I've heard anecdotally that this is not the case for ARM though.
Fri, Jan 11
LGTM but is there really no test for this? I'd expect to see this on linker command lines or something, right? If not we should add one.
Could this CL be the cause of the newly-passing test in https://ci.chromium.org/p/wasm/builders/luci.wasm.ci/linux/2560 ?
Wed, Jan 9
Just ran across this again. @jgravelle-google is this still relevant?
Tue, Jan 8
Mon, Jan 7
This patch looks fine with the comment nit. I'm a little unclear because get_global and set_global are still marked as mayLoad and mayStore. Is it a problem with both the explicit modeling of the stack pointer and treating them as reads and writes for this purpose?
Wed, Dec 19
Come to think of it, might we actually want the possibility of constant offset in addition to the "kind" and index field, e.g. for cases where the value is actually a pointer?
I think there will eventually be more consumers, including traditional-style debuggers (even if just for non-web use cases).
I had initially hoped that we could get away with just using DWARF registers more-or-less directly for locals, but as Yury pointed out, there are a lot of places that assume a fixed number of architectural registers. And of course wasm globals and the wasm value stack don't really have analogs on most architectures. I still hope we'll be able to use DWARF's CFA and other stack stuff for the stack in linear memory. (Although in our case the stack pointer will be a global rather than a register. Hopefully we can make that work.)
Tue, Dec 18
@aprantl Is the advantage of your suggested approach just that we don't have to define a new expression type? Obviously the interpretation is not the same as DW_OP_breg on other targets so as you say, either way there would have to be special logic in all the tools that consume it. Is this kind of repurposing of builtin primitives common?
Mon, Dec 17
Dec 10 2018
At a high level (i.e. across all the LLVM targets) the intention is that binary and asm streamers have the same interface. That's sort of enforced by the fact that they both have the same base class, but I guess in actuality the "interface" also includes the data on the symbol object. I think I agree that it makes more sense to think of the symbols as owned outside the streamer and have them be a way to pass info into the streamer (the current code is more like having them be state that is only needed by the binary streamer but which lives outside the streamer). I guess that's also another way of saying that symbol type and module name are properties of a symbol even if those properties are only needed by one of the streamers. I guess it might also be useful for debugging or future modifications to have the contents of the symbols be the same regardless of which output type is in use.
I don't 100% understand the distinction but if you've tested with LLVM_LINK_LLVM_DYLIB and BUILD_SHARED_LIBS and the static build then LGTM :)
Dec 7 2018
Dec 3 2018
Nov 28 2018
Nov 27 2018
Nov 19 2018
Yeah I think for PIC code all globals need to be relative.
LLVM doesn't actually have an IWYU guideline though: https://llvm.org/docs/CodingStandards.html#include-as-little-as-possible ... but also not a "dont IWYU".
Not sure I am parsing your commit message right. So we fold if DSO local, and not otherwise?
Nov 16 2018
Nov 15 2018
Nov 14 2018
Nov 13 2018
LGTM too. I realized I don't really like (or perhaps I just don't understand) the term "Attribute" where it's used in the spec, but it's fine for this code to match that.
Nov 12 2018
Conceptually, COMPILER_RT_ABI is the calling convention used by all compiler-rt functions. It is explicitly used everywhere because it may be different from the default calling convention on some targets. In practice I believe it only affects ARM, where the calling convention uses ARM's soft-float ABI (where IIRC floats are passed in integer registers) even on targets that use the hard-float ABI by default. The compiler knows the calling conventions and emits the right code when it emits the libcalls, and the ABI declaration on the implementations causes the right calling convention to be used there. The unusual thing about the tests is that they locally declare the compiler-rt functions explicitly. So this declaration has to match the implementation. It may not matter for PPC but my recommendation would be "just use it everywhere in compiler-rt" for simplicity.
Nov 9 2018
Nov 8 2018
Nov 7 2018
Nov 6 2018
Nov 5 2018
Object files currently import their memories, right? We should probably make that import shared when we use thread-model=posix.
Nov 2 2018
I like the idea of trying to make the assembler less stateful if possible, but that can be another CL
Nov 1 2018
By "Multiple catches for a try" you mean catches with different tags?
At some point I could imagine a frontend possibly wanting to opt out of this pass entirely, but we can always add that option in the future.
Oct 29 2018
Oct 25 2018
Oct 24 2018
I think assertions here are OK as long as the plan of record is is to put error handling into the parsers. If we have assertions, we can't have a test case (until we can test the parser errors) because it would always fail on release builds without asserts.
I think catching block mismatch errors at parse time makes sense; although the third way that MCInst can be generated (aside from the compiler and asmparser) is the object file parser. So those checks would have to go both in the asm parser and object file parser. But if that means that we can hook into some existing error handling mechanism instead of using report_fatal_error, then it's probably worth it.
I agree that we can't use an assert string in a CHECK. The test wouldn't pass in a release non-asserts build (our release binaries have assertions, but it's not the default, and the official release binaries don't).
Oct 23 2018
This kind of code should never be produced by the wasm backend, right? In which case this could be an assert/unreachable rather than a fatal error. But I guess this code also prints insts that are parsed from an obj or asm file, right? In that case the input could just be bogus and we shouldn't assert.
So I'm not sure if it's possible here to tell which one to ideally use.
- can this test be an llvm-mc test (which has assembly input and prints assembly)? I think the answer is "yes" (at least eventually) but I'm not sure if the asm parser is far enough along yet for that.
- I wonder if there's some kind of infrastructure in MC for printing errors (e.g. for malformed asm) other than just the big hammer of report_fatal_error? If so it probably makes sense to use that (even if we can't tell the difference between bogus code from the compiler and bogus input from an asm user).
Oct 19 2018
Oct 11 2018
Oct 9 2018
This was landed in rL343733. not sure why it didn't close already.
Is that information what's used/needed to allow the linker to create a separate wasm segment per global?
Test looks much nicer now, LGTM
Oct 4 2018
Right but the point is that we don't currently have a way to ensure that the code is doing its job; if the SLP vectorizer stops doing its thing and calling the code that was asserting, then this test won't be testing anything.
W is int64_t (which is long long for wasm32 and would probably be long for wasm64 since that would probably LP64 (like Linux) rather than LLP64 (Like Win64). So if we want it to be the same for both wasm32 and wasm64, I guess we want LL.
Otherwise LGTM, and I verified that it fixes the expensive checks failure.
Yes, I can reproduce. I'll take a look.