[PATCH] D113937: [RISCV] Override TargetLowering::hasAndNot for Zbb.
Jessica Clarke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 15 13:42:22 PST 2021
jrtc27 added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1115-1118
+ if (!Subtarget.hasStdExtZbb())
+ return false;
+
+ return !isa<ConstantSDNode>(Y);
----------------
Might possibly make more sense to write as:
```
if (Subtarget.hasStdExtZbb() && isa<ConstantSDNode>(Y))
return true;
return false;
```
depending on how this will be extended in future (e.g. with vector support?)
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1118
+
+ return !isa<ConstantSDNode>(Y);
+}
----------------
I think your code size regressions come from this not using Y.getNode()? SDValue is never a ConstantSDNode, so for Zbb this always returns true.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113937/new/
https://reviews.llvm.org/D113937
More information about the llvm-commits
mailing list