mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-02 13:12:09 +00:00
[Hexagon] Properly handle instruction selection of vsplat intrinsics
llvm-svn: 269312
This commit is contained in:
parent
7a947b6c6d
commit
e60e5fee0a
@ -1044,11 +1044,12 @@ SDNode *HexagonDAGToDAGISel::SelectIntrinsicWOChain(SDNode *N) {
|
||||
return SelectCode(N);
|
||||
}
|
||||
|
||||
SDValue const &V = N->getOperand(1);
|
||||
SDValue V = N->getOperand(1);
|
||||
SDValue U;
|
||||
if (isValueExtension(V, Bits, U)) {
|
||||
SDValue R = CurDAG->getNode(N->getOpcode(), SDLoc(N), N->getValueType(0),
|
||||
N->getOperand(0), U);
|
||||
N->getOperand(0), U);
|
||||
ReplaceUses(N, R.getNode());
|
||||
return SelectCode(R.getNode());
|
||||
}
|
||||
return SelectCode(N);
|
||||
|
10
llvm/test/CodeGen/Hexagon/vsplat-isel.ll
Normal file
10
llvm/test/CodeGen/Hexagon/vsplat-isel.ll
Normal file
@ -0,0 +1,10 @@
|
||||
; RUN: llc -march=hexagon -O0 < %s | FileCheck %s
|
||||
; CHECK: vsplatb
|
||||
|
||||
declare i32 @llvm.hexagon.S2.vsplatrb(i32) #0
|
||||
|
||||
define i32 @foo(i8 %x) {
|
||||
%p0 = zext i8 %x to i32
|
||||
%p1 = tail call i32 @llvm.hexagon.S2.vsplatrb(i32 %p0)
|
||||
ret i32 %p1
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user