[PATCH] D134796: [StackLifetime] More efficient loop for LivenessType::Must
Florian Mayer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 28 12:56:50 PDT 2022
fmayer added inline comments.
================
Comment at: llvm/lib/Analysis/StackLifetime.cpp:199-200
+ // Everything is "may be dead" for entry without predecessors.
+ if (Type == LivenessType::Must && BitsIn.empty())
+ BitsIn.resize(NumAllocas, true);
+
----------------
if you wanted to micro-optimize, you could put the `BlockInfo.LiveIn |= BitsIn` in this condition, and make the one below an `else if`.
================
Comment at: llvm/lib/Analysis/StackLifetime.cpp:216-217
+ case LivenessType::May:
+ // "may be alive" is set by lifetime start.
+ BitsIn.reset(BlockInfo.End);
+ BitsIn |= BlockInfo.Begin;
----------------
these comments are a bit confusing. it says "set by lifetime start" then uses BlockInfo.End.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134796/new/
https://reviews.llvm.org/D134796
More information about the llvm-commits
mailing list