We should only fold min(not X, C) -> not max(X, not C) if not C is as simple as C, otherwise there's a competing not max(X, not Y) -> min(not X, Y) that will form an infinite loop. Checking for a non-expr constant is a good way to do this (the fold above already takes care of C == not D so we don't lose any power that way).
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM - we may want to do a bulk search/replace of m_Constant() -> m_ImmConstant() to avoid these loops.
Comment Actions
I pushed an alternative fix with:
8a10f4a0f661a1171 ( D109058 )
So I think we can abandon this patch. If there's some constant expression variant that still escapes/loops, let me know.