Skip to content

Commit 169f653

Browse files
committed
Add the optimization in a few other methods
1 parent 0bef456 commit 169f653

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/builder.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,22 +871,26 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
871871

872872
fn fadd_fast(&mut self, lhs: RValue<'gcc>, rhs: RValue<'gcc>) -> RValue<'gcc> {
873873
// NOTE: it seems like we cannot enable fast-mode for a single operation in GCC.
874-
set_rvalue_location(self, lhs + rhs)
874+
let result = set_rvalue_location(self, lhs + rhs);
875+
self.assign_to_var(result)
875876
}
876877

877878
fn fsub_fast(&mut self, lhs: RValue<'gcc>, rhs: RValue<'gcc>) -> RValue<'gcc> {
878879
// NOTE: it seems like we cannot enable fast-mode for a single operation in GCC.
879-
set_rvalue_location(self, lhs - rhs)
880+
let result = set_rvalue_location(self, lhs - rhs);
881+
self.assign_to_var(result)
880882
}
881883

882884
fn fmul_fast(&mut self, lhs: RValue<'gcc>, rhs: RValue<'gcc>) -> RValue<'gcc> {
883885
// NOTE: it seems like we cannot enable fast-mode for a single operation in GCC.
884-
set_rvalue_location(self, lhs * rhs)
886+
let result = set_rvalue_location(self, lhs * rhs);
887+
self.assign_to_var(result)
885888
}
886889

887890
fn fdiv_fast(&mut self, lhs: RValue<'gcc>, rhs: RValue<'gcc>) -> RValue<'gcc> {
888891
// NOTE: it seems like we cannot enable fast-mode for a single operation in GCC.
889-
set_rvalue_location(self, lhs / rhs)
892+
let result = set_rvalue_location(self, lhs / rhs);
893+
self.assign_to_var(result)
890894
}
891895

892896
fn frem_fast(&mut self, lhs: RValue<'gcc>, rhs: RValue<'gcc>) -> RValue<'gcc> {

0 commit comments

Comments
 (0)