diff options
author | Nikita Popov <npopov@redhat.com> | 2023-02-27 16:36:07 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-02-27 16:47:16 +0100 |
commit | 86d1ed9e480849ff57dfee23975165465ebe0fc8 (patch) | |
tree | f66b4abd42e7404e2486fb3e766d367041cd4756 /llvm/lib/Analysis/InlineCost.cpp | |
parent | 9a29d87538842a29b430c6956a4f914896643691 (diff) | |
download | llvm-86d1ed9e480849ff57dfee23975165465ebe0fc8.zip llvm-86d1ed9e480849ff57dfee23975165465ebe0fc8.tar.gz llvm-86d1ed9e480849ff57dfee23975165465ebe0fc8.tar.bz2 |
[InlineCost] Avoid ConstantExpr::getSelect()
Instead use ConstantFoldSelectInstruction(), which will return
nullptr if it cannot be folded and a constant expression would
be produced instead.
In preparation for removing select constant expressions.
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index 5bcc8a2..f303670 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -2314,10 +2314,10 @@ bool CallAnalyzer::visitSelectInst(SelectInst &SI) { : nullptr; if (!SelectedV) { // Condition is a vector constant that is not all 1s or all 0s. If all - // operands are constants, ConstantExpr::getSelect() can handle the cases - // such as select vectors. + // operands are constants, ConstantFoldSelectInstruction() can handle the + // cases such as select vectors. if (TrueC && FalseC) { - if (auto *C = ConstantExpr::getSelect(CondC, TrueC, FalseC)) { + if (auto *C = ConstantFoldSelectInstruction(CondC, TrueC, FalseC)) { SimplifiedValues[&SI] = C; return true; } |