[llvm] r264285 - Remove unsafe AssertZext after promoting result of FP_TO_FP16
Pirama Arumuga Nainar via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 24 07:06:04 PDT 2016
Author: pirama
Date: Thu Mar 24 09:06:03 2016
New Revision: 264285
URL: http://llvm.org/viewvc/llvm-project?rev=264285&view=rev
Log:
Remove unsafe AssertZext after promoting result of FP_TO_FP16
Summary:
Some target lowerings of FP_TO_FP16, for instance ARM's vcvtb.f16.f32
instruction, do not guarantee that the top 16 bits are zeroed out.
Remove the unsafe AssertZext and add tests to exercise this.
Reviewers: jmolloy, sbaranga, kristof.beyls, aadg
Subscribers: llvm-commits, srhines, aemerson
Differential Revision: http://reviews.llvm.org/D18426
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/trunk/test/CodeGen/ARM/fp16-v3.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=264285&r1=264284&r2=264285&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Thu Mar 24 09:06:03 2016
@@ -436,10 +436,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
SDLoc dl(N);
- SDValue Res = DAG.getNode(N->getOpcode(), dl, NVT, N->getOperand(0));
-
- return DAG.getNode(ISD::AssertZext, dl,
- NVT, Res, DAG.getValueType(N->getValueType(0)));
+ return DAG.getNode(N->getOpcode(), dl, NVT, N->getOperand(0));
}
SDValue DAGTypeLegalizer::PromoteIntRes_INT_EXTEND(SDNode *N) {
Modified: llvm/trunk/test/CodeGen/ARM/fp16-v3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fp16-v3.ll?rev=264285&r1=264284&r2=264285&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/fp16-v3.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/fp16-v3.ll Thu Mar 24 09:06:03 2016
@@ -25,4 +25,16 @@ define void @test_vec3(<3 x half>* %arr,
ret void
}
+; CHECK-LABEL: test_bitcast:
+; CHECK: vcvtb.f16.f32
+; CHECK: vcvtb.f16.f32
+; CHECK: vcvtb.f16.f32
+; CHECK: pkhbt
+; CHECK: uxth
+define void @test_bitcast(<3 x half> %inp, <3 x i16>* %arr) #0 {
+ %bc = bitcast <3 x half> %inp to <3 x i16>
+ store <3 x i16> %bc, <3 x i16>* %arr, align 8
+ ret void
+}
+
attributes #0 = { nounwind }
More information about the llvm-commits
mailing list