[llvm-dev] Canonicalizing conditional loads
Diogo Sampaio via llvm-dev
llvm-dev at lists.llvm.org
Wed Aug 18 13:45:42 PDT 2021
Hi,
our target machine has conditional (predicated) load instructions. However it is hard to generate at dag-select
as clang emits conditional branches to avoid performing the load in most cases.
e.g.:https://godbolt.org/z/ohKTnqeqz
All these functions perform the same thing, but only the first one does not add a conditional branch instruction.
Is there a way to tell clang to always generate the code as the first function, or perhaps a llvm pass that converts
the conditional branch/load into a select or hoists the load before/after the branch, also using a select?
If not, would anyone else be interested in such thing? Any ideas for which would be the best solution?
Regards,
Diogo Sampaio
More information about the llvm-dev
mailing list