diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-24 10:01:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-24 10:01:32 -0700 |
| commit | e59effed3037701aadab11d4ea0ddddf2eedbf3b (patch) | |
| tree | 806abbeb804a9e25d08bf88e06182518bb532134 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 3226d723381a24118f6aaa73b096c8ef4510f189 (diff) | |
| parent | 711a6807a7979715d6b2940db56eaf1585d30a71 (diff) | |
| download | rust-e59effed3037701aadab11d4ea0ddddf2eedbf3b.tar.gz rust-e59effed3037701aadab11d4ea0ddddf2eedbf3b.zip | |
Rollup merge of #74491 - xldenis:constant-binop-opt, r=oli-obk
Optimize away BitAnd and BitOr when possible This PR lets `const_prop` optimize away `a | true == true` , `a & false == false` and `a * 0 = 0`. While I was writing this I've realized that constant propagation misses a lot of opportunities. For example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2a4b45e772f214210a36749b27223bb0 Constant propagation doesn't seem to... propagate constants, additionally the way constant propagation is currently setup makes it tricky to add cases like `a | false == a`. I tried to organize `eval_rvalue_with_identities` to make the pattern of the optimizations easier to see but it still obscurs what should be a simple peephole optmization. cc @oli-obk
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
