-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Closed
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:SelectionDAGSelectionDAGISel as wellSelectionDAGISel as wellllvm:adt
Description
-
Move implementations from SelectionDAG.cpp FoldValue into APInt.h APIntOps
llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Lines 6012 to 6016 in deff460
case ISD::MULHS: { unsigned FullWidth = C1.getBitWidth() * 2; APInt C1Ext = C1.sext(FullWidth); APInt C2Ext = C2.sext(FullWidth); return (C1Ext * C2Ext).extractBits(C1.getBitWidth(), C1.getBitWidth());
llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Lines 6018 to 6022 in deff460
case ISD::MULHU: { unsigned FullWidth = C1.getBitWidth() * 2; APInt C1Ext = C1.zext(FullWidth); APInt C2Ext = C2.zext(FullWidth); return (C1Ext * C2Ext).extractBits(C1.getBitWidth(), C1.getBitWidth()); -
Add APIntTest unit test coverage
-
Update DivisionByConstantTest.cpp (this might require the lhs/rhs operands to be extended to the same bitwidth)
-
Update KnownBitsTest.cpp to use APIntOps::mulhs/u in exhaustive tests
-
Update mlir ArithOps.cpp + SPIRVCanonicalization.cpp to use APIntOps::mulhs/mulhu
Metadata
Metadata
Assignees
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:SelectionDAGSelectionDAGISel as wellSelectionDAGISel as wellllvm:adt