[llvm] 89a5d80 - [SCCP] add a code comment about sitofp -> uitofp; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 14:26:23 PDT 2022
Author: Sanjay Patel
Date: 2022-09-30T17:26:10-04:00
New Revision: 89a5d804c1c2e35dda3c39a6f0f5006a296c75ee
URL: https://github.com/llvm/llvm-project/commit/89a5d804c1c2e35dda3c39a6f0f5006a296c75ee
DIFF: https://github.com/llvm/llvm-project/commit/89a5d804c1c2e35dda3c39a6f0f5006a296c75ee.diff
LOG: [SCCP] add a code comment about sitofp -> uitofp; NFC
D134975 would have added this fold, but we decided it's
not worth doing without some evidence of benefit.
Added:
Modified:
llvm/lib/Transforms/Scalar/SCCP.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 422a41ea4aa91..f6868cd70ce79 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -173,6 +173,8 @@ static bool replaceSignedInst(SCCPSolver &Solver,
Instruction *NewInst = nullptr;
switch (Inst.getOpcode()) {
+ // Note: We do not fold sitofp -> uitofp here because that could be more
+ // expensive in codegen and may not be reversible in the backend.
case Instruction::SExt: {
// If the source value is not negative, this is a zext.
Value *Op0 = Inst.getOperand(0);
More information about the llvm-commits
mailing list