mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
R600: Remove AMDILPeeopholeOptimizer and replace optimizations with tablegen patterns
The BFE optimization was the only one we were actually using, and it was emitting an intrinsic that we don't support. https://bugs.freedesktop.org/show_bug.cgi?id=64201 Reviewed-by: Christian König <christian.koenig@amd.com> NOTE: This is a candidate for the 3.3 branch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -284,6 +284,17 @@ class SHA256MaPattern <Instruction BFI_INT, Instruction XOR> : Pat <
|
||||
(BFI_INT (XOR i32:$x, i32:$y), i32:$z, i32:$y)
|
||||
>;
|
||||
|
||||
// Bitfield extract patterns
|
||||
|
||||
def legalshift32 : ImmLeaf <i32, [{return Imm >=0 && Imm < 32;}]>;
|
||||
def bfemask : PatLeaf <(imm), [{return isMask_32(N->getZExtValue());}],
|
||||
SDNodeXForm<imm, [{ return CurDAG->getTargetConstant(CountTrailingOnes_32(N->getZExtValue()), MVT::i32);}]>>;
|
||||
|
||||
class BFEPattern <Instruction BFE> : Pat <
|
||||
(and (srl i32:$x, legalshift32:$y), bfemask:$z),
|
||||
(BFE $x, $y, $z)
|
||||
>;
|
||||
|
||||
include "R600Instructions.td"
|
||||
|
||||
include "SIInstrInfo.td"
|
||||
|
Reference in New Issue
Block a user