Commit f261f14
authored
[SelectionDAG][RISCV] Teach computeKnownBits to use range metadata for atomic_load. (llvm#137119)
And teach SelectionDAGBuilder to get the range metadata in
visitAtomicLoad.
This allows us to recognize that sign extending a byte load of a
boolean value from memory will produce zeros for the extended bits.
This allow us to remove an AND on RISC-V.
Tests copied from llvm#136502 with range metadata added to i1 cases.
Some of the test effects overlap with llvm#136502, but that patch can't
handle the acquire or seq_cst cases with the Zalasr extension. We
only have sign extending versions of those loads.1 parent c8dc3ed commit f261f14
File tree
3 files changed
+1403
-11
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/RISCV
3 files changed
+1403
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4382 | 4382 | | |
4383 | 4383 | | |
4384 | 4384 | | |
| 4385 | + | |
| 4386 | + | |
| 4387 | + | |
| 4388 | + | |
| 4389 | + | |
| 4390 | + | |
| 4391 | + | |
| 4392 | + | |
| 4393 | + | |
| 4394 | + | |
| 4395 | + | |
| 4396 | + | |
| 4397 | + | |
| 4398 | + | |
| 4399 | + | |
| 4400 | + | |
| 4401 | + | |
| 4402 | + | |
| 4403 | + | |
| 4404 | + | |
| 4405 | + | |
| 4406 | + | |
| 4407 | + | |
| 4408 | + | |
| 4409 | + | |
| 4410 | + | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
| 4415 | + | |
| 4416 | + | |
| 4417 | + | |
| 4418 | + | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
4385 | 4422 | | |
4386 | 4423 | | |
4387 | 4424 | | |
| |||
4407 | 4444 | | |
4408 | 4445 | | |
4409 | 4446 | | |
4410 | | - | |
4411 | | - | |
| 4447 | + | |
4412 | 4448 | | |
4413 | 4449 | | |
4414 | 4450 | | |
4415 | 4451 | | |
4416 | 4452 | | |
4417 | | - | |
4418 | | - | |
4419 | | - | |
4420 | | - | |
4421 | | - | |
4422 | | - | |
4423 | | - | |
4424 | | - | |
| 4453 | + | |
4425 | 4454 | | |
4426 | 4455 | | |
4427 | 4456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5150 | 5150 | | |
5151 | 5151 | | |
5152 | 5152 | | |
| 5153 | + | |
5153 | 5154 | | |
5154 | 5155 | | |
5155 | | - | |
| 5156 | + | |
5156 | 5157 | | |
5157 | 5158 | | |
5158 | 5159 | | |
| |||
0 commit comments