[PATCH] D124526: [SimpleLoopUnswitch] Collect either logical ANDs/ORs but not both.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 5 02:21:36 PDT 2022
fhahn marked an inline comment as done.
fhahn added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:124
+ while (match(Cond, m_Select(m_Value(CondNext), m_One(), m_Zero())))
+ Cond = CondNext;
+
----------------
nikic wrote:
> Might make more sense to do the stripping as a separate step `Cond = stripTrivialSelect(Cond)`, just without the bit that actually updates the condition in the branch instruction?
I updated the patch to just use such a helper. Roughly the same places need updating and I think it's fine to go either way. Unfortunately I don't think there's a good way to prevent making the same mistake when adding new code :(
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124526/new/
https://reviews.llvm.org/D124526
More information about the llvm-commits
mailing list