[PATCH] D131378: [LoongArch] Add codegen support for bitreverse
WÁNG Xuěruì via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 10 00:41:20 PDT 2022
xen0n marked an inline comment as done.
xen0n added inline comments.
================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:88
+ setOperationAction(ISD::BITREVERSE, MVT::i32, Custom);
+ setOperationAction(ISD::BITREVERSE, MVT::i64, Legal);
+ } else {
----------------
SixWeining wrote:
> `Legal` is default. So we can omit it. And then we can omit the braces after `if` and before `else` since the body is simple. See [[ https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements | the coding standard ]].
>
> Same as below.
Unfortunately this seems not to be the case. If I remove both `Legal` setting then the operation gets expanded instead. See `lib/CodeGen/TargetLoweringBase.cpp:839`, it defaults to `Expand`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131378/new/
https://reviews.llvm.org/D131378
More information about the llvm-commits
mailing list