[InstCombine] Avoid uses of ConstantExpr::getOr()
authorNikita Popov <npopov@redhat.com>
Mon, 24 Jul 2023 14:45:32 +0000 (16:45 +0200)
committerNikita Popov <npopov@redhat.com>
Mon, 24 Jul 2023 14:50:45 +0000 (16:50 +0200)
commit8249d6724ccd8876b421dd96151dab98fa45210c
tree69bbb8d760a908c2455174d29aa4913980431f06
parent5990199e2c1c1d99367437ddaef0bbadfa11aa85
[InstCombine] Avoid uses of ConstantExpr::getOr()

Replace these with IRBuilder uses, as we don't (from a type
perspective) care about Constant results.

Switch the predicate to m_ImmConstant() instead of isa<Constant>
to guarantee that these do get folded away and our assumptions
about simplifications hold true.
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp