[llvm] [X86][CodeGen] Fix crash when commute operands of Instruction for code size (PR #79245)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 24 00:44:47 PST 2024
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 71d64ed80f8b7556be6954b2c4d663c7d89f476d aa659f1e14d015d52c4ce38c95fd05c05f7449a9 -- llvm/lib/Target/X86/X86InstrInfo.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 26a8d0ba0c..2bfb180498 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -2326,7 +2326,8 @@ MachineInstr *X86InstrInfo::commuteInstructionImpl(MachineInstr &MI, bool NewMI,
case X86::VBLENDPSrri:
// If we're optimizing for size, try to use MOVSD/MOVSS.
if (MI.getParent()->getParent()->getFunction().hasOptSize()) {
- unsigned Mask = (Opc == X86::BLENDPDrri || Opc == X86::VBLENDPDrri) ? 0x03: 0x0F;
+ unsigned Mask =
+ (Opc == X86::BLENDPDrri || Opc == X86::VBLENDPDrri) ? 0x03 : 0x0F;
if ((MI.getOperand(3).getImm() ^ Mask) == 1) {
#define FROM_TO(A, B) \
case X86::A: \
@@ -2335,10 +2336,10 @@ MachineInstr *X86InstrInfo::commuteInstructionImpl(MachineInstr &MI, bool NewMI,
switch (Opc) {
default:
llvm_unreachable("Unreachable!");
- FROM_TO(BLENDPDrri, MOVSDrr)
- FROM_TO(BLENDPSrri, MOVSSrr)
- FROM_TO(VBLENDPDrri, VMOVSDrr)
- FROM_TO(VBLENDPSrri, VMOVSSrr)
+ FROM_TO(BLENDPDrri, MOVSDrr)
+ FROM_TO(BLENDPSrri, MOVSSrr)
+ FROM_TO(VBLENDPDrri, VMOVSDrr)
+ FROM_TO(VBLENDPSrri, VMOVSSrr)
}
WorkingMI = CloneIfNew(MI);
WorkingMI->setDesc(get(Opc));
``````````
</details>
https://github.com/llvm/llvm-project/pull/79245
More information about the llvm-commits
mailing list