summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetInstrInfo.cpp
diff options
context:
space:
mode:
authorDavid Stenberg <david.stenberg@ericsson.com>2019-09-08 14:05:10 +0000
committerDavid Stenberg <david.stenberg@ericsson.com>2019-09-08 14:05:10 +0000
commit8b70139e95963e699a428d5c9fc5f1956370f39c (patch)
tree5630a5120b0a15fdd5233932a33bbda4e9aed62f /llvm/lib/CodeGen/TargetInstrInfo.cpp
parentdf2501adcac7d7075c1c51a90fe9bcb1e4281619 (diff)
downloadbcm5719-llvm-8b70139e95963e699a428d5c9fc5f1956370f39c.tar.gz
bcm5719-llvm-8b70139e95963e699a428d5c9fc5f1956370f39c.zip
[NFC] Make the describeLoadedValue() hook return machine operand objects
Summary: This changes the ParamLoadedValue pair which the describeLoadedValue() hook returns so that MachineOperand objects are returned instead of pointers. When describing call site values we may need to describe operands which are not part of the instruction. One such example is zero-materializing XORs on x86, which I have implemented support for in a child revision. Instead of having to return a pointer to an operand stored somewhere outside the instruction, start returning objects directly instead, as that simplifies the code. The MachineOperand class only holds POD members, and on x86-64 it is 32 bytes large. That combined with copy elision means that the overhead of returning a machine operand object from the hook does not become very large. I benchmarked this on a 8-thread i7-8650U machine with 32 GB RAM. The benchmark consisted of building a clang 8.0 binary configured with: -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DLLVM_TARGETS_TO_BUILD=X86 \ -DLLVM_USE_SANITIZER=Address \ -DCMAKE_CXX_FLAGS="-Xclang -femit-debug-entry-values -stdlib=libc++" The average wall clock time increased by 4 seconds, from 62:05 to 62:09, which is an 0.1% increase. Reviewers: aprantl, vsk, djtodoro, NikolaPrica Reviewed By: vsk Subscribers: hiraditya, ychen, llvm-commits Tags: #debug-info, #llvm Differential Revision: https://reviews.llvm.org/D67261 llvm-svn: 371332
Diffstat (limited to 'llvm/lib/CodeGen/TargetInstrInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetInstrInfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp
index e64c67f6240..0406649345b 100644
--- a/llvm/lib/CodeGen/TargetInstrInfo.cpp
+++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp
@@ -1129,10 +1129,10 @@ TargetInstrInfo::describeLoadedValue(const MachineInstr &MI) const {
if (isCopyInstr(MI, SrcRegOp, DestRegOp)) {
Op = SrcRegOp;
- return ParamLoadedValue(Op, Expr);
+ return ParamLoadedValue(*Op, Expr);
} else if (MI.isMoveImmediate()) {
Op = &MI.getOperand(1);
- return ParamLoadedValue(Op, Expr);
+ return ParamLoadedValue(*Op, Expr);
} else if (MI.hasOneMemOperand()) {
int64_t Offset;
const auto &TRI = MF->getSubtarget().getRegisterInfo();
@@ -1144,7 +1144,7 @@ TargetInstrInfo::describeLoadedValue(const MachineInstr &MI) const {
Expr = DIExpression::prepend(Expr, DIExpression::DerefAfter, Offset);
Op = BaseOp;
- return ParamLoadedValue(Op, Expr);
+ return ParamLoadedValue(*Op, Expr);
}
return None;
OpenPOWER on IntegriCloud