These patch add a few simplifications when the condition of a select is another select and have constants as operands. @Linus, The patch you wanted is patch #3. Luc Van Oostenryck (5): select: add some testcases for select simplification select: simplify SEL(SEL(x, C, 0), y, z) --> SEL(x, y, z) and its dual select: simplify SEL(SEL(x, C, 0), C, 0) --> SEL(x, C, 0) == cond select: simplify SEL(SEL(x, C1, C2), y, z) --> y (with C1, C2 != 0) select: simplify handling of constant cond or src1 == src2 simplify.c | 40 ++++++++++++++++---- validation/optim/select-constant-cond.c | 10 +++++ validation/optim/select-same-args.c | 9 +++++ validation/optim/select-select-true-false0.c | 10 +++++ validation/optim/select-select-true-false1.c | 13 +++++++ validation/optim/select-select-true-true.c | 9 +++++ 6 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 validation/optim/select-constant-cond.c create mode 100644 validation/optim/select-same-args.c create mode 100644 validation/optim/select-select-true-false0.c create mode 100644 validation/optim/select-select-true-false1.c create mode 100644 validation/optim/select-select-true-true.c -- 2.29.2