This is a patch that adds folding of two logical and/ors that share one variable:
a && (a && b) -> a && b
a && (a & b) -> a && b
This is towards removing the poison-unsafe select optimization (D93065 has more context).
Alive2 online is broken now; this is the output from my local machine: https://gist.github.com/aqjune/f5e4430286a259fc6577faa8f7afd97d
(validates the result of select-safe-bool-transforms.ll)