[InstCombine] Fold assume(false) to non-terminator unreachable
authorNikita Popov <npopov@redhat.com>
Thu, 22 Jun 2023 10:15:58 +0000 (12:15 +0200)
committerNikita Popov <npopov@redhat.com>
Thu, 22 Jun 2023 14:44:05 +0000 (16:44 +0200)
commit7b356769fc724c07e1a8be1beb6243474da9aaff
treec797c7d412808cba65931f3977622497e2391113
parent93407f7675f127a69f3e86be96f5a06786274941
[InstCombine] Fold assume(false) to non-terminator unreachable

assume(false) is immediate UB, so fold it to (non-terminator)
unreachable.
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/assume.ll
llvm/test/Transforms/InstCombine/out-of-bounds-indexes.ll