-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Commit e6c2e12
cmd/compile/internal/ssa: optimise more branches with zero on riscv64
Optimise more branches with zero on riscv64. In particular, BLTU with
zero occurs with IsInBounds checks for index zero. This currently results
in two instructions and requires an additional register:
li t2, 0
bltu t2, t1, 0x174b4
This is equivalent to checking if the bounds is not equal to zero. With
this change:
bnez t1, 0x174c0
This removes more than 500 instructions from the Go binary on riscv64.
Change-Id: I6cd861d853e3ef270bd46dacecdfaa205b1c4644
Reviewed-on: https://go-review.googlesource.com/c/go/+/606715
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>1 parent cfc784a commit e6c2e12
File tree
3 files changed
+44
-8
lines changed- src/cmd/compile/internal/ssa
- _gen
- test/codegen
3 files changed
+44
-8
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
558 | 558 |
| |
559 | 559 |
| |
560 | 560 |
| |
561 | - | ||
562 | - | ||
563 | - | ||
564 | - | ||
565 | - | ||
566 | - | ||
567 | - | ||
568 | - | ||
561 | + | ||
562 | + | ||
563 | + | ||
564 | + | ||
565 | + | ||
566 | + | ||
567 | + | ||
568 | + | ||
569 | + | ||
570 | + | ||
569 | 571 |
| |
570 | 572 |
| |
571 | 573 |
| |
|
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
241 | 241 |
| |
242 | 242 |
| |
243 | 243 |
| |
244 | + | ||
245 | + | ||
246 | + | ||
247 | + | ||
248 | + | ||
249 | + | ||
250 | + | ||
251 | + | ||
252 | + | ||
253 | + | ||
244 | 254 |
|
0 commit comments