[llvm] 776708b - [LiveDebugValues] Remove early-exit when testing regmasks, NFC

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 15:28:01 PDT 2020


Author: Vedant Kumar
Date: 2020-06-01T15:16:10-07:00
New Revision: 776708b00bddb01f91b8d44f6853770966d335a5

URL: https://github.com/llvm/llvm-project/commit/776708b00bddb01f91b8d44f6853770966d335a5
DIFF: https://github.com/llvm/llvm-project/commit/776708b00bddb01f91b8d44f6853770966d335a5.diff

LOG: [LiveDebugValues] Remove early-exit when testing regmasks, NFC

In transferRegisterDef, if the instruction has a regmask attached, we'll
check if any currently used register is clobbered by the regmask.

The early exit in this scan isn't necessary, costs a set lookup, and is
almost never taken [1]. Delete it.

[1]
http://lab.llvm.org:8080/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/llvm/lib/CodeGen/LiveDebugValues.cpp.html#L1136

Added: 
    

Modified: 
    llvm/lib/CodeGen/LiveDebugValues.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues.cpp
index 6f0f9bd01ed3..85fb83dd5ab9 100644
--- a/llvm/lib/CodeGen/LiveDebugValues.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues.cpp
@@ -1197,10 +1197,6 @@ void LiveDebugValues::transferRegisterDef(
     SmallVector<uint32_t, 32> UsedRegs;
     getUsedRegs(OpenRanges.getVarLocs(), UsedRegs);
     for (uint32_t Reg : UsedRegs) {
-      // The VarLocs residing in this register are already in the kill set.
-      if (DeadRegs.count(Reg))
-        continue;
-
       // Remove ranges of all clobbered registers. Register masks don't usually
       // list SP as preserved. Assume that call instructions never clobber SP,
       // because some backends (e.g., AArch64) never list SP in the regmask.


        


More information about the llvm-commits mailing list