[PATCH] D67799: [InstCombine] Fold a shifty implementation of clamp-to-zero.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 23 06:31:47 PDT 2019
lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.
Thanks, looks good to me.
`-march=znver2` numbers somewhat both regress and improve, but there is no znver2 sched model in llvm trunk, so that is some default sched model.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1927-1929
+ // and(ashr(subNSW(X, V), ScalarSizeInBits -1), V) --> V s> X ? V : 0.
+ {
+ Value *X, *V;
----------------
Super pedantic: can we streamline the variables here?
How about
```
// and(ashr(subNSW(Y, X), (ScalarSizeInBits(Y)-1)), X) --> X s> Y ? X : 0.
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67799/new/
https://reviews.llvm.org/D67799
More information about the llvm-commits
mailing list