[llvm] [X86] Make ISD::ROTL/ROTR vector rotates legal on XOP+AVX512 targets (PR #184587)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 4 03:12:42 PST 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/lib/Target/X86/X86ISelLowering.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 2612befd7..b1344b255 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -1451,8 +1451,8 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
}
if (!Subtarget.useSoftFloat() && Subtarget.hasXOP()) {
- for (MVT VT : { MVT::v16i8, MVT::v8i16, MVT::v4i32, MVT::v2i64,
- MVT::v32i8, MVT::v16i16, MVT::v8i32, MVT::v4i64 }) {
+ for (MVT VT : {MVT::v16i8, MVT::v8i16, MVT::v4i32, MVT::v2i64, MVT::v32i8,
+ MVT::v16i16, MVT::v8i32, MVT::v4i64}) {
setOperationAction(ISD::ROTL, VT, VT.is128BitVector() ? Legal : Custom);
setOperationAction(ISD::ROTR, VT, Custom);
}
@@ -2035,8 +2035,8 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
setOperationAction(ISD::UMAX, VT, Legal);
setOperationAction(ISD::SMIN, VT, Legal);
setOperationAction(ISD::UMIN, VT, Legal);
- setOperationAction(ISD::ROTL, VT, Legal);
- setOperationAction(ISD::ROTR, VT, Legal);
+ setOperationAction(ISD::ROTL, VT, Legal);
+ setOperationAction(ISD::ROTR, VT, Legal);
setOperationAction(ISD::ABS, VT, Legal);
setOperationAction(ISD::CTPOP, VT, Custom);
}
@@ -2201,8 +2201,8 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
}
for (auto VT : { MVT::v4i32, MVT::v8i32, MVT::v2i64, MVT::v4i64 }) {
- setOperationAction(ISD::ROTL, VT, Legal);
- setOperationAction(ISD::ROTR, VT, Legal);
+ setOperationAction(ISD::ROTL, VT, Legal);
+ setOperationAction(ISD::ROTR, VT, Legal);
}
// Custom legalize 2x32 to get a little better code.
``````````
</details>
https://github.com/llvm/llvm-project/pull/184587
More information about the llvm-commits
mailing list