Skip to content

Commit

Permalink
NewGVN: use ConstantInt::getBool
Browse files Browse the repository at this point in the history
  • Loading branch information
artagnon committed Jan 11, 2025
1 parent 647a15e commit 0247dae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Scalar/NewGVN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1966,8 +1966,7 @@ NewGVN::ExprResult NewGVN::performSymbolicCmpEvaluation(Instruction *I) const {
// edge then we may be implied true or false.
if (auto R = ICmpInst::isImpliedByMatchingCmp(BranchPredicate,
OurPredicate)) {
auto *C = *R ? ConstantInt::getTrue(CI->getType())
: ConstantInt::getFalse(CI->getType());
auto *C = ConstantInt::getBool(CI->getType(), *R);
return ExprResult::some(createConstantExpression(C), PI);
}
} else {
Expand Down

0 comments on commit 0247dae

Please sign in to comment.