| Auto-Submit | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[maglev] Handle equal inputs in Float64Max/Min
A DCHECK failure left != right in macro-assembler-arm.cc was triggered
because the compiler was emitting Float64Max (or Min) nodes where both
inputs were the same register.
While Maglev generally avoids emitting these nodes if the inputs are
known to be equal, this case can still occur after unwrapping conversion
nodes during the phi untagging phase.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[riscv][maglev] Handle equal inputs in Float64Max/Min
Port commit 020934e177a8ffae9c978bbbfe8690e2697360f2
diff --git a/src/maglev/riscv/maglev-ir-riscv.cc b/src/maglev/riscv/maglev-ir-riscv.cc
index aabd02b..3d5438f 100644
--- a/src/maglev/riscv/maglev-ir-riscv.cc
+++ b/src/maglev/riscv/maglev-ir-riscv.cc
@@ -873,10 +873,19 @@
void Float64Min::SetValueLocationConstraints() {
UseRegister(LeftInput());
UseRegister(RightInput());
- DefineAsRegister(this);
+ if (LeftInput().node() == RightInput().node()) {
+ DefineSameAsFirst(this);
+ } else {
+ DefineAsRegister(this);
+ }
}
void Float64Min::GenerateCode(MaglevAssembler* masm,
const ProcessingState& state) {
+ if (LeftInput().node() == RightInput().node()) {
+ DCHECK_EQ(ToDoubleRegister(result()), ToDoubleRegister(LeftInput()));
+ return;
+ }
+
DoubleRegister left = ToDoubleRegister(LeftInput());
DoubleRegister right = ToDoubleRegister(RightInput());
DoubleRegister out = ToDoubleRegister(result());
@@ -887,11 +896,19 @@
void Float64Max::SetValueLocationConstraints() {
UseRegister(LeftInput());
UseRegister(RightInput());
- DefineAsRegister(this);
+ if (LeftInput().node() == RightInput().node()) {
+ DefineSameAsFirst(this);
+ } else {
+ DefineAsRegister(this);
+ }
}
void Float64Max::GenerateCode(MaglevAssembler* masm,
const ProcessingState& state) {
+ if (LeftInput().node() == RightInput().node()) {
+ DCHECK_EQ(ToDoubleRegister(result()), ToDoubleRegister(LeftInput()));
+ return;
+ }
DoubleRegister left = ToDoubleRegister(LeftInput());
DoubleRegister right = ToDoubleRegister(RightInput());
DoubleRegister out = ToDoubleRegister(result());
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[riscv][maglev] Handle equal inputs in Float64Max/Min
Port commit 020934e177a8ffae9c978bbbfe8690e2697360f2
Bug: 486530209
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |