All in-tree targets pass pointer-sized ConstantSDNodes to the
method. This overload reduced amount of boilerplate code a bit.
This also makes getCALLSEQ_END consistent with getCALLSEQ_START,
which already takes uint64_ts.
Details
- Reviewers
craig.topper spatel MaskRay rusyaev-roman
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/include/llvm/CodeGen/SelectionDAG.h | ||
---|---|---|
955 | This method has become unused (except for in the overload below), but I'm hesitant to remove it. |
lgtm
llvm/include/llvm/CodeGen/SelectionDAG.h | ||
---|---|---|
955 | From my point of view it's better to preserve this function to provide additional customization in the future. |
llvm/include/llvm/CodeGen/SelectionDAG.h | ||
---|---|---|
967 | Size1/Size2 aren't great names; getCALLSEQ_START calls them InSize and OutSize which seems better to me. |
llvm/include/llvm/CodeGen/SelectionDAG.h | ||
---|---|---|
967 | The meaning of these values is target-dependent (see the comment near CALLSEQ_START/CALLSEQ_END nodes). Giving them any specific names would suggest the opposite. "InSize" and "OutSize" are not very meaningful names anyway (what is "in" and "out" here?). |
llvm/include/llvm/CodeGen/SelectionDAG.h | ||
---|---|---|
967 | That full comment is: /// CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end /// of a call sequence, and carry arbitrary information that target might /// want to know. The first operand is a chain, the rest are specified by /// the target and not touched by the DAG optimizers. /// Targets that may use stack to pass call arguments define additional /// operands: /// - size of the call frame part that must be set up within the /// CALLSEQ_START..CALLSEQ_END pair, /// - part of the call frame prepared prior to CALLSEQ_START. /// Both these parameters must be constants, their sum is the total call /// frame size. /// CALLSEQ_START..CALLSEQ_END pairs may not be nested. CALLSEQ_START and CALLSEQ_END are identical in this regard, so having the mismatch in naming between getCALLSEQ_START and getCALLSEQ_END is odd to me. Note that on architectures that don't use the stack for arguments (like NVPTX) these aren't even sizes; NVPTX just uses an incrementing counter that exists solely to end up in assembly comments AFAICT. |
llvm/include/llvm/CodeGen/SelectionDAG.h | ||
---|---|---|
967 |
It seems so, according to the comment. In reality, however, targets give different meaning to the second argument of the CALLSEQ_END. X86, for instance, uses it to record the "callee pop" size (i.e. the adjustment made to the stack pointer by the call). |
llvm/include/llvm/CodeGen/SelectionDAG.h | ||
---|---|---|
967 | Please also note that these nodes have other uses, not related to calls. See ExpandDYNAMIC_STACKALLOC, for example. |
Could someone please merge this straightforward change?
Here are the details:
Sergei Barannikov <barannikov88@gmail.com>
This method has become unused (except for in the overload below), but I'm hesitant to remove it.
On one hand, removing it will force out-of-tree targets to adapt the new overload, on the other it should not be hard.
These nodes already require their operands to be constants, only the value type may vary, but it does not look like a problem -- this may only require a slight modification of patterns.