Alive2: https://alive2.llvm.org/ce/z/rPN1GB
Fixes: https://github.com/llvm/llvm-project/issues/62238
Depends on D150377
Signed-off-by: Jun Zhang <jun@junz.org>
Paths
| Differential D150378
[Instsimplfy] X == Y ? 0 : X - Y --> X - Y ClosedPublic Authored by junaire on May 11 2023, 8:47 AM.
Details Summary Alive2: https://alive2.llvm.org/ce/z/rPN1GB Depends on D150377 Signed-off-by: Jun Zhang <jun@junz.org>
Diff Detail
Event Timeline
Comment Actions
I updated the patch. The transform I wrote is based on my understanding of the code and I'm not super confident that's what you meant. Educate me please if it's wrong, thanks!
junaire marked an inline comment as done. Comment ActionsReplace simplifyInstructionWithOperands => Constant::getNullValue(Op0->getType()) Comment Actions LGTM I've clarified the preconditions for this function in https://github.com/llvm/llvm-project/commit/8d2bae8c227debdcd0632ce364c58883bd12ad84, so we can actually justify the transform.
This revision is now accepted and ready to land.May 16 2023, 2:55 AM This revision was landed with ongoing or failed builds.May 16 2023, 4:16 AM Closed by commit rGa47b56f4ef83: [Instsimplfy] X == Y ? 0 : X - Y --> X - Y (authored by junaire). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 522533 llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/select.ll
|
I think this can just return zero.