[llvm] r215190 - [pr19635] Revert most of r170537, and add new testcase.
Patrik Hagglund
patrik.h.hagglund at ericsson.com
Fri Aug 8 01:21:19 PDT 2014
Author: patha
Date: Fri Aug 8 03:21:19 2014
New Revision: 215190
URL: http://llvm.org/viewvc/llvm-project?rev=215190&view=rev
Log:
[pr19635] Revert most of r170537, and add new testcase.
Patch provided by Andrey Kuharev.
Sorry, r170537 was obviously wrong.
Added:
llvm/trunk/test/CodeGen/X86/return_zeroext_i2.ll
Modified:
llvm/trunk/include/llvm/Target/TargetLowering.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.h
Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=215190&r1=215189&r2=215190&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Fri Aug 8 03:21:19 2014
@@ -2329,9 +2329,9 @@ public:
/// all the time, e.g. i1 on x86-64. It is also not necessary for non-C
/// calling conventions. The frontend should handle this and include all of
/// the necessary information.
- virtual MVT getTypeForExtArgOrReturn(MVT VT,
+ virtual EVT getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT,
ISD::NodeType /*ExtendKind*/) const {
- MVT MinVT = getRegisterType(MVT::i32);
+ EVT MinVT = getRegisterType(Context, MVT::i32);
return VT.bitsLT(MinVT) ? MinVT : VT;
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=215190&r1=215189&r2=215190&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Fri Aug 8 03:21:19 2014
@@ -1244,7 +1244,7 @@ void SelectionDAGBuilder::visitRet(const
ExtendKind = ISD::ZERO_EXTEND;
if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger())
- VT = TLI->getTypeForExtArgOrReturn(VT.getSimpleVT(), ExtendKind);
+ VT = TLI->getTypeForExtArgOrReturn(*DAG.getContext(), VT, ExtendKind);
unsigned NumParts = TLI->getNumRegisters(*DAG.getContext(), VT);
MVT PartVT = TLI->getRegisterType(*DAG.getContext(), VT);
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=215190&r1=215189&r2=215190&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Aug 8 03:21:19 2014
@@ -2062,8 +2062,8 @@ bool X86TargetLowering::isUsedByReturnOn
return true;
}
-MVT
-X86TargetLowering::getTypeForExtArgOrReturn(MVT VT,
+EVT
+X86TargetLowering::getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT,
ISD::NodeType ExtendKind) const {
MVT ReturnMVT;
// TODO: Is this also valid on 32-bit?
@@ -2072,7 +2072,7 @@ X86TargetLowering::getTypeForExtArgOrRet
else
ReturnMVT = MVT::i32;
- MVT MinVT = getRegisterType(ReturnMVT);
+ EVT MinVT = getRegisterType(Context, ReturnMVT);
return VT.bitsLT(MinVT) ? MinVT : VT;
}
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=215190&r1=215189&r2=215190&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Fri Aug 8 03:21:19 2014
@@ -940,7 +940,7 @@ namespace llvm {
bool mayBeEmittedAsTailCall(CallInst *CI) const override;
- MVT getTypeForExtArgOrReturn(MVT VT,
+ EVT getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT,
ISD::NodeType ExtendKind) const override;
bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
Added: llvm/trunk/test/CodeGen/X86/return_zeroext_i2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/return_zeroext_i2.ll?rev=215190&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/return_zeroext_i2.ll (added)
+++ llvm/trunk/test/CodeGen/X86/return_zeroext_i2.ll Fri Aug 8 03:21:19 2014
@@ -0,0 +1,7 @@
+; RUN: llc -mtriple=i386-pc-win32 < %s | FileCheck %s
+; Check that the testcase does not crash
+define zeroext i2 @crash () {
+ ret i2 0
+}
+; CHECK: xorl %eax, %eax
+; CHECK-NEXT: retl
More information about the llvm-commits
mailing list