forked from OSchip/llvm-project
[Float2Int] Don't operate on vector instructions
This fixes a crash bug. It's also not clear if we'd want to do this transform for vectors. llvm-svn: 255155
This commit is contained in:
parent
c3826da895
commit
54ade23504
|
@ -131,6 +131,8 @@ static Instruction::BinaryOps mapBinOpcode(unsigned Opcode) {
|
||||||
// integer domain.
|
// integer domain.
|
||||||
void Float2Int::findRoots(Function &F, SmallPtrSet<Instruction*,8> &Roots) {
|
void Float2Int::findRoots(Function &F, SmallPtrSet<Instruction*,8> &Roots) {
|
||||||
for (auto &I : instructions(F)) {
|
for (auto &I : instructions(F)) {
|
||||||
|
if (isa<VectorType>(I.getType()))
|
||||||
|
continue;
|
||||||
switch (I.getOpcode()) {
|
switch (I.getOpcode()) {
|
||||||
default: break;
|
default: break;
|
||||||
case Instruction::FPToUI:
|
case Instruction::FPToUI:
|
||||||
|
|
|
@ -254,3 +254,13 @@ define i32 @neg_calluser(i32 %value) {
|
||||||
ret i32 %7
|
ret i32 %7
|
||||||
}
|
}
|
||||||
declare double @g(double)
|
declare double @g(double)
|
||||||
|
|
||||||
|
; CHECK-LABEL: @neg_vector
|
||||||
|
; CHECK: %1 = uitofp <4 x i8> %a to <4 x float>
|
||||||
|
; CHECK: %2 = fptoui <4 x float> %1 to <4 x i16>
|
||||||
|
; CHECK: ret <4 x i16> %2
|
||||||
|
define <4 x i16> @neg_vector(<4 x i8> %a) {
|
||||||
|
%1 = uitofp <4 x i8> %a to <4 x float>
|
||||||
|
%2 = fptoui <4 x float> %1 to <4 x i16>
|
||||||
|
ret <4 x i16> %2
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue