We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(a & !b) ? a : b
a | b
godbolt, alive
#include <stdbool.h> bool src(bool a, bool b) { return (a & !b) ? a : b; } bool tgt(bool a, bool b) { return a | b; }
define i1 @src(i1 %0, i1 %1){ %3 = xor i1 %1, true %4 = and i1 %3, %0 %5 = select i1 %4, i1 %0, i1 %1 ret i1 %5 } define i1 @tgt(i1 %0, i1 %1){ %3 = or i1 %0, %1 ret i1 %3 }
Note that the x864-64 backend is able to optimise src into tgt, but AArch64 and RISCV are not, so there is probably a missind DAG combine too
src
tgt
The text was updated successfully, but these errors were encountered:
@llvm/issue-subscribers-backend-aarch64
Sorry, something went wrong.
@llvm/issue-subscribers-backend-risc-v
Generalized transform: https://alive2.llvm.org/ce/z/x8ZSY9
Candidate patch: https://reviews.llvm.org/D158983
074f23e
dtcxzyw
No branches or pull requests
godbolt, alive
Note that the x864-64 backend is able to optimise
src
intotgt
, but AArch64 and RISCV are not, so there is probably a missind DAG combine tooThe text was updated successfully, but these errors were encountered: