Skip to content

Commit

Permalink
Optimize in FCS (#3784)
Browse files Browse the repository at this point in the history
* Optimize in FCS

* Transport tcConfig

* Cleanup

* Replace more ILAsm in Exprs

* More ILAsm replacements

* update resource name

* Added some tests (#40)

* Add option to toggle unused declarations analyzer (#4074)

* Add option to toggle unused declarations analyzer

* Better name and handle registering code fixes.

This will ensure that if someone uses warnon:1182, we won't suggest
fixes if they've turned off the feature.

* Revert #1650 (and #3366) (#4173)

* Fix error logging in brace matching code (#4140)

* Remove error logger pushing code

* Update service.fs

* Fix #4200: Vsix: fix empty "New file" window for web projects (#4202)

* LOC CHECKIN | visualfsharp - master | 20180112 (#4194)

* Fixed FCS netcore tests (#4180)

* Remove ambiguous resolution error FS0332 (#4170)

* Add IsInteractive to parsing options for script load closures (#4169)

* Add IsInteractive to FSharpParsingOptions

* Add test

* Set serializable bit for all serializable types (#4211)

* Minor fix (#4195)

on string 58.

*  Symbols API: add Index to active pattern case, Name to pattern group (#4222)

* Symbols API: add Index to active pattern case, Name to pattern group

* Symbols API: add active pattern case use tests

* don't rebuild (#4230)

* Optimize in FCS

* Transport tcConfig

* Cleanup

* Replace more ILAsm in Exprs

* More ILAsm replacements

* update resource name

* Added some tests

* test conditions update

* test update

* test condition update

* test update

* review update

* added checked operators

* fixed dual conversions

* review fixes

* more targeted replacements

* adapt to latest

* added more tests

* added more tests

* review fixes

* fixed warnings
  • Loading branch information
forki authored and KevinRansom committed Feb 17, 2018
1 parent be5b58c commit 2180de4
Show file tree
Hide file tree
Showing 8 changed files with 2,609 additions and 143 deletions.
72 changes: 67 additions & 5 deletions src/fsharp/TastOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6140,22 +6140,84 @@ let mkCallNewQuerySource (g:TcGlobals) m ty1 ty2 e1 = m

let mkCallCreateEvent (g:TcGlobals) m ty1 ty2 e1 e2 e3 = mkApps g (typedExprForIntrinsic g m g.create_event_info, [[ty1;ty2]], [ e1;e2;e3 ], m)
let mkCallGenericComparisonWithComparerOuter (g:TcGlobals) m ty comp e1 e2 = mkApps g (typedExprForIntrinsic g m g.generic_comparison_withc_outer_info, [[ty]], [ comp;e1;e2 ], m)
let mkCallEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.equals_operator_info, [[ty]], [ e1;e2 ], m)
let mkCallGenericEqualityEROuter (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.generic_equality_er_outer_info, [[ty]], [ e1;e2 ], m)
let mkCallGenericEqualityWithComparerOuter (g:TcGlobals) m ty comp e1 e2 = mkApps g (typedExprForIntrinsic g m g.generic_equality_withc_outer_info, [[ty]], [comp;e1;e2], m)
let mkCallGenericHashWithComparerOuter (g:TcGlobals) m ty comp e1 = mkApps g (typedExprForIntrinsic g m g.generic_hash_withc_outer_info, [[ty]], [comp;e1], m)

let mkCallSubtractionOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_subtraction_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.equals_operator_info, [[ty]], [ e1;e2 ], m)
let mkCallNotEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.not_equals_operator, [[ty]], [ e1;e2 ], m)
let mkCallLessThanOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.less_than_operator, [[ty]], [ e1;e2 ], m)
let mkCallLessThanOrEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.less_than_or_equals_operator, [[ty]], [ e1;e2 ], m)
let mkCallGreaterThanOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.greater_than_operator, [[ty]], [ e1;e2 ], m)
let mkCallGreaterThanOrEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.greater_than_or_equals_operator, [[ty]], [ e1;e2 ], m)

let mkCallArrayLength (g:TcGlobals) m ty el = mkApps g (typedExprForIntrinsic g m g.array_length_info, [[ty]], [el], m)
let mkCallArrayGet (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.array_get_info, [[ty]], [ e1 ; e2 ], m)
let mkCallAdditionOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_addition_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallSubtractionOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_subtraction_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallMultiplyOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_multiply_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallDivisionOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_division_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallModulusOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_modulus_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallBitwiseAndOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_and_info, [[ty]], [e1;e2], m)
let mkCallBitwiseOrOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_or_info, [[ty]], [e1;e2], m)
let mkCallBitwiseXorOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_xor_info, [[ty]], [e1;e2], m)
let mkCallShiftLeftOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_shift_left_info, [[ty]], [e1;e2], m)
let mkCallShiftRightOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_shift_right_info, [[ty]], [e1;e2], m)

let mkCallUnaryNegOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.unchecked_unary_minus_info, [[ty]], [e1], m)
let mkCallUnaryNotOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.bitwise_unary_not_info, [[ty]], [e1], m)

let mkCallAdditionChecked (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_addition_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallSubtractionChecked (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_subtraction_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallMultiplyChecked (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_multiply_info, [[ty; ty; ty]], [e1;e2], m)
let mkCallUnaryNegChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.checked_unary_minus_info, [[ty]], [e1], m)

let mkCallToByteChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.byte_checked_info, [[ty]], [e1], m)
let mkCallToSByteChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.sbyte_checked_info, [[ty]], [e1], m)
let mkCallToInt16Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int16_checked_info, [[ty]], [e1], m)
let mkCallToUInt16Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint16_checked_info, [[ty]], [e1], m)
let mkCallToIntChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int_checked_info, [[ty]], [e1], m)
let mkCallToInt32Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int32_checked_info, [[ty]], [e1], m)
let mkCallToUInt32Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint32_checked_info, [[ty]], [e1], m)
let mkCallToInt64Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int64_checked_info, [[ty]], [e1], m)
let mkCallToUInt64Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint64_checked_info, [[ty]], [e1], m)
let mkCallToIntPtrChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.nativeint_checked_info, [[ty]], [e1], m)
let mkCallToUIntPtrChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.unativeint_checked_info, [[ty]], [e1], m)

let mkCallToByteOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.byte_operator_info, [[ty]], [e1], m)
let mkCallToSByteOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.sbyte_operator_info, [[ty]], [e1], m)
let mkCallToInt16Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int16_operator_info, [[ty]], [e1], m)
let mkCallToUInt16Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint16_operator_info, [[ty]], [e1], m)
let mkCallToIntOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int_operator_info, [[ty]], [e1], m)
let mkCallToInt32Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int32_operator_info, [[ty]], [e1], m)
let mkCallToUInt32Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint32_operator_info, [[ty]], [e1], m)
let mkCallToInt64Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int64_operator_info, [[ty]], [e1], m)
let mkCallToUInt64Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint64_operator_info, [[ty]], [e1], m)
let mkCallToSingleOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.float32_operator_info, [[ty]], [e1], m)
let mkCallToDoubleOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.float_operator_info, [[ty]], [e1], m)
let mkCallToIntPtrOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.nativeint_operator_info, [[ty]], [e1], m)
let mkCallToUIntPtrOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.unativeint_operator_info, [[ty]], [e1], m)

let mkCallToCharOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.char_operator_info, [[ty]], [e1], m)
let mkCallToEnumOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.enum_operator_info, [[ty]], [e1], m)

let mkCallArrayLength (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.array_length_info, [[ty]], [e1], m)
let mkCallArrayGet (g:TcGlobals) m ty e1 idx1 = mkApps g (typedExprForIntrinsic g m g.array_get_info, [[ty]], [ e1 ; idx1 ], m)
let mkCallArray2DGet (g:TcGlobals) m ty e1 idx1 idx2 = mkApps g (typedExprForIntrinsic g m g.array2D_get_info, [[ty]], [ e1 ; idx1; idx2 ], m)
let mkCallArray3DGet (g:TcGlobals) m ty e1 idx1 idx2 idx3 = mkApps g (typedExprForIntrinsic g m g.array3D_get_info, [[ty]], [ e1 ; idx1; idx2; idx3 ], m)
let mkCallArray4DGet (g:TcGlobals) m ty e1 idx1 idx2 idx3 idx4 = mkApps g (typedExprForIntrinsic g m g.array4D_get_info, [[ty]], [ e1 ; idx1; idx2; idx3; idx4 ], m)
let mkCallArraySet (g:TcGlobals) m ty e1 idx1 v = mkApps g (typedExprForIntrinsic g m g.array_set_info, [[ty]], [ e1 ; idx1; v ], m)
let mkCallArray2DSet (g:TcGlobals) m ty e1 idx1 idx2 v = mkApps g (typedExprForIntrinsic g m g.array2D_set_info, [[ty]], [ e1 ; idx1; idx2; v ], m)
let mkCallArray3DSet (g:TcGlobals) m ty e1 idx1 idx2 idx3 v = mkApps g (typedExprForIntrinsic g m g.array3D_set_info, [[ty]], [ e1 ; idx1; idx2; idx3; v ], m)
let mkCallArray4DSet (g:TcGlobals) m ty e1 idx1 idx2 idx3 idx4 v = mkApps g (typedExprForIntrinsic g m g.array4D_set_info, [[ty]], [ e1 ; idx1; idx2; idx3; idx4; v ], m)

let mkCallHash (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.hash_info, [[ty]], [ e1 ], m)
let mkCallBox (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.box_info, [[ty]], [ e1 ], m)
let mkCallIsNull (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.isnull_info, [[ty]], [ e1 ], m)
let mkCallIsNotNull (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.isnotnull_info, [[ty]], [ e1 ], m)
let mkCallRaise (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.raise_info, [[ty]], [ e1 ], m)

let mkCallNewDecimal (g:TcGlobals) m (e1, e2, e3, e4, e5) = mkApps g (typedExprForIntrinsic g m g.new_decimal_info, [], [ e1;e2;e3;e4;e5 ], m)

let mkCallNewFormat (g:TcGlobals) m aty bty cty dty ety e1 = mkApps g (typedExprForIntrinsic g m g.new_format_info, [[aty;bty;cty;dty;ety]], [ e1 ], m)
let mkCallRaise (g:TcGlobals) m aty e1 = mkApps g (typedExprForIntrinsic g m g.raise_info, [[aty]], [ e1 ], m)

let TryEliminateDesugaredConstants g m c =
match c with
Expand Down
66 changes: 64 additions & 2 deletions src/fsharp/TastOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1221,15 +1221,77 @@ val mkCallArrayGet : TcGlobals -> range -> TType -> Expr -> Expr -> Ex
val mkCallArray2DGet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr
val mkCallArray3DGet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr
val mkCallArray4DGet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr
val mkCallArraySet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr
val mkCallArray2DSet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr
val mkCallArray3DSet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr
val mkCallArray4DSet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr

val mkCallHash : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallBox : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallIsNull : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallIsNotNull : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallRaise : TcGlobals -> range -> TType -> Expr -> Expr

val mkCallGenericComparisonWithComparerOuter : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr
val mkCallGenericEqualityEROuter : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallSubtractionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallGenericEqualityWithComparerOuter : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr
val mkCallGenericHashWithComparerOuter : TcGlobals -> range -> TType -> Expr -> Expr -> Expr

val mkCallEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallNotEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallLessThanOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallLessThanOrEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallGreaterThanOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallGreaterThanOrEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr

val mkCallAdditionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallSubtractionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallMultiplyOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallDivisionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallModulusOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallBitwiseAndOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallBitwiseOrOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallBitwiseXorOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallShiftLeftOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallShiftRightOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr

val mkCallUnaryNegOperator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallUnaryNotOperator : TcGlobals -> range -> TType -> Expr -> Expr

val mkCallAdditionChecked : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallSubtractionChecked : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallMultiplyChecked : TcGlobals -> range -> TType -> Expr -> Expr -> Expr
val mkCallUnaryNegChecked : TcGlobals -> range -> TType -> Expr -> Expr

val mkCallToByteChecked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToSByteChecked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToInt16Checked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToUInt16Checked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToIntChecked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToInt32Checked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToUInt32Checked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToInt64Checked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToUInt64Checked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToIntPtrChecked : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToUIntPtrChecked : TcGlobals -> range -> TType -> Expr -> Expr

val mkCallToByteOperator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToSByteOperator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToInt16Operator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToUInt16Operator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToIntOperator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToInt32Operator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToUInt32Operator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToInt64Operator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToUInt64Operator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToSingleOperator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToDoubleOperator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToIntPtrOperator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToUIntPtrOperator : TcGlobals -> range -> TType -> Expr -> Expr

val mkCallToCharOperator : TcGlobals -> range -> TType -> Expr -> Expr
val mkCallToEnumOperator : TcGlobals -> range -> TType -> Expr -> Expr

val mkCallDeserializeQuotationFSharp20Plus : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr -> Expr
val mkCallDeserializeQuotationFSharp40Plus : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr
val mkCallCastQuotation : TcGlobals -> range -> TType -> Expr -> Expr
Expand Down
Loading

0 comments on commit 2180de4

Please sign in to comment.