summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-02-07 16:57:32 +0000
committerdim <dim@FreeBSD.org>2015-02-07 16:57:32 +0000
commitd8becb12b692dbea7b5074dd77148b5a8a69e067 (patch)
tree59e4079560ab70cc9ca1dffb1bff26401df9a68d /contrib/llvm/lib
parent4d7b22214a73e6525167fa763c3071890ee5387d (diff)
downloadFreeBSD-src-d8becb12b692dbea7b5074dd77148b5a8a69e067.zip
FreeBSD-src-d8becb12b692dbea7b5074dd77148b5a8a69e067.tar.gz
Back out r278349 and r278350 for now, since this apparently blows up the
kernel build in sys/dev/hptmv/hptproc.c for some people. Reported by: sbruno, Matthew Fuller <fullermd@over-yonder.net>
Diffstat (limited to 'contrib/llvm/lib')
-rw-r--r--contrib/llvm/lib/Target/X86/X86FastISel.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/contrib/llvm/lib/Target/X86/X86FastISel.cpp b/contrib/llvm/lib/Target/X86/X86FastISel.cpp
index 14084c6..ae3eea4 100644
--- a/contrib/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/contrib/llvm/lib/Target/X86/X86FastISel.cpp
@@ -2699,9 +2699,6 @@ bool X86FastISel::FastLowerCall(CallLoweringInfo &CLI) {
TM.Options.GuaranteedTailCallOpt))
return false;
- SmallVector<MVT, 16> OutVTs;
- SmallVector<unsigned, 16> ArgRegs;
-
// If this is a constant i1/i8/i16 argument, promote to i32 to avoid an extra
// instruction. This is safe because it is common to all FastISel supported
// calling conventions on x86.
@@ -2719,34 +2716,28 @@ bool X86FastISel::FastLowerCall(CallLoweringInfo &CLI) {
// Passing bools around ends up doing a trunc to i1 and passing it.
// Codegen this as an argument + "and 1".
- MVT VT;
- auto *TI = dyn_cast<TruncInst>(Val);
- unsigned ResultReg;
- if (TI && TI->getType()->isIntegerTy(1) && CLI.CS &&
- (TI->getParent() == CLI.CS->getInstruction()->getParent()) &&
- TI->hasOneUse()) {
- Value *PrevVal = TI->getOperand(0);
- ResultReg = getRegForValue(PrevVal);
-
- if (!ResultReg)
- return false;
+ if (auto *TI = dyn_cast<TruncInst>(Val)) {
+ if (TI->getType()->isIntegerTy(1) && CLI.CS &&
+ (TI->getParent() == CLI.CS->getInstruction()->getParent()) &&
+ TI->hasOneUse()) {
+ Val = cast<TruncInst>(Val)->getOperand(0);
+ unsigned ResultReg = getRegForValue(Val);
+
+ if (!ResultReg)
+ return false;
- if (!isTypeLegal(PrevVal->getType(), VT))
- return false;
+ MVT ArgVT;
+ if (!isTypeLegal(Val->getType(), ArgVT))
+ return false;
- ResultReg =
- FastEmit_ri(VT, VT, ISD::AND, ResultReg, hasTrivialKill(PrevVal), 1);
+ ResultReg =
+ FastEmit_ri(ArgVT, ArgVT, ISD::AND, ResultReg, Val->hasOneUse(), 1);
- if (!ResultReg)
- return false;
- } else {
- if (!isTypeLegal(Val->getType(), VT))
- return false;
- ResultReg = getRegForValue(Val);
+ if (!ResultReg)
+ return false;
+ UpdateValueMap(Val, ResultReg);
+ }
}
-
- ArgRegs.push_back(ResultReg);
- OutVTs.push_back(VT);
}
// Analyze operands of the call, assigning locations to each operand.
@@ -2758,6 +2749,13 @@ bool X86FastISel::FastLowerCall(CallLoweringInfo &CLI) {
if (IsWin64)
CCInfo.AllocateStack(32, 8);
+ SmallVector<MVT, 16> OutVTs;
+ for (auto *Val : OutVals) {
+ MVT VT;
+ if (!isTypeLegal(Val->getType(), VT))
+ return false;
+ OutVTs.push_back(VT);
+ }
CCInfo.AnalyzeCallOperands(OutVTs, OutFlags, CC_X86);
// Get a count of how many bytes are to be pushed on the stack.
@@ -2779,7 +2777,9 @@ bool X86FastISel::FastLowerCall(CallLoweringInfo &CLI) {
if (ArgVT == MVT::x86mmx)
return false;
- unsigned ArgReg = ArgRegs[VA.getValNo()];
+ unsigned ArgReg = getRegForValue(ArgVal);
+ if (!ArgReg)
+ return false;
// Promote the value if needed.
switch (VA.getLocInfo()) {
OpenPOWER on IntegriCloud