[InstCombine] reduce code for freeze of undef
authorSanjay Patel <spatel@rotateright.com>
Mon, 18 Apr 2022 19:03:10 +0000 (15:03 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 18 Apr 2022 19:14:02 +0000 (15:14 -0400)
commit3a27b51b2751dba1b3fbef68d647833ab65aa45b
tree1d07590996a775e57542f5f555a5def6be8c8451
parent60de144119abc5848d4fae2f502e05ffae90a970
[InstCombine] reduce code for freeze of undef

The description was ambiguous about the behavior
when boths select arms are constant or both arms
are not constant. I don't think there's any
evidence to support either way, but this matches
the code with a more specified description.

We can extend this to deal with vector constants
with undef/poison elements. Currently, those don't
get folded anywhere.
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/select.ll