From 2f2afc1aae898651e26987a5c71f3febb19bca98 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Sun, 21 Mar 2010 10:49:05 +0000 Subject: Update LLVM to r99115. --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp') diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 3d9a4d5..12096b9 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -1675,11 +1675,10 @@ bool SelectionDAGBuilder::handleJTSwitchCase(CaseRec& CR, } } - // Create a jump table index for this jump table, or return an existing - // one. + // Create a jump table index for this jump table. unsigned JTEncoding = TLI.getJumpTableEncoding(); unsigned JTI = CurMF->getOrCreateJumpTableInfo(JTEncoding) - ->getJumpTableIndex(DestBBs); + ->createJumpTableIndex(DestBBs); // Set the jump table information so that we can codegen it as a second // MachineBasicBlock @@ -2592,6 +2591,11 @@ void SelectionDAGBuilder::visitGetElementPtr(User &I) { } Ty = StTy->getElementType(Field); + } else if (const UnionType *UnTy = dyn_cast(Ty)) { + unsigned Field = cast(Idx)->getZExtValue(); + + // Offset canonically 0 for unions, but type changes + Ty = UnTy->getElementType(Field); } else { Ty = cast(Ty)->getElementType(); @@ -4277,6 +4281,9 @@ isInTailCallPosition(CallSite CS, Attributes CalleeRetAttr, --BBI) { if (&*BBI == I) break; + // Debug info intrinsics do not get in the way of tail call optimization. + if (isa(BBI)) + continue; if (BBI->mayHaveSideEffects() || BBI->mayReadFromMemory() || !BBI->isSafeToSpeculativelyExecute()) return false; -- cgit v1.1