aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2024-03-19 23:26:51 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2024-03-20 00:50:45 -0500
commit6960ace534c4021301dd5a9933ca06ba96edea23 (patch)
treef7a26fc1a6fbcec40036874486c97b8f5c1bbda4 /llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
parentc2423024923bae9176eda6cd958217c83955150d (diff)
downloadllvm-6960ace534c4021301dd5a9933ca06ba96edea23.zip
llvm-6960ace534c4021301dd5a9933ca06ba96edea23.tar.gz
llvm-6960ace534c4021301dd5a9933ca06ba96edea23.tar.bz2
Revert "[InstCombine] Canonicalize `(sitofp x)` -> `(uitofp x)` if `x >= 0`"
This reverts commit d80d5b923c6f611590a12543bdb33e0c16044d44. It wasn't a particularly important transform to begin with and caused some codegen regressions on targets that prefer `sitofp` so dropping. Might re-visit along with adding `nneg` flag to `uitofp` so its easily reversable for the backend.
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
index b19da1e..089a70c 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -1961,11 +1961,7 @@ Instruction *InstCombinerImpl::visitUIToFP(CastInst &CI) {
}
Instruction *InstCombinerImpl::visitSIToFP(CastInst &CI) {
- if (Instruction *R = commonCastTransforms(CI))
- return R;
- if (isKnownNonNegative(CI.getOperand(0), SQ))
- return new UIToFPInst(CI.getOperand(0), CI.getType());
- return nullptr;
+ return commonCastTransforms(CI);
}
Instruction *InstCombinerImpl::visitIntToPtr(IntToPtrInst &CI) {