llvm-project/llvm/lib/Target/M68k
Douglas Chen 78b16ccf2b [M68k] Instruction selection to choose neg x when mul x -1 (Fix issue 48588)
This patch is trying to fix issue 48588(https://github.com/llvm/llvm-project/issues/48588)

I found the results of Instruction Selection between SelectionDAG and FastISEL for the `%mul = mul i32 %A, 4294967295`:
(seldag-isel) mul --> sub --> SUB32dp
(fast-isel)   mul --> sub --> NEG32d

My patch to fix this issue is by overriding a virtual function M68kDAGToDAGISel::IsProfitableToFold(). Return `false` when it was trying to match with SUB, then it will match with NEG.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D116886
2022-06-03 13:20:30 +08:00
..
AsmParser [M68k] Add missing include 2022-02-11 10:17:39 +00:00
Disassembler [M68k][Disassembler] Cleanup unused variables. NFC 2022-05-21 17:23:51 -07:00
GISel Fix M68k missing header errors. 2022-03-10 13:18:20 +00:00
MCTargetDesc [M68k] Remove unused variable to fix MSVC warning. NFC. 2022-05-30 08:59:49 +01:00
TargetInfo [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
CMakeLists.txt [TableGen] Remove code beads 2022-05-30 14:27:37 +08:00
M68k.h [M68k][NFC] Add missing #endif comment 2022-01-12 13:07:57 +08:00
M68k.td [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kAsmPrinter.cpp [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kAsmPrinter.h [M68k][NFC] Add missing #endif comment 2022-01-12 13:07:57 +08:00
M68kCallingConv.h [M68k][NFC] Add missing #endif comment 2022-01-12 13:07:57 +08:00
M68kCallingConv.td
M68kCollapseMOVEMPass.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
M68kExpandPseudo.cpp [Target] use getSubtarget<> instead of static_cast<>(getSubtarget()) 2022-05-26 11:22:41 -07:00
M68kFrameLowering.cpp [M68k][NFC] Use Register instead of unsigned int 2022-01-13 15:49:39 +08:00
M68kFrameLowering.h [M68k][NFC] Add missing #endif comment 2022-01-12 13:07:57 +08:00
M68kISelDAGToDAG.cpp [M68k] Instruction selection to choose neg x when mul x -1 (Fix issue 48588) 2022-06-03 13:20:30 +08:00
M68kISelLowering.cpp Target: Use getPointerSizeInBits instead of 8 * getPointerSize 2022-03-31 18:49:23 -04:00
M68kISelLowering.h m68k: Support bit shifts on 64-bit integers 2022-02-12 06:11:49 +08:00
M68kInstrArithmetic.td [M68k][Disassembler] Fix decoding conflict 2022-05-19 09:10:50 +08:00
M68kInstrBits.td [M68k] Adopt VarLenCodeEmitter for bits instructions 2022-02-17 14:16:19 -08:00
M68kInstrBuilder.h [NFC] Fix endif comments to match with include guard 2022-01-07 15:52:59 +08:00
M68kInstrCompiler.td [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kInstrControl.td Revert "Revert "[M68k] Adopt VarLenCodeEmitter for control instructions"" 2022-02-16 17:41:49 +08:00
M68kInstrData.td [M68k][Disassembler] Fix decoding conflict 2022-05-22 10:35:12 +08:00
M68kInstrFormats.td [M68k] Adopt VarLenCodeEmitter for move instructions 2022-04-04 23:02:27 -07:00
M68kInstrInfo.cpp [TableGen] Remove code beads 2022-05-30 14:27:37 +08:00
M68kInstrInfo.h [M68k][NFC] Add missing #endif comment 2022-01-12 13:07:57 +08:00
M68kInstrInfo.td [M68k] Adopt VarLenCodeEmitter for move instructions 2022-04-04 23:02:27 -07:00
M68kInstrShiftRotate.td [M68k] Adopt VarLenCodeEmitter for shift / rotate instructions 2022-04-03 22:52:32 -07:00
M68kMCInstLower.cpp [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kMCInstLower.h [M68k][NFC] Add missing #endif comment 2022-01-12 13:07:57 +08:00
M68kMachineFunction.cpp [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kMachineFunction.h [NFC] Fix endif comments to match with include guard 2022-01-07 15:52:59 +08:00
M68kRegisterInfo.cpp Fix M68k missing header errors. 2022-03-10 13:18:20 +00:00
M68kRegisterInfo.h m68k: Support bit shifts on 64-bit integers 2022-02-12 06:11:49 +08:00
M68kRegisterInfo.td [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kSchedule.td [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kSubtarget.cpp [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kSubtarget.h [nfc][codegen] Move RegisterBank[Info].h under CodeGen 2022-03-01 21:53:25 -08:00
M68kTargetMachine.cpp [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kTargetMachine.h [M68k][NFC] Add missing #endif comment 2022-01-12 13:07:57 +08:00
M68kTargetObjectFile.cpp [M68k][NFC] Fix file header 2022-01-04 10:14:01 +08:00
M68kTargetObjectFile.h [M68k][NFC] Add missing #endif comment 2022-01-12 13:07:57 +08:00