|
20 | 20 | #include "swift/SIL/PatternMatch.h" |
21 | 21 | #include "swift/SIL/SILBuilder.h" |
22 | 22 | #include "swift/SILOptimizer/Utils/CastOptimizer.h" |
23 | | -#include "swift/SILOptimizer/Utils/DebugOptUtils.h" |
24 | 23 | #include "swift/SILOptimizer/Utils/InstOptUtils.h" |
25 | 24 | #include "swift/SILOptimizer/Utils/InstructionDeleter.h" |
26 | 25 | #include "llvm/ADT/APFloat.h" |
@@ -1233,8 +1232,8 @@ static SILValue constantFoldIsConcrete(BuiltinInst *BI) { |
1233 | 1232 | return inst; |
1234 | 1233 | } |
1235 | 1234 |
|
1236 | | -static SILValue constantFoldBuiltinWithoutSalvagingDebugInfo(BuiltinInst *BI, |
1237 | | - std::optional<bool> &ResultsInError) { |
| 1235 | +SILValue swift::constantFoldBuiltin(BuiltinInst *BI, |
| 1236 | + std::optional<bool> &ResultsInError) { |
1238 | 1237 | const IntrinsicInfo &Intrinsic = BI->getIntrinsicInfo(); |
1239 | 1238 | SILModule &M = BI->getModule(); |
1240 | 1239 |
|
@@ -1445,20 +1444,6 @@ case BuiltinValueKind::id: |
1445 | 1444 | return nullptr; |
1446 | 1445 | } |
1447 | 1446 |
|
1448 | | -SILValue swift::constantFoldBuiltin(BuiltinInst *BI, |
1449 | | - std::optional<bool> &ResultsInError) { |
1450 | | - const auto value = |
1451 | | - constantFoldBuiltinWithoutSalvagingDebugInfo(BI, ResultsInError); |
1452 | | - // Salvage debug info of BI arguments if it was successfully folded. |
1453 | | - if (value) { |
1454 | | - for (auto arg : BI->getArguments()) { |
1455 | | - if (auto *argInst = arg.getDefiningInstruction()) |
1456 | | - swift::salvageDebugInfo(argInst); |
1457 | | - } |
1458 | | - } |
1459 | | - return value; |
1460 | | -} |
1461 | | - |
1462 | 1447 | /// On success this places a new value for each result of Op->getUser() into |
1463 | 1448 | /// Results. Results is guaranteed on success to have the same number of entries |
1464 | 1449 | /// as results of User. If we could only simplify /some/ of an instruction's |
|
0 commit comments