From craig.topper at gmail.com Mon Nov 14 00:46:21 2011 From: craig.topper at gmail.com (Craig Topper) Date: Mon, 14 Nov 2011 06:46:21 -0000 Subject: [llvm-commits] [llvm] r144522 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86InstrSSE.td Message-ID: <20111114064621.5825B2A6C131@llvm.org> Author: ctopper Date: Mon Nov 14 00:46:21 2011 New Revision: 144522 URL: http://llvm.org/viewvc/llvm-project?rev=144522&view=rev Log: Add neverHasSideEffects, mayLoad, and mayStore to many patternless SSE/AVX instructions. Remove MMX check from LowerVECTOR_SHUFFLE since MMX vector types won't go through it anyway. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=144522&r1=144521&r2=144522&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Nov 14 00:46:21 2011 @@ -6623,7 +6623,6 @@ EVT VT = Op.getValueType(); DebugLoc dl = Op.getDebugLoc(); unsigned NumElems = VT.getVectorNumElements(); - bool isMMX = VT.getSizeInBits() == 64; bool V1IsUndef = V1.getOpcode() == ISD::UNDEF; bool V2IsUndef = V2.getOpcode() == ISD::UNDEF; bool V1IsSplat = false; @@ -6632,9 +6631,7 @@ MachineFunction &MF = DAG.getMachineFunction(); bool OptForSize = MF.getFunction()->hasFnAttr(Attribute::OptimizeForSize); - // Shuffle operations on MMX not supported. - if (isMMX) - return Op; + assert(VT.getSizeInBits() != 64 && "Can't lower MMX shuffles"); // Vector shuffle lowering takes 3 steps: // @@ -6646,7 +6643,7 @@ // so the shuffle can be broken into other shuffles and the legalizer can // try the lowering again. // - // The general ideia is that no vector_shuffle operation should be left to + // The general idea is that no vector_shuffle operation should be left to // be matched during isel, all of them must be converted to a target specific // node here. Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=144522&r1=144521&r2=144522&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Nov 14 00:46:21 2011 @@ -80,8 +80,9 @@ multiclass sse12_fp_packed_logical_rm opc, RegisterClass RC, Domain d, string OpcodeStr, X86MemOperand x86memop, list pat_rr, list pat_rm, - bit Is2Addr = 1> { - let isCommutable = 1 in + bit Is2Addr = 1, + bit rr_hasSideEffects = 0> { + let isCommutable = 1, neverHasSideEffects = rr_hasSideEffects in def rr : PI, TB, VEX_4V; + (memopv2i64 addr:$src2)))], 0, 1>, TB, VEX_4V; defm V#NAME#PD : sse12_fp_packed_logical_rm opc, string OpcodeStr> { + let neverHasSideEffects = 1 in { def SDr : SDI; + let mayLoad = 1 in def SDm : SDI; + } def SDm_Int : SDI; // PSRADQri doesn't exist in SSE[1-3]. - } - def PANDNrr : PDI<0xDF, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "pandn\t{$src2, $dst|$dst, $src2}", []>; + def PANDNrr : PDI<0xDF, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), + "pandn\t{$src2, $dst|$dst, $src2}", []>; - def PANDNrm : PDI<0xDF, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2), - "pandn\t{$src2, $dst|$dst, $src2}", []>; + let mayLoad = 1 in + def PANDNrm : PDI<0xDF, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2), + "pandn\t{$src2, $dst|$dst, $src2}", []>; + } } } // Constraints = "$src1 = $dst" @@ -5348,6 +5353,7 @@ //===---------------------------------------------------------------------===// multiclass ssse3_palign { + let neverHasSideEffects = 1 in { def R128rr : SS3AI<0x0F, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2, i8imm:$src3), !if(Is2Addr, @@ -5355,6 +5361,7 @@ !strconcat(asm, "\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}")), []>, OpSize; + let mayLoad = 1 in def R128rm : SS3AI<0x0F, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2, i8imm:$src3), !if(Is2Addr, @@ -5362,19 +5369,23 @@ !strconcat(asm, "\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}")), []>, OpSize; + } } multiclass ssse3_palign_y { + let neverHasSideEffects = 1 in { def R256rr : SS3AI<0x0F, MRMSrcReg, (outs VR256:$dst), (ins VR256:$src1, VR256:$src2, i8imm:$src3), !strconcat(asm, "\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"), []>, OpSize; + let mayLoad = 1 in def R256rm : SS3AI<0x0F, MRMSrcMem, (outs VR256:$dst), (ins VR256:$src1, i256mem:$src2, i8imm:$src3), !strconcat(asm, "\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"), []>, OpSize; + } } let Predicates = [HasAVX] in @@ -5721,6 +5732,7 @@ "\t{$src2, $src1, $dst|$dst, $src1, $src2}"), [(set GR32:$dst, (X86pextrb (v16i8 VR128:$src1), imm:$src2))]>, OpSize; + let neverHasSideEffects = 1, mayStore = 1 in def mr : SS4AIi8 opc, string OpcodeStr> { + let neverHasSideEffects = 1, mayStore = 1 in def mr : SS4AIi8, Requires<[HasAVX]>; } -let Defs = [XMM0, EFLAGS], Predicates = [HasAVX] in { +let Defs = [XMM0, EFLAGS], neverHasSideEffects = 1, Predicates = [HasAVX] in { def VPCMPISTRM128rr : SS42AI<0x62, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2, i8imm:$src3), "vpcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize, VEX; + let mayLoad = 1 in def VPCMPISTRM128rm : SS42AI<0x62, MRMSrcMem, (outs), (ins VR128:$src1, i128mem:$src2, i8imm:$src3), "vpcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize, VEX; } -let Defs = [XMM0, EFLAGS] in { +let Defs = [XMM0, EFLAGS], neverHasSideEffects = 1 in { def PCMPISTRM128rr : SS42AI<0x62, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2, i8imm:$src3), "pcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize; + let mayLoad = 1 in def PCMPISTRM128rm : SS42AI<0x62, MRMSrcMem, (outs), (ins VR128:$src1, i128mem:$src2, i8imm:$src3), "pcmpistrm\t{$src3, $src2, $src1|$src1, $src2, $src3}", []>, OpSize; @@ -6756,19 +6771,21 @@ } let Predicates = [HasAVX], - Defs = [XMM0, EFLAGS], Uses = [EAX, EDX] in { + Defs = [XMM0, EFLAGS], Uses = [EAX, EDX], neverHasSideEffects = 1 in { def VPCMPESTRM128rr : SS42AI<0x60, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src3, i8imm:$src5), "vpcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize, VEX; + let mayLoad = 1 in def VPCMPESTRM128rm : SS42AI<0x60, MRMSrcMem, (outs), (ins VR128:$src1, i128mem:$src3, i8imm:$src5), "vpcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize, VEX; } -let Defs = [XMM0, EFLAGS], Uses = [EAX, EDX] in { +let Defs = [XMM0, EFLAGS], Uses = [EAX, EDX], neverHasSideEffects = 1 in { def PCMPESTRM128rr : SS42AI<0x60, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src3, i8imm:$src5), "pcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize; + let mayLoad = 1 in def PCMPESTRM128rm : SS42AI<0x60, MRMSrcMem, (outs), (ins VR128:$src1, i128mem:$src3, i8imm:$src5), "pcmpestrm\t{$src5, $src3, $src1|$src1, $src3, $src5}", []>, OpSize; @@ -7071,12 +7088,14 @@ //===----------------------------------------------------------------------===// // Carry-less Multiplication instructions +let neverHasSideEffects = 1 in { let Constraints = "$src1 = $dst" in { def PCLMULQDQrr : CLMULIi8<0x44, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src2, i8imm:$src3), "pclmulqdq\t{$src3, $src2, $dst|$dst, $src2, $src3}", []>; +let mayLoad = 1 in def PCLMULQDQrm : CLMULIi8<0x44, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2, i8imm:$src3), "pclmulqdq\t{$src3, $src2, $dst|$dst, $src2, $src3}", @@ -7089,10 +7108,12 @@ "vpclmulqdq\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}", []>; +let mayLoad = 1 in def VPCLMULQDQrm : AVXCLMULIi8<0x44, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, i128mem:$src2, i8imm:$src3), "vpclmulqdq\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}", []>; +} multiclass pclmul_alias { From chandlerc at gmail.com Mon Nov 14 00:51:49 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 14 Nov 2011 06:51:49 -0000 Subject: [llvm-commits] [llvm] r144523 - /llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h Message-ID: <20111114065149.98EF22A6C131@llvm.org> Author: chandlerc Date: Mon Nov 14 00:51:49 2011 New Revision: 144523 URL: http://llvm.org/viewvc/llvm-project?rev=144523&view=rev Log: Add a cautionary note to this API. It was not at all obvious to me how expensive the most useful interface to this analysis is. Fun story -- it's also not correct. That's getting fixed in another patch. Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h?rev=144523&r1=144522&r2=144523&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h Mon Nov 14 00:51:49 2011 @@ -62,6 +62,9 @@ // Return a probability as a fraction between 0 (0% probability) and // 1 (100% probability), however the value is never equal to 0, and can be 1 // only iff SRC block has only one successor. + // NB: This routine's complexity is linear on the number of successors of + // Src. Querying sequentially for each successor's probability is a quadratic + // query pattern. BranchProbability getEdgeProbability(MachineBasicBlock *Src, MachineBasicBlock *Dst) const; From matthewbg at google.com Mon Nov 14 02:13:08 2011 From: matthewbg at google.com (Matt Beaumont-Gay) Date: Mon, 14 Nov 2011 00:13:08 -0800 Subject: [llvm-commits] [llvm] r144473 - /llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll In-Reply-To: <20111112223937.CE6BE2A6C130@llvm.org> References: <20111112223937.CE6BE2A6C130@llvm.org> Message-ID: On Sat, Nov 12, 2011 at 14:39, Jakob Stoklund Olesen wrote: > Author: stoklund > Date: Sat Nov 12 16:39:37 2011 > New Revision: 144473 > > URL: http://llvm.org/viewvc/llvm-project?rev=144473&view=rev > Log: > RAGreedy is better about hinting now. > > Or maybe we are just getting lucky. > > Modified: > ? ?llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll > > Modified: llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll?rev=144473&r1=144472&r2=144473&view=diff > ============================================================================== > --- llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll (original) > +++ llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll Sat Nov 12 16:39:37 2011 > @@ -1,4 +1,4 @@ > -; RUN: llc < %s -mtriple=thumbv7-apple-darwin -regalloc=linearscan -disable-post-ra | FileCheck %s > +; RUN: llc < %s -mtriple=thumbv7-apple-darwin -disable-post-ra | FileCheck %s > > ?; The ARM magic hinting works best with linear scan. Stale comment? From craig.topper at gmail.com Mon Nov 14 02:07:55 2011 From: craig.topper at gmail.com (Craig Topper) Date: Mon, 14 Nov 2011 08:07:55 -0000 Subject: [llvm-commits] [llvm] r144525 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <20111114080755.E102A2A6C131@llvm.org> Author: ctopper Date: Mon Nov 14 02:07:55 2011 New Revision: 144525 URL: http://llvm.org/viewvc/llvm-project?rev=144525&view=rev Log: Add AVX2 version of instructions to load folding tables. Also add a bunch of missing SSE/AVX instructions. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=144525&r1=144524&r2=144525&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Nov 14 02:07:55 2011 @@ -456,6 +456,9 @@ { X86::MOVZX64rr16, X86::MOVZX64rm16, 0 }, { X86::MOVZX64rr32, X86::MOVZX64rm32, 0 }, { X86::MOVZX64rr8, X86::MOVZX64rm8, 0 }, + { X86::PABSBrr128, X86::PABSBrm128, TB_ALIGN_16 }, + { X86::PABSDrr128, X86::PABSDrm128, TB_ALIGN_16 }, + { X86::PABSWrr128, X86::PABSWrm128, TB_ALIGN_16 }, { X86::PSHUFDri, X86::PSHUFDmi, TB_ALIGN_16 }, { X86::PSHUFHWri, X86::PSHUFHWmi, TB_ALIGN_16 }, { X86::PSHUFLWri, X86::PSHUFLWmi, TB_ALIGN_16 }, @@ -508,6 +511,9 @@ { X86::VMOVZDI2PDIrr, X86::VMOVZDI2PDIrm, 0 }, { X86::VMOVZQI2PQIrr, X86::VMOVZQI2PQIrm, 0 }, { X86::VMOVZPQILo2PQIrr,X86::VMOVZPQILo2PQIrm, TB_ALIGN_16 }, + { X86::VPABSBrr128, X86::VPABSBrm128, TB_ALIGN_16 }, + { X86::VPABSDrr128, X86::VPABSDrm128, TB_ALIGN_16 }, + { X86::VPABSWrr128, X86::VPABSWrm128, TB_ALIGN_16 }, { X86::VPSHUFDri, X86::VPSHUFDmi, TB_ALIGN_16 }, { X86::VPSHUFHWri, X86::VPSHUFHWmi, TB_ALIGN_16 }, { X86::VPSHUFLWri, X86::VPSHUFLWmi, TB_ALIGN_16 }, @@ -526,7 +532,14 @@ { X86::VMOVAPSYrr, X86::VMOVAPSYrm, TB_ALIGN_32 }, { X86::VMOVDQAYrr, X86::VMOVDQAYrm, TB_ALIGN_16 }, { X86::VMOVUPDYrr, X86::VMOVUPDYrm, 0 }, - { X86::VMOVUPSYrr, X86::VMOVUPSYrm, 0 } + { X86::VMOVUPSYrr, X86::VMOVUPSYrm, 0 }, + // AVX2 foldable instructions + { X86::VPABSBrr256, X86::VPABSBrm256, TB_ALIGN_16 }, + { X86::VPABSDrr256, X86::VPABSDrm256, TB_ALIGN_16 }, + { X86::VPABSWrr256, X86::VPABSWrm256, TB_ALIGN_16 }, + { X86::VPSHUFDYri, X86::VPSHUFDYmi, TB_ALIGN_16 }, + { X86::VPSHUFHWYri, X86::VPSHUFHWYmi, TB_ALIGN_16 }, + { X86::VPSHUFLWYri, X86::VPSHUFLWYmi, TB_ALIGN_16 } }; for (unsigned i = 0, e = array_lengthof(OpTbl1); i != e; ++i) { @@ -652,6 +665,7 @@ { X86::MINSDrr_Int, X86::MINSDrm_Int, 0 }, { X86::MINSSrr, X86::MINSSrm, 0 }, { X86::MINSSrr_Int, X86::MINSSrm_Int, 0 }, + { X86::MPSADBWrri, X86::MPSADBWrmi, TB_ALIGN_16 }, { X86::MULPDrr, X86::MULPDrm, TB_ALIGN_16 }, { X86::MULPSrr, X86::MULPSrm, TB_ALIGN_16 }, { X86::MULSDrr, X86::MULSDrm, 0 }, @@ -664,30 +678,44 @@ { X86::ORPSrr, X86::ORPSrm, TB_ALIGN_16 }, { X86::PACKSSDWrr, X86::PACKSSDWrm, TB_ALIGN_16 }, { X86::PACKSSWBrr, X86::PACKSSWBrm, TB_ALIGN_16 }, + { X86::PACKUSDWrr, X86::PACKUSDWrm, TB_ALIGN_16 }, { X86::PACKUSWBrr, X86::PACKUSWBrm, TB_ALIGN_16 }, { X86::PADDBrr, X86::PADDBrm, TB_ALIGN_16 }, { X86::PADDDrr, X86::PADDDrm, TB_ALIGN_16 }, { X86::PADDQrr, X86::PADDQrm, TB_ALIGN_16 }, { X86::PADDSBrr, X86::PADDSBrm, TB_ALIGN_16 }, { X86::PADDSWrr, X86::PADDSWrm, TB_ALIGN_16 }, + { X86::PADDUSBrr, X86::PADDUSBrm, TB_ALIGN_16 }, + { X86::PADDUSWrr, X86::PADDUSWrm, TB_ALIGN_16 }, { X86::PADDWrr, X86::PADDWrm, TB_ALIGN_16 }, + { X86::PALIGNR128rr, X86::PALIGNR128rm, TB_ALIGN_16 }, { X86::PANDNrr, X86::PANDNrm, TB_ALIGN_16 }, { X86::PANDrr, X86::PANDrm, TB_ALIGN_16 }, { X86::PAVGBrr, X86::PAVGBrm, TB_ALIGN_16 }, { X86::PAVGWrr, X86::PAVGWrm, TB_ALIGN_16 }, { X86::PCMPEQBrr, X86::PCMPEQBrm, TB_ALIGN_16 }, { X86::PCMPEQDrr, X86::PCMPEQDrm, TB_ALIGN_16 }, + { X86::PCMPEQQrr, X86::PCMPEQQrm, TB_ALIGN_16 }, { X86::PCMPEQWrr, X86::PCMPEQWrm, TB_ALIGN_16 }, { X86::PCMPGTBrr, X86::PCMPGTBrm, TB_ALIGN_16 }, { X86::PCMPGTDrr, X86::PCMPGTDrm, TB_ALIGN_16 }, + { X86::PCMPGTQrr, X86::PCMPGTQrm, TB_ALIGN_16 }, { X86::PCMPGTWrr, X86::PCMPGTWrm, TB_ALIGN_16 }, + { X86::PHADDDrr128, X86::PHADDDrm128, TB_ALIGN_16 }, + { X86::PHADDWrr128, X86::PHADDWrm128, TB_ALIGN_16 }, + { X86::PHADDSWrr128, X86::PHADDSWrm128, TB_ALIGN_16 }, + { X86::PHSUBDrr128, X86::PHSUBDrm128, TB_ALIGN_16 }, + { X86::PHSUBSWrr128, X86::PHSUBSWrm128, TB_ALIGN_16 }, + { X86::PHSUBWrr128, X86::PHSUBWrm128, TB_ALIGN_16 }, { X86::PINSRWrri, X86::PINSRWrmi, TB_ALIGN_16 }, + { X86::PMADDUBSWrr128, X86::PMADDUBSWrm128, TB_ALIGN_16 }, { X86::PMADDWDrr, X86::PMADDWDrm, TB_ALIGN_16 }, { X86::PMAXSWrr, X86::PMAXSWrm, TB_ALIGN_16 }, { X86::PMAXUBrr, X86::PMAXUBrm, TB_ALIGN_16 }, { X86::PMINSWrr, X86::PMINSWrm, TB_ALIGN_16 }, { X86::PMINUBrr, X86::PMINUBrm, TB_ALIGN_16 }, { X86::PMULDQrr, X86::PMULDQrm, TB_ALIGN_16 }, + { X86::PMULHRSWrr128, X86::PMULHRSWrm128, TB_ALIGN_16 }, { X86::PMULHUWrr, X86::PMULHUWrm, TB_ALIGN_16 }, { X86::PMULHWrr, X86::PMULHWrm, TB_ALIGN_16 }, { X86::PMULLDrr, X86::PMULLDrm, TB_ALIGN_16 }, @@ -695,6 +723,10 @@ { X86::PMULUDQrr, X86::PMULUDQrm, TB_ALIGN_16 }, { X86::PORrr, X86::PORrm, TB_ALIGN_16 }, { X86::PSADBWrr, X86::PSADBWrm, TB_ALIGN_16 }, + { X86::PSHUFBrr128, X86::PSHUFBrm128, TB_ALIGN_16 }, + { X86::PSIGNBrr128, X86::PSIGNBrm128, TB_ALIGN_16 }, + { X86::PSIGNWrr128, X86::PSIGNWrm128, TB_ALIGN_16 }, + { X86::PSIGNDrr128, X86::PSIGNDrm128, TB_ALIGN_16 }, { X86::PSLLDrr, X86::PSLLDrm, TB_ALIGN_16 }, { X86::PSLLQrr, X86::PSLLQrm, TB_ALIGN_16 }, { X86::PSLLWrr, X86::PSLLWrm, TB_ALIGN_16 }, @@ -816,6 +848,7 @@ { X86::VMINSDrr_Int, X86::VMINSDrm_Int, 0 }, { X86::VMINSSrr, X86::VMINSSrm, 0 }, { X86::VMINSSrr_Int, X86::VMINSSrm_Int, 0 }, + { X86::VMPSADBWrri, X86::VMPSADBWrmi, TB_ALIGN_16 }, { X86::VMULPDrr, X86::VMULPDrm, TB_ALIGN_16 }, { X86::VMULPSrr, X86::VMULPSrm, TB_ALIGN_16 }, { X86::VMULSDrr, X86::VMULSDrm, 0 }, @@ -824,28 +857,44 @@ { X86::VORPSrr, X86::VORPSrm, TB_ALIGN_16 }, { X86::VPACKSSDWrr, X86::VPACKSSDWrm, TB_ALIGN_16 }, { X86::VPACKSSWBrr, X86::VPACKSSWBrm, TB_ALIGN_16 }, + { X86::VPACKUSDWrr, X86::VPACKUSDWrm, TB_ALIGN_16 }, { X86::VPACKUSWBrr, X86::VPACKUSWBrm, TB_ALIGN_16 }, { X86::VPADDBrr, X86::VPADDBrm, TB_ALIGN_16 }, { X86::VPADDDrr, X86::VPADDDrm, TB_ALIGN_16 }, { X86::VPADDQrr, X86::VPADDQrm, TB_ALIGN_16 }, { X86::VPADDSBrr, X86::VPADDSBrm, TB_ALIGN_16 }, { X86::VPADDSWrr, X86::VPADDSWrm, TB_ALIGN_16 }, + { X86::VPADDUSBrr, X86::VPADDUSBrm, TB_ALIGN_16 }, + { X86::VPADDUSWrr, X86::VPADDUSWrm, TB_ALIGN_16 }, { X86::VPADDWrr, X86::VPADDWrm, TB_ALIGN_16 }, + { X86::VPALIGNR128rr, X86::VPALIGNR128rm, TB_ALIGN_16 }, { X86::VPANDNrr, X86::VPANDNrm, TB_ALIGN_16 }, { X86::VPANDrr, X86::VPANDrm, TB_ALIGN_16 }, + { X86::VPAVGBrr, X86::VPAVGBrm, TB_ALIGN_16 }, + { X86::VPAVGWrr, X86::VPAVGWrm, TB_ALIGN_16 }, { X86::VPCMPEQBrr, X86::VPCMPEQBrm, TB_ALIGN_16 }, { X86::VPCMPEQDrr, X86::VPCMPEQDrm, TB_ALIGN_16 }, + { X86::VPCMPEQQrr, X86::VPCMPEQQrm, TB_ALIGN_16 }, { X86::VPCMPEQWrr, X86::VPCMPEQWrm, TB_ALIGN_16 }, { X86::VPCMPGTBrr, X86::VPCMPGTBrm, TB_ALIGN_16 }, { X86::VPCMPGTDrr, X86::VPCMPGTDrm, TB_ALIGN_16 }, + { X86::VPCMPGTQrr, X86::VPCMPGTQrm, TB_ALIGN_16 }, { X86::VPCMPGTWrr, X86::VPCMPGTWrm, TB_ALIGN_16 }, + { X86::VPHADDDrr128, X86::VPHADDDrm128, TB_ALIGN_16 }, + { X86::VPHADDSWrr128, X86::VPHADDSWrm128, TB_ALIGN_16 }, + { X86::VPHADDWrr128, X86::VPHADDWrm128, TB_ALIGN_16 }, + { X86::VPHSUBDrr128, X86::VPHSUBDrm128, TB_ALIGN_16 }, + { X86::VPHSUBSWrr128, X86::VPHSUBSWrm128, TB_ALIGN_16 }, + { X86::VPHSUBWrr128, X86::VPHSUBWrm128, TB_ALIGN_16 }, { X86::VPINSRWrri, X86::VPINSRWrmi, TB_ALIGN_16 }, + { X86::VPMADDUBSWrr128, X86::VPMADDUBSWrm128, TB_ALIGN_16 }, { X86::VPMADDWDrr, X86::VPMADDWDrm, TB_ALIGN_16 }, { X86::VPMAXSWrr, X86::VPMAXSWrm, TB_ALIGN_16 }, { X86::VPMAXUBrr, X86::VPMAXUBrm, TB_ALIGN_16 }, { X86::VPMINSWrr, X86::VPMINSWrm, TB_ALIGN_16 }, { X86::VPMINUBrr, X86::VPMINUBrm, TB_ALIGN_16 }, { X86::VPMULDQrr, X86::VPMULDQrm, TB_ALIGN_16 }, + { X86::VPMULHRSWrr128, X86::VPMULHRSWrm128, TB_ALIGN_16 }, { X86::VPMULHUWrr, X86::VPMULHUWrm, TB_ALIGN_16 }, { X86::VPMULHWrr, X86::VPMULHWrm, TB_ALIGN_16 }, { X86::VPMULLDrr, X86::VPMULLDrm, TB_ALIGN_16 }, @@ -853,6 +902,10 @@ { X86::VPMULUDQrr, X86::VPMULUDQrm, TB_ALIGN_16 }, { X86::VPORrr, X86::VPORrm, TB_ALIGN_16 }, { X86::VPSADBWrr, X86::VPSADBWrm, TB_ALIGN_16 }, + { X86::VPSHUFBrr128, X86::VPSHUFBrm128, TB_ALIGN_16 }, + { X86::VPSIGNBrr128, X86::VPSIGNBrm128, TB_ALIGN_16 }, + { X86::VPSIGNWrr128, X86::VPSIGNWrm128, TB_ALIGN_16 }, + { X86::VPSIGNDrr128, X86::VPSIGNDrm128, TB_ALIGN_16 }, { X86::VPSLLDrr, X86::VPSLLDrm, TB_ALIGN_16 }, { X86::VPSLLQrr, X86::VPSLLQrm, TB_ALIGN_16 }, { X86::VPSLLWrr, X86::VPSLLWrm, TB_ALIGN_16 }, @@ -886,7 +939,91 @@ { X86::VUNPCKLPDrr, X86::VUNPCKLPDrm, TB_ALIGN_16 }, { X86::VUNPCKLPSrr, X86::VUNPCKLPSrm, TB_ALIGN_16 }, { X86::VXORPDrr, X86::VXORPDrm, TB_ALIGN_16 }, - { X86::VXORPSrr, X86::VXORPSrm, TB_ALIGN_16 } + { X86::VXORPSrr, X86::VXORPSrm, TB_ALIGN_16 }, + // AVX2 foldable instructions + { X86::VPACKSSDWYrr, X86::VPACKSSDWYrm, TB_ALIGN_16 }, + { X86::VPACKSSWBYrr, X86::VPACKSSWBYrm, TB_ALIGN_16 }, + { X86::VPACKUSDWYrr, X86::VPACKUSDWYrm, TB_ALIGN_16 }, + { X86::VPACKUSWBYrr, X86::VPACKUSWBYrm, TB_ALIGN_16 }, + { X86::VPADDBYrr, X86::VPADDBYrm, TB_ALIGN_16 }, + { X86::VPADDDYrr, X86::VPADDDYrm, TB_ALIGN_16 }, + { X86::VPADDQYrr, X86::VPADDQYrm, TB_ALIGN_16 }, + { X86::VPADDSBYrr, X86::VPADDSBYrm, TB_ALIGN_16 }, + { X86::VPADDSWYrr, X86::VPADDSWYrm, TB_ALIGN_16 }, + { X86::VPADDUSBYrr, X86::VPADDUSBYrm, TB_ALIGN_16 }, + { X86::VPADDUSWYrr, X86::VPADDUSWYrm, TB_ALIGN_16 }, + { X86::VPADDWYrr, X86::VPADDWYrm, TB_ALIGN_16 }, + { X86::VPALIGNR256rr, X86::VPALIGNR256rm, TB_ALIGN_16 }, + { X86::VPANDNYrr, X86::VPANDNYrm, TB_ALIGN_16 }, + { X86::VPANDYrr, X86::VPANDYrm, TB_ALIGN_16 }, + { X86::VPAVGBYrr, X86::VPAVGBYrm, TB_ALIGN_16 }, + { X86::VPAVGWYrr, X86::VPAVGWYrm, TB_ALIGN_16 }, + { X86::VPCMPEQBYrr, X86::VPCMPEQBYrm, TB_ALIGN_16 }, + { X86::VPCMPEQDYrr, X86::VPCMPEQDYrm, TB_ALIGN_16 }, + { X86::VPCMPEQQYrr, X86::VPCMPEQQYrm, TB_ALIGN_16 }, + { X86::VPCMPEQWYrr, X86::VPCMPEQWYrm, TB_ALIGN_16 }, + { X86::VPCMPGTBYrr, X86::VPCMPGTBYrm, TB_ALIGN_16 }, + { X86::VPCMPGTDYrr, X86::VPCMPGTDYrm, TB_ALIGN_16 }, + { X86::VPCMPGTQYrr, X86::VPCMPGTQYrm, TB_ALIGN_16 }, + { X86::VPCMPGTWYrr, X86::VPCMPGTWYrm, TB_ALIGN_16 }, + { X86::VPHADDDrr256, X86::VPHADDDrm256, TB_ALIGN_16 }, + { X86::VPHADDSWrr256, X86::VPHADDSWrm256, TB_ALIGN_16 }, + { X86::VPHADDWrr256, X86::VPHADDWrm256, TB_ALIGN_16 }, + { X86::VPHSUBDrr256, X86::VPHSUBDrm256, TB_ALIGN_16 }, + { X86::VPHSUBSWrr256, X86::VPHSUBSWrm256, TB_ALIGN_16 }, + { X86::VPHSUBWrr256, X86::VPHSUBWrm256, TB_ALIGN_16 }, + { X86::VPMADDUBSWrr256, X86::VPMADDUBSWrm256, TB_ALIGN_16 }, + { X86::VPMADDWDYrr, X86::VPMADDWDYrm, TB_ALIGN_16 }, + { X86::VPMAXSWYrr, X86::VPMAXSWYrm, TB_ALIGN_16 }, + { X86::VPMAXUBYrr, X86::VPMAXUBYrm, TB_ALIGN_16 }, + { X86::VPMINSWYrr, X86::VPMINSWYrm, TB_ALIGN_16 }, + { X86::VPMINUBYrr, X86::VPMINUBYrm, TB_ALIGN_16 }, + { X86::VMPSADBWYrri, X86::VMPSADBWYrmi, TB_ALIGN_16 }, + { X86::VPMULDQYrr, X86::VPMULDQYrm, TB_ALIGN_16 }, + { X86::VPMULHRSWrr256, X86::VPMULHRSWrm256, TB_ALIGN_16 }, + { X86::VPMULHUWYrr, X86::VPMULHUWYrm, TB_ALIGN_16 }, + { X86::VPMULHWYrr, X86::VPMULHWYrm, TB_ALIGN_16 }, + { X86::VPMULLDYrr, X86::VPMULLDYrm, TB_ALIGN_16 }, + { X86::VPMULLWYrr, X86::VPMULLWYrm, TB_ALIGN_16 }, + { X86::VPMULUDQYrr, X86::VPMULUDQYrm, TB_ALIGN_16 }, + { X86::VPORYrr, X86::VPORYrm, TB_ALIGN_16 }, + { X86::VPSADBWYrr, X86::VPSADBWYrm, TB_ALIGN_16 }, + { X86::VPSHUFBrr256, X86::VPSHUFBrm256, TB_ALIGN_16 }, + { X86::VPSIGNBrr256, X86::VPSIGNBrm256, TB_ALIGN_16 }, + { X86::VPSIGNWrr256, X86::VPSIGNWrm256, TB_ALIGN_16 }, + { X86::VPSIGNDrr256, X86::VPSIGNDrm256, TB_ALIGN_16 }, + { X86::VPSLLDYrr, X86::VPSLLDYrm, TB_ALIGN_16 }, + { X86::VPSLLQYrr, X86::VPSLLQYrm, TB_ALIGN_16 }, + { X86::VPSLLWYrr, X86::VPSLLWYrm, TB_ALIGN_16 }, + { X86::VPSLLVDrr, X86::VPSLLVDrm, TB_ALIGN_16 }, + { X86::VPSLLVDYrr, X86::VPSLLVDYrm, TB_ALIGN_16 }, + { X86::VPSLLVQrr, X86::VPSLLVQrm, TB_ALIGN_16 }, + { X86::VPSLLVQYrr, X86::VPSLLVQYrm, TB_ALIGN_16 }, + { X86::VPSRADYrr, X86::VPSRADYrm, TB_ALIGN_16 }, + { X86::VPSRAWYrr, X86::VPSRAWYrm, TB_ALIGN_16 }, + { X86::VPSRAVDrr, X86::VPSRAVDrm, TB_ALIGN_16 }, + { X86::VPSRAVDYrr, X86::VPSRAVDYrm, TB_ALIGN_16 }, + { X86::VPSRLDYrr, X86::VPSRLDYrm, TB_ALIGN_16 }, + { X86::VPSRLQYrr, X86::VPSRLQYrm, TB_ALIGN_16 }, + { X86::VPSRLWYrr, X86::VPSRLWYrm, TB_ALIGN_16 }, + { X86::VPSRLVDrr, X86::VPSRLVDrm, TB_ALIGN_16 }, + { X86::VPSRLVDYrr, X86::VPSRLVDYrm, TB_ALIGN_16 }, + { X86::VPSRLVQrr, X86::VPSRLVQrm, TB_ALIGN_16 }, + { X86::VPSRLVQYrr, X86::VPSRLVQYrm, TB_ALIGN_16 }, + { X86::VPSUBBYrr, X86::VPSUBBYrm, TB_ALIGN_16 }, + { X86::VPSUBDYrr, X86::VPSUBDYrm, TB_ALIGN_16 }, + { X86::VPSUBSBYrr, X86::VPSUBSBYrm, TB_ALIGN_16 }, + { X86::VPSUBSWYrr, X86::VPSUBSWYrm, TB_ALIGN_16 }, + { X86::VPSUBWYrr, X86::VPSUBWYrm, TB_ALIGN_16 }, + { X86::VPUNPCKHBWYrr, X86::VPUNPCKHBWYrm, TB_ALIGN_16 }, + { X86::VPUNPCKHDQYrr, X86::VPUNPCKHDQYrm, TB_ALIGN_16 }, + { X86::VPUNPCKHQDQYrr, X86::VPUNPCKHQDQYrm, TB_ALIGN_16 }, + { X86::VPUNPCKHWDYrr, X86::VPUNPCKHWDYrm, TB_ALIGN_16 }, + { X86::VPUNPCKLBWYrr, X86::VPUNPCKLBWYrm, TB_ALIGN_16 }, + { X86::VPUNPCKLDQYrr, X86::VPUNPCKLDQYrm, TB_ALIGN_16 }, + { X86::VPUNPCKLQDQYrr, X86::VPUNPCKLQDQYrm, TB_ALIGN_16 }, + { X86::VPUNPCKLWDYrr, X86::VPUNPCKLWDYrm, TB_ALIGN_16 }, + { X86::VPXORYrr, X86::VPXORYrm, TB_ALIGN_16 }, // FIXME: add AVX 256-bit foldable instructions }; From chandlerc at gmail.com Mon Nov 14 02:50:16 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 14 Nov 2011 08:50:16 -0000 Subject: [llvm-commits] [llvm] r144526 - in /llvm/trunk: include/llvm/CodeGen/MachineBranchProbabilityInfo.h lib/CodeGen/MachineBranchProbabilityInfo.cpp test/CodeGen/X86/block-placement.ll Message-ID: <20111114085016.857ED2A6C131@llvm.org> Author: chandlerc Date: Mon Nov 14 02:50:16 2011 New Revision: 144526 URL: http://llvm.org/viewvc/llvm-project?rev=144526&view=rev Log: Fix an overflow bug in MachineBranchProbabilityInfo. This pass relied on the sum of the edge weights not overflowing uint32, and crashed when they did. This is generally safe as BranchProbabilityInfo tries to provide this guarantee. However, the CFG can get modified during codegen in a way that grows the *sum* of the edge weights. This doesn't seem unreasonable (imagine just adding more blocks all with the default weight of 16), but it is hard to come up with a case that actually triggers 32-bit overflow. Fortuately, the single-source GCC build is good at this. The solution isn't very pretty, but its no worse than the previous code. We're already summing all of the edge weights on each query, we can sum them, check for an overflow, compute a scale, and sum them again. I've included a *greatly* reduced test case out of the GCC source that triggers it. It's a pretty lame test, as it clearly is just barely triggering the overflow. I'd like to have something that is much more definitive, but I don't understand the fundamental pattern that triggers an explosion in the edge weight sums. The buggy code is duplicated within this file. I'll colapse them into a single implementation in a subsequent commit. Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp llvm/trunk/test/CodeGen/X86/block-placement.ll Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h?rev=144526&r1=144525&r2=144526&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h Mon Nov 14 02:50:16 2011 @@ -34,8 +34,10 @@ // weight to just "inherit" the non-zero weight of an adjacent successor. static const uint32_t DEFAULT_WEIGHT = 16; - // Get sum of the block successors' weights. - uint32_t getSumForBlock(MachineBasicBlock *MBB) const; + // Get sum of the block successors' weights, potentially scaling them to fit + // within 32-bits. If scaling is required, sets Scale based on the necessary + // adjustment. Any edge weights used with the sum should be divided by Scale. + uint32_t getSumForBlock(MachineBasicBlock *MBB, uint32_t &Scale) const; public: static char ID; Modified: llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp?rev=144526&r1=144525&r2=144526&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp Mon Nov 14 02:50:16 2011 @@ -27,19 +27,34 @@ char MachineBranchProbabilityInfo::ID = 0; uint32_t MachineBranchProbabilityInfo:: -getSumForBlock(MachineBasicBlock *MBB) const { - uint32_t Sum = 0; - +getSumForBlock(MachineBasicBlock *MBB, uint32_t &Scale) const { + // First we compute the sum with 64-bits of precision, ensuring that cannot + // overflow by bounding the number of weights considered. Hopefully no one + // actually needs 2^32 successors. + assert(MBB->succ_size() < UINT32_MAX); + uint64_t Sum = 0; + Scale = 1; for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(), E = MBB->succ_end(); I != E; ++I) { - MachineBasicBlock *Succ = *I; - uint32_t Weight = getEdgeWeight(MBB, Succ); - uint32_t PrevSum = Sum; - + uint32_t Weight = getEdgeWeight(MBB, *I); Sum += Weight; - assert(Sum > PrevSum); (void) PrevSum; } + // If the computed sum fits in 32-bits, we're done. + if (Sum <= UINT32_MAX) + return Sum; + + // Otherwise, compute the scale necessary to cause the weights to fit, and + // re-sum with that scale applied. + assert((Sum / UINT32_MAX) < UINT32_MAX); + Scale = (Sum / UINT32_MAX) + 1; + Sum = 0; + for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(), + E = MBB->succ_end(); I != E; ++I) { + uint32_t Weight = getEdgeWeight(MBB, *I); + Sum += Weight / Scale; + } + assert(Sum <= UINT32_MAX); return Sum; } @@ -89,8 +104,9 @@ BranchProbability MachineBranchProbabilityInfo::getEdgeProbability(MachineBasicBlock *Src, MachineBasicBlock *Dst) const { - uint32_t N = getEdgeWeight(Src, Dst); - uint32_t D = getSumForBlock(Src); + uint32_t Scale = 1; + uint32_t D = getSumForBlock(Src, Scale); + uint32_t N = getEdgeWeight(Src, Dst) / Scale; return BranchProbability(N, D); } Modified: llvm/trunk/test/CodeGen/X86/block-placement.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/block-placement.ll?rev=144526&r1=144525&r2=144526&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/block-placement.ll (original) +++ llvm/trunk/test/CodeGen/X86/block-placement.ll Mon Nov 14 02:50:16 2011 @@ -271,3 +271,54 @@ %ptr2 = load i32** undef, align 4 br label %loop.body3 } + +define i32 @problematic_switch() { +; This function's CFG caused overlow in the machine branch probability +; calculation, triggering asserts. Make sure we don't crash on it. +; CHECK: problematic_switch + +entry: + switch i32 undef, label %exit [ + i32 879, label %bogus + i32 877, label %step + i32 876, label %step + i32 875, label %step + i32 874, label %step + i32 873, label %step + i32 872, label %step + i32 868, label %step + i32 867, label %step + i32 866, label %step + i32 861, label %step + i32 860, label %step + i32 856, label %step + i32 855, label %step + i32 854, label %step + i32 831, label %step + i32 830, label %step + i32 829, label %step + i32 828, label %step + i32 815, label %step + i32 814, label %step + i32 811, label %step + i32 806, label %step + i32 805, label %step + i32 804, label %step + i32 803, label %step + i32 802, label %step + i32 801, label %step + i32 800, label %step + i32 799, label %step + i32 798, label %step + i32 797, label %step + i32 796, label %step + i32 795, label %step + ] +bogus: + unreachable +step: + br label %exit +exit: + %merge = phi i32 [ 3, %step ], [ 6, %entry ] + ret i32 %merge +} From chandlerc at gmail.com Mon Nov 14 02:55:59 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 14 Nov 2011 08:55:59 -0000 Subject: [llvm-commits] [llvm] r144527 - in /llvm/trunk: include/llvm/CodeGen/MachineBranchProbabilityInfo.h lib/CodeGen/MachineBranchProbabilityInfo.cpp Message-ID: <20111114085600.04B5C2A6C131@llvm.org> Author: chandlerc Date: Mon Nov 14 02:55:59 2011 New Revision: 144527 URL: http://llvm.org/viewvc/llvm-project?rev=144527&view=rev Log: Reuse the logic in getEdgeProbability within getHotSucc in order to correctly handle blocks whose successor weights sum to more than UINT32_MAX. This is slightly less efficient, but the entire thing is already linear on the number of successors. Calling it within any hot routine is a mistake, and indeed no one is calling it. It also simplifies the code. Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h?rev=144527&r1=144526&r2=144527&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h Mon Nov 14 02:55:59 2011 @@ -59,6 +59,7 @@ bool isEdgeHot(MachineBasicBlock *Src, MachineBasicBlock *Dst) const; // Return a hot successor for the block BB or null if there isn't one. + // NB: This routine's complexity is linear on the number of successors. MachineBasicBlock *getHotSucc(MachineBasicBlock *MBB) const; // Return a probability as a fraction between 0 (0% probability) and Modified: llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp?rev=144527&r1=144526&r2=144527&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp Mon Nov 14 02:55:59 2011 @@ -76,26 +76,18 @@ MachineBasicBlock * MachineBranchProbabilityInfo::getHotSucc(MachineBasicBlock *MBB) const { - uint32_t Sum = 0; uint32_t MaxWeight = 0; MachineBasicBlock *MaxSucc = 0; - for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(), E = MBB->succ_end(); I != E; ++I) { - MachineBasicBlock *Succ = *I; - uint32_t Weight = getEdgeWeight(MBB, Succ); - uint32_t PrevSum = Sum; - - Sum += Weight; - assert(Sum > PrevSum); (void) PrevSum; - + uint32_t Weight = getEdgeWeight(MBB, *I); if (Weight > MaxWeight) { MaxWeight = Weight; - MaxSucc = Succ; + MaxSucc = *I; } } - if (BranchProbability(MaxWeight, Sum) >= BranchProbability(4, 5)) + if (getEdgeProbability(MBB, MaxSucc) >= BranchProbability(4, 5)) return MaxSucc; return 0; From benny.kra at googlemail.com Mon Nov 14 03:11:50 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Mon, 14 Nov 2011 10:11:50 +0100 Subject: [llvm-commits] [llvm] r144527 - in /llvm/trunk: include/llvm/CodeGen/MachineBranchProbabilityInfo.h lib/CodeGen/MachineBranchProbabilityInfo.cpp In-Reply-To: <20111114085600.04B5C2A6C131@llvm.org> References: <20111114085600.04B5C2A6C131@llvm.org> Message-ID: <6720255668642743212@unknownmsgid> On 14.11.2011, at 10:00, Chandler Carruth wrote: > Author: chandlerc > Date: Mon Nov 14 02:55:59 2011 > New Revision: 144527 > > URL: http://llvm.org/viewvc/llvm-project?rev=144527&view=rev > Log: > Reuse the logic in getEdgeProbability within getHotSucc in order to > correctly handle blocks whose successor weights sum to more than > UINT32_MAX. This is slightly less efficient, but the entire thing is > already linear on the number of successors. Calling it within any hot > routine is a mistake, and indeed no one is calling it. It also > simplifies the code. Does this problem also exist in the non-machine BPI version of getHotSucc? > > Modified: > llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h > llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp > > Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h?rev=144527&r1=144526&r2=144527&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h Mon Nov 14 02:55:59 2011 > @@ -59,6 +59,7 @@ > bool isEdgeHot(MachineBasicBlock *Src, MachineBasicBlock *Dst) const; > > // Return a hot successor for the block BB or null if there isn't one. > + // NB: This routine's complexity is linear on the number of successors. > MachineBasicBlock *getHotSucc(MachineBasicBlock *MBB) const; > > // Return a probability as a fraction between 0 (0% probability) and > > Modified: llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp?rev=144527&r1=144526&r2=144527&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachineBranchProbabilityInfo.cpp Mon Nov 14 02:55:59 2011 > @@ -76,26 +76,18 @@ > > MachineBasicBlock * > MachineBranchProbabilityInfo::getHotSucc(MachineBasicBlock *MBB) const { > - uint32_t Sum = 0; > uint32_t MaxWeight = 0; > MachineBasicBlock *MaxSucc = 0; > - > for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(), > E = MBB->succ_end(); I != E; ++I) { > - MachineBasicBlock *Succ = *I; > - uint32_t Weight = getEdgeWeight(MBB, Succ); > - uint32_t PrevSum = Sum; > - > - Sum += Weight; > - assert(Sum > PrevSum); (void) PrevSum; > - > + uint32_t Weight = getEdgeWeight(MBB, *I); > if (Weight > MaxWeight) { > MaxWeight = Weight; > - MaxSucc = Succ; > + MaxSucc = *I; > } > } > > - if (BranchProbability(MaxWeight, Sum) >= BranchProbability(4, 5)) > + if (getEdgeProbability(MBB, MaxSucc) >= BranchProbability(4, 5)) > return MaxSucc; > > return 0; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From grosser at fim.uni-passau.de Mon Nov 14 03:09:23 2011 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Mon, 14 Nov 2011 09:09:23 -0000 Subject: [llvm-commits] [llvm] r144528 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <20111114090923.8AC612A6C131@llvm.org> Author: grosser Date: Mon Nov 14 03:09:23 2011 New Revision: 144528 URL: http://llvm.org/viewvc/llvm-project?rev=144528&view=rev Log: Add Polly to release notes Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=144528&r1=144527&r2=144528&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Mon Nov 14 03:09:23 2011 @@ -509,6 +509,22 @@ +

Polly

+ +
+ +

Polly is an advanced data-locality + optimizer and automatic parallelizer. It uses an advanced, mathematical + model to calculate detailed data dependency information which it uses to + optimize the loop structure of a program. Polly can speed up sequential code + by improving memory locality and consequently the cache use. Furthermore, + Polly is able to expose different kind of parallelism which it exploits by + introducing (basic) OpenMP and SIMD code. A mid-term goal of Polly is to + automatically create optimized GPU code.

+ +
+ +

Portable OpenCL (pocl)

From grosser at fim.uni-passau.de Mon Nov 14 03:09:27 2011 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Mon, 14 Nov 2011 09:09:27 -0000 Subject: [llvm-commits] [llvm] r144529 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <20111114090927.1E9352A6C131@llvm.org> Author: grosser Date: Mon Nov 14 03:09:26 2011 New Revision: 144529 URL: http://llvm.org/viewvc/llvm-project?rev=144529&view=rev Log: Add clang_complete to release notes Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=144529&r1=144528&r2=144529&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Mon Nov 14 03:09:26 2011 @@ -341,6 +341,18 @@
+

clang_complete for VIM

+ +
+ +

clang_complete is a + VIM plugin, that provides accurate C/C++ autocompletion using the clang front + end. The development version of clang complete, can directly use libclang + which can maintain a cache to speed up auto completion.

+ +
+ +

clReflect

From chandlerc at gmail.com Mon Nov 14 03:12:57 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 14 Nov 2011 09:12:57 -0000 Subject: [llvm-commits] [llvm] r144530 - in /llvm/trunk: include/llvm/CodeGen/MachineBranchProbabilityInfo.h lib/CodeGen/MachineBlockPlacement.cpp Message-ID: <20111114091258.082252A6C131@llvm.org> Author: chandlerc Date: Mon Nov 14 03:12:57 2011 New Revision: 144530 URL: http://llvm.org/viewvc/llvm-project?rev=144530&view=rev Log: Under the hood, MBPI is doing a linear scan of every successor every time it is queried to compute the probability of a single successor. This makes computing the probability of every successor of a block in sequence... really really slow. ;] This switches to a linear walk of the successors rather than a quadratic one. One of several quadratic behaviors slowing this pass down. I'm not really thrilled with moving the sum code into the public interface of MBPI, but I don't (at the moment) have ideas for a better interface. My direction I'm thinking in for a better interface is to have MBPI actually retain much more state and make *all* of these queries cheap. That's a lot of work, and would require invasive changes. Until then, this seems like the least bad (ie, least quadratic) solution. Suggestions welcome. Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h?rev=144530&r1=144529&r2=144530&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h Mon Nov 14 03:12:57 2011 @@ -34,11 +34,6 @@ // weight to just "inherit" the non-zero weight of an adjacent successor. static const uint32_t DEFAULT_WEIGHT = 16; - // Get sum of the block successors' weights, potentially scaling them to fit - // within 32-bits. If scaling is required, sets Scale based on the necessary - // adjustment. Any edge weights used with the sum should be divided by Scale. - uint32_t getSumForBlock(MachineBasicBlock *MBB, uint32_t &Scale) const; - public: static char ID; @@ -55,6 +50,11 @@ // DEFAULT_WEIGHT. uint32_t getEdgeWeight(MachineBasicBlock *Src, MachineBasicBlock *Dst) const; + // Get sum of the block successors' weights, potentially scaling them to fit + // within 32-bits. If scaling is required, sets Scale based on the necessary + // adjustment. Any edge weights used with the sum should be divided by Scale. + uint32_t getSumForBlock(MachineBasicBlock *MBB, uint32_t &Scale) const; + // A 'Hot' edge is an edge which probability is >= 80%. bool isEdgeHot(MachineBasicBlock *Src, MachineBasicBlock *Dst) const; Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=144530&r1=144529&r2=144530&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Mon Nov 14 03:12:57 2011 @@ -334,7 +334,15 @@ const BranchProbability HotProb(4, 5); // 80% MachineBasicBlock *BestSucc = 0; - BranchProbability BestProb = BranchProbability::getZero(); + // FIXME: Due to the performance of the probability and weight routines in + // the MBPI analysis, we manually compute probabilities using the edge + // weights. This is suboptimal as it means that the somewhat subtle + // definition of edge weight semantics is encoded here as well. We should + // improve the MBPI interface to effeciently support query patterns such as + // this. + uint32_t BestWeight = 0; + uint32_t WeightScale = 0; + uint32_t SumWeight = MBPI->getSumForBlock(BB, WeightScale); DEBUG(dbgs() << "Attempting merge from: " << getBlockName(BB) << "\n"); for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(), SE = BB->succ_end(); @@ -347,7 +355,8 @@ continue; } - BranchProbability SuccProb = MBPI->getEdgeProbability(BB, *SI); + uint32_t SuccWeight = MBPI->getEdgeWeight(BB, *SI); + BranchProbability SuccProb(SuccWeight / WeightScale, SumWeight); // Only consider successors which are either "hot", or wouldn't violate // any CFG constraints. @@ -360,10 +369,10 @@ << " (prob)" << (SuccChain.LoopPredecessors != 0 ? " (CFG break)" : "") << "\n"); - if (BestSucc && BestProb >= SuccProb) + if (BestSucc && BestWeight >= SuccWeight) continue; BestSucc = *SI; - BestProb = SuccProb; + BestWeight = SuccWeight; } return BestSucc; } From chandlerc at gmail.com Mon Nov 14 03:32:41 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 14 Nov 2011 01:32:41 -0800 Subject: [llvm-commits] [llvm] r144527 - in /llvm/trunk: include/llvm/CodeGen/MachineBranchProbabilityInfo.h lib/CodeGen/MachineBranchProbabilityInfo.cpp In-Reply-To: <6720255668642743212@unknownmsgid> References: <20111114085600.04B5C2A6C131@llvm.org> <6720255668642743212@unknownmsgid> Message-ID: On Mon, Nov 14, 2011 at 1:11 AM, Benjamin Kramer wrote: > On 14.11.2011, at 10:00, Chandler Carruth wrote: > > > Author: chandlerc > > Date: Mon Nov 14 02:55:59 2011 > > New Revision: 144527 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=144527&view=rev > > Log: > > Reuse the logic in getEdgeProbability within getHotSucc in order to > > correctly handle blocks whose successor weights sum to more than > > UINT32_MAX. This is slightly less efficient, but the entire thing is > > already linear on the number of successors. Calling it within any hot > > routine is a mistake, and indeed no one is calling it. It also > > simplifies the code. > > Does this problem also exist in the non-machine BPI version of getHotSucc? > At a fundamental level, yes. But I'm not sure we really care. At the IR level, we *compute* the branch probabilities. If the structure of the program is changed radically, we *recompute* them rather than updating them in-place. The computation (in the BPI analysis pass) is careful to eagerly scale weights down such that the sum doesn't overflow. So the assertion (and the lack of code to handle it) seem fine there. At the machine code level, we are updating the weights of the edges in the few places where they are mutated. That's what causes trouble. My suspicion is critical edge splitting, but I've not dug too deeply into it. So essentially, I don't think the IR-level code is really subject to the bug, despite having the same inability to cope with overflow. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20111114/36d81a7f/attachment.html From jay.foad at gmail.com Mon Nov 14 03:45:14 2011 From: jay.foad at gmail.com (Jay Foad) Date: Mon, 14 Nov 2011 09:45:14 +0000 Subject: [llvm-commits] [PATCH] PR889: devirtualize Value::printCustom Message-ID: http://llvm.org/bugs/show_bug.cgi?id=889 As a small step towards the goal of PR889 "Eliminate Virtual Methods In VMCore To Make Value Objects Smaller", this patch eliminates the virtual method Value::printCustom. As I mentioned in the PR, this is complicated because we don't want to introduce a library dependency from AsmWriter (which is in LLVMCore) to PseudoSourceValue (which is in LLVMCodeGen). The approach I took is to refactor PseudoSourceValue a bit so that the printCustom method is trivial, and can be moved out of the .cpp file and into an inline function in the .h file. Dan, I've CC'ed you because it looks like you introduced both PseudoSourceValue and the printCustom mechanism. Tested with "make check". OK to commit? Thanks, Jay. -------------- next part -------------- A non-text attachment was scrubbed... Name: psv.diff Type: text/x-patch Size: 10123 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20111114/c0e86292/attachment-0001.bin From chandlerc at gmail.com Mon Nov 14 03:46:33 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 14 Nov 2011 09:46:33 -0000 Subject: [llvm-commits] [llvm] r144531 - /llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Message-ID: <20111114094633.466D02A6C131@llvm.org> Author: chandlerc Date: Mon Nov 14 03:46:33 2011 New Revision: 144531 URL: http://llvm.org/viewvc/llvm-project?rev=144531&view=rev Log: Begin chipping away at one of the biggest quadratic-ish behaviors in this pass. We're leaving already merged blocks on the worklist, and scanning them again and again only to determine each time through that indeed they aren't viable. We can instead remove them once we're going to have to scan the worklist. This is the easy way to implement removing them. If this remains on the profile (as I somewhat suspect it will), we can get a lot more clever here, as the worklist's order is essentially irrelevant. We can use swapping and fold the two loops to reduce overhead even when there are many blocks on the worklist but only a few of them are removed. Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=144531&r1=144530&r2=144531&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Mon Nov 14 03:46:33 2011 @@ -377,6 +377,23 @@ return BestSucc; } +namespace { +/// \brief Predicate struct to detect blocks already placed. +class IsBlockPlaced { + const BlockChain &PlacedChain; + const BlockToChainMapType &BlockToChain; + +public: + IsBlockPlaced(const BlockChain &PlacedChain, + const BlockToChainMapType &BlockToChain) + : PlacedChain(PlacedChain), BlockToChain(BlockToChain) {} + + bool operator()(MachineBasicBlock *BB) const { + return BlockToChain.lookup(BB) == &PlacedChain; + } +}; +} + /// \brief Select the best block from a worklist. /// /// This looks through the provided worklist as a list of candidate basic @@ -390,13 +407,20 @@ MachineBasicBlock *MachineBlockPlacement::selectBestCandidateBlock( BlockChain &Chain, SmallVectorImpl &WorkList, const BlockFilterSet *BlockFilter) { + // Once we need to walk the worklist looking for a candidate, cleanup the + // worklist of already placed entries. + // FIXME: If this shows up on profiles, it could be folded (at the cost of + // some code complexity) into the loop below. + WorkList.erase(std::remove_if(WorkList.begin(), WorkList.end(), + IsBlockPlaced(Chain, BlockToChain)), + WorkList.end()); + MachineBasicBlock *BestBlock = 0; BlockFrequency BestFreq; for (SmallVectorImpl::iterator WBI = WorkList.begin(), WBE = WorkList.end(); WBI != WBE; ++WBI) { - if (BlockFilter && !BlockFilter->count(*WBI)) - continue; + assert(!BlockFilter || BlockFilter->count(*WBI)); BlockChain &SuccChain = *BlockToChain[*WBI]; if (&SuccChain == &Chain) { DEBUG(dbgs() << " " << getBlockName(*WBI) From chandlerc at google.com Mon Nov 14 03:53:37 2011 From: chandlerc at google.com (Chandler Carruth) Date: Mon, 14 Nov 2011 01:53:37 -0800 Subject: [llvm-commits] [PATCH] PR889: devirtualize Value::printCustom In-Reply-To: References: Message-ID: On Mon, Nov 14, 2011 at 1:45 AM, Jay Foad wrote: > http://llvm.org/bugs/show_bug.cgi?id=889 > > As a small step towards the goal of PR889 "Eliminate Virtual Methods > In VMCore To Make Value Objects Smaller", this patch eliminates the > virtual method Value::printCustom. > > As I mentioned in the PR, this is complicated because we don't want to > introduce a library dependency from AsmWriter (which is in LLVMCore) > to PseudoSourceValue (which is in LLVMCodeGen). The approach I took is > to refactor PseudoSourceValue a bit so that the printCustom method is > trivial, and can be moved out of the .cpp file and into an inline > function in the .h file. > I don't think this is an acceptable way to approach this. You're still adding a dependency on CodeGen to VMCore. You've just wrapped it up into a header file dependency instead of a link-time dependency. I think this is likely to make our already troublesome layering story significantly worse. VMCore should not know of or need anything CodeGen. If this routine does, there is some deeper design issue that needs to be resolved. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20111114/97edafd8/attachment.html From chandlerc at gmail.com Mon Nov 14 04:55:54 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 14 Nov 2011 10:55:54 -0000 Subject: [llvm-commits] [llvm] r144532 - /llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Message-ID: <20111114105554.6661C2A6C131@llvm.org> Author: chandlerc Date: Mon Nov 14 04:55:53 2011 New Revision: 144532 URL: http://llvm.org/viewvc/llvm-project?rev=144532&view=rev Log: Remove an over-eager assert that was firing on one of the ARM regression tests when I forcibly enabled block placement. It is apparantly possible for an unanalyzable block to fallthrough to a non-loop block. I don't actually beleive this is correct, I believe that 'canFallThrough' is returning true needlessly for the code construct, and I've left a bit of a FIXME on the verification code to try to track down why this is coming up. Anyways, removing the assert doesn't degrade the correctness of the algorithm. Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=144532&r1=144531&r2=144532&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Mon Nov 14 04:55:53 2011 @@ -492,9 +492,9 @@ if (TII->AnalyzeBranch(*BB, TBB, FBB, Cond) && BB->canFallThrough()) { MachineFunction::iterator I(BB), NextI(llvm::next(I)); // Ensure that the layout successor is a viable block, as we know that - // fallthrough is a possibility. + // fallthrough is a possibility. Note that this may not be a valid block + // in the loop, but we allow that to cope with degenerate situations. assert(NextI != BB->getParent()->end()); - assert(!BlockFilter || BlockFilter->count(NextI)); BestSucc = NextI; } @@ -594,7 +594,10 @@ for (BlockChain::iterator BCI = LoopChain.begin(), BCE = LoopChain.end(); BCI != BCE; ++BCI) if (!LoopBlockSet.erase(*BCI)) { - BadLoop = true; + // We don't mark the loop as bad here because there are real situations + // where this can occur. For example, with an unanalyzable fallthrough + // from a loop block to a non-loop block. + // FIXME: Such constructs shouldn't exist. Track them down and fix them. dbgs() << "Loop chain contains a block not contained by the loop!\n" << " Loop header: " << getBlockName(*L.block_begin()) << "\n" << " Chain header: " << getBlockName(*LoopChain.begin()) << "\n" From chandlerc at gmail.com Mon Nov 14 04:57:24 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 14 Nov 2011 10:57:24 -0000 Subject: [llvm-commits] [llvm] r144533 - /llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Message-ID: <20111114105724.1F5ED2A6C131@llvm.org> Author: chandlerc Date: Mon Nov 14 04:57:23 2011 New Revision: 144533 URL: http://llvm.org/viewvc/llvm-project?rev=144533&view=rev Log: It helps to deallocate memory as well as allocate it. =] This actually cleans up all the chains allocated during the processing of each function so that for very large inputs we don't just grow memory usage without bound. Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=144533&r1=144532&r2=144533&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Mon Nov 14 04:57:23 2011 @@ -766,6 +766,7 @@ AlignLoops(F); BlockToChain.clear(); + ChainAllocator.DestroyAll(); // We always return true as we have no way to track whether the final order // differs from the original order. From jay.foad at gmail.com Mon Nov 14 10:07:46 2011 From: jay.foad at gmail.com (Jay Foad) Date: Mon, 14 Nov 2011 16:07:46 +0000 Subject: [llvm-commits] [PATCH] PR889: devirtualize Value::printCustom In-Reply-To: References: Message-ID: On 14 November 2011 09:53, Chandler Carruth wrote: > I don't think this is an acceptable way to approach this. You're still > adding a dependency on CodeGen to VMCore. You've just wrapped it up into a > header file dependency instead of a link-time dependency. I think this is > likely to make our already troublesome layering story significantly worse. > VMCore should not know of or need anything CodeGen. VMCore defines a class hierarchy rooted at Value. CodeGen wants to extend that hierarchy with a new subclass, PseudoSourceValue. All these classes of value want to be able print themselves (for use in debugging dumps if nothing else). If this is to be done without VMCore knowing anything about CodeGen then a virtual method seems like a very good way of doing it. The point of the PR is that we want to do away with virtual methods to save space, because we won't need a vtable pointer in each object. Instead we can do manual dispatch on the object's ValueID. But I can't think of a good way for independent libraries (like CodeGen) to hook into this dispatch mechanism. Maybe they could register themselves with VMCore, saying "I want to extend the Value hierarchy with a new class with this ID"; but that doesn't sound like it would be very clean or efficient. So unless anyone has any bright ideas, it seems to me that this PR is fundamentally at odds with LLVM's "already troublesome layering story". Jay. From rafael.espindola at gmail.com Mon Nov 14 10:55:02 2011 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Mon, 14 Nov 2011 11:55:02 -0500 Subject: [llvm-commits] pr11367 Message-ID: I was thinking a bit about pr11367. The most direct way to solve it is keeping the list open until the linker is done adding files, but maybe there is a better way. What was the intended use case of lazy linking? Speeding up LTO? If so, it might be better to drop these function at the end of -std-compile-opts and change back the linker to keeping everything. The advantages would be * llvm-link is again just a IL version of cat * LTO is even faster, as we avoid writing to disk the functions that we currently drop when reading in. It is true that we would drop more available_externally functions. Right now if we drop them or not depends on the file order. Both the current solution and the dropping them in -std-compile-opts could also introduce a regression compared to the old way where an available_externally function in one file would be available for use in any other file. I don't think this would be a problem in practise. Any translation unit that uses an inline function is likely to see its definition. Cheers, Rafael From daniel at zuster.org Mon Nov 14 11:17:46 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 14 Nov 2011 17:17:46 -0000 Subject: [llvm-commits] [llvm] r144535 - /llvm/trunk/Makefile.rules Message-ID: <20111114171746.29EC82A6C131@llvm.org> Author: ddunbar Date: Mon Nov 14 11:17:45 2011 New Revision: 144535 URL: http://llvm.org/viewvc/llvm-project?rev=144535&view=rev Log: build/Make: Switch over to using llvm-config-2 for dependencies one more (hopefully last) time, now that it also builds as a build tool. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=144535&r1=144534&r2=144535&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Mon Nov 14 11:17:45 2011 @@ -527,7 +527,11 @@ LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT) endif endif -LLVM_CONFIG := $(LLVMToolDir)/llvm-config +ifeq ($(LLVM_CROSS_COMPILING),1) + LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config-2$(BUILD_EXEEXT) +else + LLVM_CONFIG := $(LLVMToolDir)/llvm-config-2$(EXEEXT) +endif ifndef LLVMLD LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT) endif From benny.kra at googlemail.com Mon Nov 14 11:22:45 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Mon, 14 Nov 2011 17:22:45 -0000 Subject: [llvm-commits] [llvm] r144536 - in /llvm/trunk: include/llvm/Transforms/Utils/SSAUpdater.h include/llvm/Transforms/Utils/SSAUpdaterImpl.h include/llvm/Transforms/Utils/SimplifyIndVar.h lib/Transforms/Utils/SSAUpdater.cpp Message-ID: <20111114172245.72CB82A6C131@llvm.org> Author: d0k Date: Mon Nov 14 11:22:45 2011 New Revision: 144536 URL: http://llvm.org/viewvc/llvm-project?rev=144536&view=rev Log: Make headers standalone, move a virtual method out of line. Modified: llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h llvm/trunk/include/llvm/Transforms/Utils/SSAUpdaterImpl.h llvm/trunk/include/llvm/Transforms/Utils/SimplifyIndVar.h llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Modified: llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h?rev=144536&r1=144535&r2=144536&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/SSAUpdater.h Mon Nov 14 11:22:45 2011 @@ -14,16 +14,18 @@ #ifndef LLVM_TRANSFORMS_UTILS_SSAUPDATER_H #define LLVM_TRANSFORMS_UTILS_SSAUPDATER_H +#include "llvm/ADT/StringRef.h" + namespace llvm { - class Value; class BasicBlock; - class Use; - class PHINode; + class Instruction; + class LoadInst; template class SmallVectorImpl; template class SSAUpdaterTraits; - class DbgDeclareInst; - class DIBuilder; - class BumpPtrAllocator; + class PHINode; + class Type; + class Use; + class Value; /// SSAUpdater - This class updates SSA form for a set of values defined in /// multiple blocks. This is used when code duplication or another unstructured @@ -137,12 +139,7 @@ /// passed into the run method). Clients should implement this with a more /// efficient version if possible. virtual bool isInstInList(Instruction *I, - const SmallVectorImpl &Insts) const { - for (unsigned i = 0, e = Insts.size(); i != e; ++i) - if (Insts[i] == I) - return true; - return false; - } + const SmallVectorImpl &Insts) const; /// doExtraRewritesBeforeFinalDeletion - This hook is invoked after all the /// stores are found and inserted as available values, but Modified: llvm/trunk/include/llvm/Transforms/Utils/SSAUpdaterImpl.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/SSAUpdaterImpl.h?rev=144536&r1=144535&r2=144536&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/SSAUpdaterImpl.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/SSAUpdaterImpl.h Mon Nov 14 11:22:45 2011 @@ -15,8 +15,16 @@ #ifndef LLVM_TRANSFORMS_UTILS_SSAUPDATERIMPL_H #define LLVM_TRANSFORMS_UTILS_SSAUPDATERIMPL_H +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Allocator.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/ValueHandle.h" + namespace llvm { +class CastInst; +class PHINode; template class SSAUpdaterTraits; template Modified: llvm/trunk/include/llvm/Transforms/Utils/SimplifyIndVar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/SimplifyIndVar.h?rev=144536&r1=144535&r2=144536&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/SimplifyIndVar.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/SimplifyIndVar.h Mon Nov 14 11:22:45 2011 @@ -17,17 +17,18 @@ #define LLVM_TRANSFORMS_UTILS_SIMPLIFYINDVAR_H #include "llvm/Support/CommandLine.h" +#include "llvm/Support/ValueHandle.h" namespace llvm { extern cl::opt DisableIVRewrite; +class CastInst; +class IVUsers; class Loop; -class LoopInfo; -class DominatorTree; -class ScalarEvolution; class LPPassManager; -class IVUsers; +class PHINode; +class ScalarEvolution; /// Interface for visiting interesting IV users that are recognized but not /// simplified by this utility. Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp?rev=144536&r1=144535&r2=144536&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Mon Nov 14 11:22:45 2011 @@ -518,3 +518,10 @@ User->eraseFromParent(); } } + +bool +LoadAndStorePromoter::isInstInList(Instruction *I, + const SmallVectorImpl &Insts) + const { + return std::find(Insts.begin(), Insts.end(), I) != Insts.end(); +} From benny.kra at googlemail.com Mon Nov 14 11:45:03 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Mon, 14 Nov 2011 17:45:03 -0000 Subject: [llvm-commits] [llvm] r144537 - in /llvm/trunk/include/llvm: Analysis/InlineCost.h Assembly/AssemblyAnnotationWriter.h CodeGen/FastISel.h CodeGen/MachineBlockFrequencyInfo.h CodeGen/MachineMemOperand.h MC/MCAsmLayout.h Message-ID: <20111114174503.BB6102A6C131@llvm.org> Author: d0k Date: Mon Nov 14 11:45:03 2011 New Revision: 144537 URL: http://llvm.org/viewvc/llvm-project?rev=144537&view=rev Log: Make headers standalone. Modified: llvm/trunk/include/llvm/Analysis/InlineCost.h llvm/trunk/include/llvm/Assembly/AssemblyAnnotationWriter.h llvm/trunk/include/llvm/CodeGen/FastISel.h llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h llvm/trunk/include/llvm/MC/MCAsmLayout.h Modified: llvm/trunk/include/llvm/Analysis/InlineCost.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/InlineCost.h?rev=144537&r1=144536&r2=144537&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/InlineCost.h (original) +++ llvm/trunk/include/llvm/Analysis/InlineCost.h Mon Nov 14 11:45:03 2011 @@ -14,18 +14,16 @@ #ifndef LLVM_ANALYSIS_INLINECOST_H #define LLVM_ANALYSIS_INLINECOST_H -#include -#include -#include +#include "llvm/Function.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/ValueMap.h" #include "llvm/Analysis/CodeMetrics.h" +#include +#include +#include namespace llvm { - class Value; - class Function; - class BasicBlock; class CallSite; template class SmallPtrSet; Modified: llvm/trunk/include/llvm/Assembly/AssemblyAnnotationWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Assembly/AssemblyAnnotationWriter.h?rev=144537&r1=144536&r2=144537&view=diff ============================================================================== --- llvm/trunk/include/llvm/Assembly/AssemblyAnnotationWriter.h (original) +++ llvm/trunk/include/llvm/Assembly/AssemblyAnnotationWriter.h Mon Nov 14 11:45:03 2011 @@ -22,6 +22,7 @@ class Function; class BasicBlock; class Instruction; +class Value; class raw_ostream; class formatted_raw_ostream; Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=144537&r1=144536&r2=144537&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FastISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/FastISel.h Mon Nov 14 11:45:03 2011 @@ -21,9 +21,11 @@ namespace llvm { class AllocaInst; +class Constant; class ConstantFP; class FunctionLoweringInfo; class Instruction; +class LoadInst; class MachineBasicBlock; class MachineConstantPool; class MachineFunction; @@ -36,7 +38,8 @@ class TargetMachine; class TargetRegisterClass; class TargetRegisterInfo; -class LoadInst; +class User; +class Value; /// FastISel - This is a fast-path instruction selection class that /// generates poor code and doesn't support illegal types or non-trivial Modified: llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h?rev=144537&r1=144536&r2=144537&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBlockFrequencyInfo.h Mon Nov 14 11:45:03 2011 @@ -20,6 +20,7 @@ namespace llvm { +class MachineBasicBlock; class MachineBranchProbabilityInfo; template class BlockFrequencyImpl; @@ -28,7 +29,8 @@ /// machine basic block frequencies. class MachineBlockFrequencyInfo : public MachineFunctionPass { - BlockFrequencyImpl *MBFI; + BlockFrequencyImpl *MBFI; public: static char ID; Modified: llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h?rev=144537&r1=144536&r2=144537&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h Mon Nov 14 11:45:03 2011 @@ -22,6 +22,7 @@ class Value; class FoldingSetNodeID; +class MDNode; class raw_ostream; /// MachinePointerInfo - This class contains a discriminated union of Modified: llvm/trunk/include/llvm/MC/MCAsmLayout.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmLayout.h?rev=144537&r1=144536&r2=144537&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAsmLayout.h (original) +++ llvm/trunk/include/llvm/MC/MCAsmLayout.h Mon Nov 14 11:45:03 2011 @@ -10,6 +10,7 @@ #ifndef LLVM_MC_MCASMLAYOUT_H #define LLVM_MC_MCASMLAYOUT_H +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" namespace llvm { From grosbach at apple.com Mon Nov 14 11:52:47 2011 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 14 Nov 2011 17:52:47 -0000 Subject: [llvm-commits] [llvm] r144538 - /llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Message-ID: <20111114175247.AC6422A6C131@llvm.org> Author: grosbach Date: Mon Nov 14 11:52:47 2011 New Revision: 144538 URL: http://llvm.org/viewvc/llvm-project?rev=144538&view=rev Log: Tidy up. 80 column. Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=144538&r1=144537&r2=144538&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Mon Nov 14 11:52:47 2011 @@ -714,7 +714,7 @@ bool isBitfield() const { return Kind == k_BitfieldDescriptor; } bool isPostIdxRegShifted() const { return Kind == k_PostIndexRegister; } bool isPostIdxReg() const { - return Kind == k_PostIndexRegister && PostIdxReg.ShiftTy == ARM_AM::no_shift; + return Kind == k_PostIndexRegister && PostIdxReg.ShiftTy ==ARM_AM::no_shift; } bool isMemNoOffset(bool alignOK = false) const { if (!isMemory()) @@ -1101,7 +1101,8 @@ void addRegShiftedRegOperands(MCInst &Inst, unsigned N) const { assert(N == 3 && "Invalid number of operands!"); - assert(isRegShiftedReg() && "addRegShiftedRegOperands() on non RegShiftedReg!"); + assert(isRegShiftedReg() && + "addRegShiftedRegOperands() on non RegShiftedReg!"); Inst.addOperand(MCOperand::CreateReg(RegShiftedReg.SrcReg)); Inst.addOperand(MCOperand::CreateReg(RegShiftedReg.ShiftReg)); Inst.addOperand(MCOperand::CreateImm( @@ -1110,7 +1111,8 @@ void addRegShiftedImmOperands(MCInst &Inst, unsigned N) const { assert(N == 2 && "Invalid number of operands!"); - assert(isRegShiftedImm() && "addRegShiftedImmOperands() on non RegShiftedImm!"); + assert(isRegShiftedImm() && + "addRegShiftedImmOperands() on non RegShiftedImm!"); Inst.addOperand(MCOperand::CreateReg(RegShiftedImm.SrcReg)); Inst.addOperand(MCOperand::CreateImm( ARM_AM::getSORegOpc(RegShiftedImm.ShiftTy, RegShiftedImm.ShiftImm))); @@ -1426,8 +1428,9 @@ void addMemRegOffsetOperands(MCInst &Inst, unsigned N) const { assert(N == 3 && "Invalid number of operands!"); - unsigned Val = ARM_AM::getAM2Opc(Memory.isNegative ? ARM_AM::sub : ARM_AM::add, - Memory.ShiftImm, Memory.ShiftType); + unsigned Val = + ARM_AM::getAM2Opc(Memory.isNegative ? ARM_AM::sub : ARM_AM::add, + Memory.ShiftImm, Memory.ShiftType); Inst.addOperand(MCOperand::CreateReg(Memory.BaseRegNum)); Inst.addOperand(MCOperand::CreateReg(Memory.OffsetRegNum)); Inst.addOperand(MCOperand::CreateImm(Val)); From stoklund at 2pi.dk Mon Nov 14 12:03:05 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 14 Nov 2011 18:03:05 -0000 Subject: [llvm-commits] [llvm] r144542 - /llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll Message-ID: <20111114180306.05F0F2A6C131@llvm.org> Author: stoklund Date: Mon Nov 14 12:03:05 2011 New Revision: 144542 URL: http://llvm.org/viewvc/llvm-project?rev=144542&view=rev Log: Delete stale comment. Modified: llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll Modified: llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll?rev=144542&r1=144541&r2=144542&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll (original) +++ llvm/trunk/test/CodeGen/ARM/memcpy-inline.ll Mon Nov 14 12:03:05 2011 @@ -1,6 +1,5 @@ ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -disable-post-ra | FileCheck %s -; The ARM magic hinting works best with linear scan. ; CHECK: ldrd ; CHECK: strd ; CHECK: ldrb From tonic at nondot.org Mon Nov 14 12:21:16 2011 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 14 Nov 2011 10:21:16 -0800 Subject: [llvm-commits] pr11367 In-Reply-To: References: Message-ID: On Nov 14, 2011, at 8:55 AM, Rafael Esp?ndola wrote: > I was thinking a bit about pr11367. The most direct way to solve it is > keeping the list open until the linker is done adding files, but maybe > there is a better way. > > What was the intended use case of lazy linking? Speeding up LTO? I implemented lazy linking for an outside project where I want to link with a bc library and only link in the functions that are used. We use the LinkModules() API directly. I talked to Chris about this and he wanted LTO to take advantage of this as well, so it seemed like a win for both. > If > so, it might be better to drop these function at the end of > -std-compile-opts and change back the linker to keeping everything. > The advantages would be I really don't want to run the optimizer on everything when the linker can easily do this. > > * llvm-link is again just a IL version of cat I'm sure this can be up for debate as what llvm-link is really supposed to do. I don't want to remove this functionality from the API. If its decided that llvm-link is really catting IR files together, then its better to make an option to turn it off (for llvm-link if it chooses) and have it on by default. -Tanya > * LTO is even faster, as we avoid writing to disk the functions that > we currently drop when reading in. > > It is true that we would drop more available_externally functions. > Right now if we drop them or not depends on the file order. > > Both the current solution and the dropping them in -std-compile-opts > could also introduce a regression compared to the old way where an > available_externally function in one file would be available for use > in any other file. I don't think this would be a problem in practise. > Any translation unit that uses an inline function is likely to see its > definition. > > Cheers, > Rafael From bob.wilson at apple.com Mon Nov 14 12:21:07 2011 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 14 Nov 2011 18:21:07 -0000 Subject: [llvm-commits] [llvm] r144543 - /llvm/trunk/lib/MC/MCDwarf.cpp Message-ID: <20111114182107.C69A62A6C131@llvm.org> Author: bwilson Date: Mon Nov 14 12:21:07 2011 New Revision: 144543 URL: http://llvm.org/viewvc/llvm-project?rev=144543&view=rev Log: Disable generation of compact unwind encodings. This still seems to be causing some failures. It needs more testing before it gets enabled again. Modified: llvm/trunk/lib/MC/MCDwarf.cpp Modified: llvm/trunk/lib/MC/MCDwarf.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=144543&r1=144542&r2=144543&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCDwarf.cpp (original) +++ llvm/trunk/lib/MC/MCDwarf.cpp Mon Nov 14 12:21:07 2011 @@ -1011,7 +1011,8 @@ // Emit the compact unwind info if available. // FIXME: This emits both the compact unwind and the old CIE/FDE // information. Only one of those is needed. - if (IsEH && MOFI->getCompactUnwindSection()) + // FIXME: Disable. This seems to still be causing failures. + if (false && IsEH && MOFI->getCompactUnwindSection()) for (unsigned i = 0, n = Streamer.getNumFrameInfos(); i < n; ++i) { const MCDwarfFrameInfo &Frame = Streamer.getFrameInfo(i); if (Frame.CompactUnwindEncoding) From clattner at apple.com Mon Nov 14 12:38:28 2011 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Nov 2011 10:38:28 -0800 Subject: [llvm-commits] [PATCH] PR889: devirtualize Value::printCustom In-Reply-To: References: Message-ID: <28388F1A-D44C-4218-A157-A177E2D114FB@apple.com> On Nov 14, 2011, at 8:07 AM, Jay Foad wrote: > On 14 November 2011 09:53, Chandler Carruth wrote: >> I don't think this is an acceptable way to approach this. You're still >> adding a dependency on CodeGen to VMCore. You've just wrapped it up into a >> header file dependency instead of a link-time dependency. I think this is >> likely to make our already troublesome layering story significantly worse. >> VMCore should not know of or need anything CodeGen. > > VMCore defines a class hierarchy rooted at Value. CodeGen wants to > extend that hierarchy with a new subclass, PseudoSourceValue. All > these classes of value want to be able print themselves (for use in > debugging dumps if nothing else). If this is to be done without VMCore > knowing anything about CodeGen then a virtual method seems like a very > good way of doing it. > > The point of the PR is that we want to do away with virtual methods to > save space, because we won't need a vtable pointer in each object. > Instead we can do manual dispatch on the object's ValueID. But I can't > think of a good way for independent libraries (like CodeGen) to hook > into this dispatch mechanism. Maybe they could register themselves > with VMCore, saying "I want to extend the Value hierarchy with a new > class with this ID"; but that doesn't sound like it would be very > clean or efficient. > > So unless anyone has any bright ideas, it seems to me that this PR is > fundamentally at odds with LLVM's "already troublesome layering > story". The "right" way to fix this is to eliminate PseudoSourceValue, which has always been a disgusting hack. Places in codegen that can uses PseudoSourceValue (e.g. the SDLoadNode and memoperands) should use a discriminated union of "Value* and SomeMachineLocationType". PseudoSourceValue never should have happened in the first place. -Chris From clattner at apple.com Mon Nov 14 12:40:42 2011 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Nov 2011 10:40:42 -0800 Subject: [llvm-commits] pr11367 In-Reply-To: References: Message-ID: MHO is that mainline is behaving correctly. We don't want LTO or llvm-link to keep all bitcode files around in memory to support a theoretical use case. -Chris On Nov 14, 2011, at 10:21 AM, Tanya Lattner wrote: > > On Nov 14, 2011, at 8:55 AM, Rafael Esp?ndola wrote: > >> I was thinking a bit about pr11367. The most direct way to solve it is >> keeping the list open until the linker is done adding files, but maybe >> there is a better way. >> >> What was the intended use case of lazy linking? Speeding up LTO? > > I implemented lazy linking for an outside project where I want to link with a bc library and only link in the functions that are used. We use the LinkModules() API directly. I talked to Chris about this and he wanted LTO to take advantage of this as well, so it seemed like a win for both. > >> If >> so, it might be better to drop these function at the end of >> -std-compile-opts and change back the linker to keeping everything. >> The advantages would be > > I really don't want to run the optimizer on everything when the linker can easily do this. > >> >> * llvm-link is again just a IL version of cat > > I'm sure this can be up for debate as what llvm-link is really supposed to do. I don't want to remove this functionality from the API. If its decided that llvm-link is really catting IR files together, then its better to make an option to turn it off (for llvm-link if it chooses) and have it on by default. > > -Tanya > >> * LTO is even faster, as we avoid writing to disk the functions that >> we currently drop when reading in. >> >> It is true that we would drop more available_externally functions. >> Right now if we drop them or not depends on the file order. >> >> Both the current solution and the dropping them in -std-compile-opts >> could also introduce a regression compared to the old way where an >> available_externally function in one file would be available for use >> in any other file. I don't think this would be a problem in practise. >> Any translation unit that uses an inline function is likely to see its >> definition. >> >> Cheers, >> Rafael > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From stoklund at 2pi.dk Mon Nov 14 12:45:39 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 14 Nov 2011 18:45:39 -0000 Subject: [llvm-commits] [llvm] r144547 - in /llvm/trunk: lib/CodeGen/LiveIntervalAnalysis.cpp test/CodeGen/ARM/2011-11-14-EarlyClobber.ll Message-ID: <20111114184539.2FD1D2A6C131@llvm.org> Author: stoklund Date: Mon Nov 14 12:45:38 2011 New Revision: 144547 URL: http://llvm.org/viewvc/llvm-project?rev=144547&view=rev Log: Fix early-clobber handling in shrinkToUses. I broke this in r144515, it affected most ARM testers. Added: llvm/trunk/test/CodeGen/ARM/2011-11-14-EarlyClobber.ll Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=144547&r1=144546&r2=144547&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Nov 14 12:45:38 2011 @@ -659,7 +659,9 @@ if (UseMI->isDebugValue() || !UseMI->readsVirtualRegister(li->reg)) continue; SlotIndex Idx = getInstructionIndex(UseMI).getRegSlot(); - VNInfo *VNI = li->getVNInfoAt(Idx.getBaseIndex()); + // Note: This intentionally picks up the wrong VNI in case of an EC redef. + // See below. + VNInfo *VNI = li->getVNInfoBefore(Idx); if (!VNI) { // This shouldn't happen: readsVirtualRegister returns true, but there is // no live value. It is likely caused by a target getting flags @@ -669,10 +671,11 @@ << *li << '\n'); continue; } - if (VNI->def == Idx.getRegSlot(true)) { - // Special case: An early-clobber tied operand reads and writes the - // register one slot early. - Idx = Idx.getRegSlot(true); + // Special case: An early-clobber tied operand reads and writes the + // register one slot early. The getVNInfoBefore call above would have + // picked up the value defined by UseMI. Adjust the kill slot and value. + if (SlotIndex::isSameInstr(VNI->def, Idx)) { + Idx = VNI->def; VNI = li->getVNInfoBefore(Idx); assert(VNI && "Early-clobber tied value not available"); } @@ -687,13 +690,6 @@ if (VNI->isUnused()) continue; NewLI.addRange(LiveRange(VNI->def, VNI->def.getDeadSlot(), VNI)); - - // A use tied to an early-clobber def ends at the load slot and isn't caught - // above. Catch it here instead. This probably only ever happens for inline - // assembly. - if (VNI->def.isEarlyClobber()) - if (VNInfo *UVNI = li->getVNInfoBefore(VNI->def)) - WorkList.push_back(std::make_pair(VNI->def, UVNI)); } // Keep track of the PHIs that are in use. Added: llvm/trunk/test/CodeGen/ARM/2011-11-14-EarlyClobber.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-11-14-EarlyClobber.ll?rev=144547&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2011-11-14-EarlyClobber.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2011-11-14-EarlyClobber.ll Mon Nov 14 12:45:38 2011 @@ -0,0 +1,62 @@ +; RUN: llc < %s -mcpu=cortex-a8 -verify-regalloc +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32" +target triple = "thumbv7-apple-ios" + +; This test calls shrinkToUses with an early-clobber redefined live range during +; spilling. +; +; Shrink: %vreg47,1.158257e-02 = [384r,400e:0)[400e,420r:1) 0 at 384r 1 at 400e +; +; The early-clobber instruction is an str: +; +; %vreg12 = t2STR_PRE %vreg6, %vreg12, 32, pred:14, pred:%noreg +; +; This tests that shrinkToUses handles the EC redef correctly. + +%struct.Transform_Struct.0.11.12.17.43.46.56.58.60 = type { [4 x [4 x double]] } + +define void @Compute_Axis_Rotation_Transform(%struct.Transform_Struct.0.11.12.17.43.46.56.58.60* nocapture %transform, double* nocapture %V1, double %angle) nounwind { +entry: + store double 1.000000e+00, double* null, align 4 + %arrayidx5.1.i = getelementptr inbounds %struct.Transform_Struct.0.11.12.17.43.46.56.58.60* %transform, i32 0, i32 0, i32 0, i32 1 + store double 0.000000e+00, double* %arrayidx5.1.i, align 4 + %arrayidx5.2.i = getelementptr inbounds %struct.Transform_Struct.0.11.12.17.43.46.56.58.60* %transform, i32 0, i32 0, i32 0, i32 2 + store double 0.000000e+00, double* %arrayidx5.2.i, align 4 + %arrayidx5.114.i = getelementptr inbounds %struct.Transform_Struct.0.11.12.17.43.46.56.58.60* %transform, i32 0, i32 0, i32 1, i32 0 + store double 0.000000e+00, double* %arrayidx5.114.i, align 4 + %arrayidx5.1.1.i = getelementptr inbounds %struct.Transform_Struct.0.11.12.17.43.46.56.58.60* %transform, i32 0, i32 0, i32 1, i32 1 + store double 1.000000e+00, double* %arrayidx5.1.1.i, align 4 + store double 0.000000e+00, double* null, align 4 + store double 1.000000e+00, double* null, align 4 + store double 0.000000e+00, double* null, align 4 + %call = tail call double @cos(double %angle) nounwind readnone + %call1 = tail call double @sin(double %angle) nounwind readnone + %0 = load double* %V1, align 4 + %arrayidx2 = getelementptr inbounds double* %V1, i32 1 + %1 = load double* %arrayidx2, align 4 + %mul = fmul double %0, %1 + %sub = fsub double 1.000000e+00, %call + %mul3 = fmul double %mul, %sub + %2 = load double* undef, align 4 + %mul5 = fmul double %2, %call1 + %add = fadd double %mul3, %mul5 + store double %add, double* %arrayidx5.1.i, align 4 + %3 = load double* %V1, align 4 + %mul11 = fmul double %3, undef + %mul13 = fmul double %mul11, %sub + %4 = load double* %arrayidx2, align 4 + %mul15 = fmul double %4, %call1 + %sub16 = fsub double %mul13, %mul15 + store double %sub16, double* %arrayidx5.2.i, align 4 + %5 = load double* %V1, align 4 + %6 = load double* %arrayidx2, align 4 + %mul22 = fmul double %5, %6 + %mul24 = fmul double %mul22, %sub + %sub27 = fsub double %mul24, undef + store double %sub27, double* %arrayidx5.114.i, align 4 + ret void +} + +declare double @cos(double) nounwind readnone + +declare double @sin(double) nounwind readnone From ahatanaka at mips.com Mon Nov 14 12:56:20 2011 From: ahatanaka at mips.com (Akira Hatanaka) Date: Mon, 14 Nov 2011 18:56:20 -0000 Subject: [llvm-commits] [llvm] r144549 - in /llvm/trunk/lib/Target/Mips: MipsFrameLowering.cpp MipsISelLowering.cpp MipsMachineFunction.h Message-ID: <20111114185620.6E4CB2A6C131@llvm.org> Author: ahatanak Date: Mon Nov 14 12:56:20 2011 New Revision: 144549 URL: http://llvm.org/viewvc/llvm-project?rev=144549&view=rev Log: Remove variable that keeps the size of area used to save byval or variable argument registers on the callee's stack frame, along with functions that set and get it. It is not necessary to add the size of this area when computing stack size in emitPrologue, since it has already been accounted for in PEI::calculateFrameObjectOffsets. Modified: llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsMachineFunction.h Modified: llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp?rev=144549&r1=144548&r2=144549&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsFrameLowering.cpp Mon Nov 14 12:56:20 2011 @@ -163,7 +163,6 @@ (MFI->getObjectOffset(MipsFI->getGPFI()) + RegSize) : MipsFI->getMaxCallFrameSize(); unsigned StackSize = AlignOffset(LocalVarAreaOffset, StackAlign) + - AlignOffset(MipsFI->getRegSaveAreaSize(), StackAlign) + AlignOffset(MFI->getStackSize(), StackAlign); // Update stack size Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=144549&r1=144548&r2=144549&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Nov 14 12:56:20 2011 @@ -2459,7 +2459,6 @@ if (IsRegLoc) { Reg = std::find(Mips64IntRegs, Mips64IntRegs + 8, VA.getLocReg()); FOOffset = (Reg - Mips64IntRegs) * 8 - 8 * 8; - MipsFI->setRegSaveAreaSize(-FOOffset); } else FOOffset = VA.getLocMemOffset(); Modified: llvm/trunk/lib/Target/Mips/MipsMachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsMachineFunction.h?rev=144549&r1=144548&r2=144549&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsMachineFunction.h (original) +++ llvm/trunk/lib/Target/Mips/MipsMachineFunction.h Mon Nov 14 12:56:20 2011 @@ -51,16 +51,12 @@ mutable int DynAllocFI; // Frame index of dynamically allocated stack area. unsigned MaxCallFrameSize; - // Size of area on callee's stack frame which is used to save va_arg or - // byval arguments passed in registers. - unsigned RegSaveAreaSize; - public: MipsFunctionInfo(MachineFunction& MF) : MF(MF), SRetReturnReg(0), GlobalBaseReg(0), VarArgsFrameIndex(0), InArgFIRange(std::make_pair(-1, 0)), OutArgFIRange(std::make_pair(-1, 0)), GPFI(0), DynAllocFI(0), - MaxCallFrameSize(0), RegSaveAreaSize(0) + MaxCallFrameSize(0) {} bool isInArgFI(int FI) const { @@ -104,11 +100,6 @@ unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; } void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; } - - unsigned getRegSaveAreaSize() const { return RegSaveAreaSize; } - void setRegSaveAreaSize(unsigned S) { - if (RegSaveAreaSize < S) RegSaveAreaSize = S; - } }; } // end of namespace llvm From peckw at wesleypeck.com Mon Nov 14 12:56:41 2011 From: peckw at wesleypeck.com (Wesley Peck) Date: Mon, 14 Nov 2011 18:56:41 -0000 Subject: [llvm-commits] [llvm] r144550 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <20111114185641.AC52E2A6C131@llvm.org> Author: peckw Date: Mon Nov 14 12:56:41 2011 New Revision: 144550 URL: http://llvm.org/viewvc/llvm-project?rev=144550&view=rev Log: Add release notes for the MicroBlaze backend. Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=144550&r1=144549&r2=144550&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Mon Nov 14 12:56:41 2011 @@ -977,6 +977,11 @@

PPC32/ELF va_arg was implemented.

PPC32 initial support for .o file writing was implemented.

+

MicroBlaze scheduling itineraries were added that model the + 3-stage and the 5-stage pipeline architectures. The 3-stage + pipeline model can be selected with -mcpu=mblaze3 + and the 5-stage pipeline model can be selected with + -mcpu=mblaze5.

    +

    + Introduction +

    + + +
    +

    Objective C provides a simpler way to declare and define accessor methods +using declared properties. The language provides features to declare a +property and to let compiler synthesize accessor methods. +

    + +

    The debugger lets developer inspect Objective C interfaces and their +instance variables and class variables. However, the debugger does not know +anything about the properties defined in Objective C interfaces. The debugger +consumes information generated by compiler in DWARF format. The format does +not support encoding of Objective C properties. This proposal describes DWARF +extensions to encode Objective C properties, which the debugger can use to let +developers inspect Objective C properties. +

    + +
    + + + +

    + Proposal +

    + + +
    +

    Objective C properties are always backed by an instance variable. The +instance variables backing properties are identified using +DW_AT_APPLE_property_name attribute. The instance variables with this +attribute may not have data location attributes. The location of instance +variables is determined by debugger only after consulting Objective C runtime. +

    + +
    +
    + at interface I1 { 
    +  int n2;
    +} 
    +
    + at property p1; 
    + at property p2; 
    + at end
    +
    + at implementation I1 
    + at synthesize p1; 
    + at synthesize p2 = n2; 
    + at end
    +
    +
    +TAG_structure_type [7] * 
    +  AT_APPLE_runtime_class( 0x10 )
    +  AT_name( "I1" )
    +  AT_decl_file( "Objc_Property.m" ) 
    +  AT_decl_line( 3 )
    +
    +  TAG_member [8] 
    +    AT_name( "p1" )
    +    AT_APPLE_property_name(???p1???) 
    +    AT_type( {0x00000147} ( int ) )
    +
    +  TAG_member [8] 
    +    AT_name( "n2" )
    +    AT_APPLE_property_name(???p2???) 
    +    AT_type( {0x00000147} ( int ) )
    +
    +
    + +

    Developers can decorate a property with attributes which are encoded using +DW_AT_APPLE_property_attribute. +

    + +
    +
    + at property (readonly, nonatomic) int pr;
    +
    +
    +TAG_member [8] 
    +  AT_name(???pr???) 
    +  AT_APPLE_property_name(???pr???) 
    +  AT_type ( {0x00000147} (int) ) 
    +  AT_APPLE_property_attribute (DW_APPLE_PROPERTY_readonly, DW_APPLE_PROPERTY_nonatomic)
    +
    +
    + +

    The setter and getter method names are attached to the property using +DW_AT_APPLE_property_setter and DW_AT_APPLE_property_getter attributes. +

    +
    +
    + at interface I1 
    + at property (setter=myOwnP3Setter:) int p3; 
    +-(void)myOwnP3Setter:(int)a; 
    + at end
    +
    + at implementation I1 
    + at synthesize p3;
    +-(void)myOwnP3Setter:(int)a{ } 
    + at end
    +
    +0x000003bd: TAG_structure_type [7] * 
    +              AT_APPLE_runtime_class( 0x10 )
    +              AT_name( "I1" )
    +              AT_decl_file( "Objc_Property.m" ) 
    +              AT_decl_line( 3 )
    +0x000003f3: TAG_member [8] 
    +              AT_name( "p3" ) 
    +              AT_APPLE_property_name(???p3???) 
    +              AT_APPLE_property_setter(???myOwnP3Setter:???)
    +              AT_type( {0x00000147} ( int ) )
    +
    +
    + +
    + + +

    + New DWARF Attributes +

    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeValueClasses
    DW_AT_APPLE_property_name0x3fe8String
    DW_AT_APPLE_property_getter0x3fe9String
    DW_AT_APPLE_property_setter0x3feaString
    DW_AT_APPLE_property_attribute0x3febConstant
    + +
    + + +

    + New DWARF Constants +

    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameValue
    DW_AT_APPLE_PROPERTY_readonly0x1
    DW_AT_APPLE_PROPERTY_readwrite0x2
    DW_AT_APPLE_PROPERTY_assign0x4
    DW_AT_APPLE_PROPERTY_retain0x8
    DW_AT_APPLE_PROPERTY_copy0x10
    DW_AT_APPLE_PROPERTY_nonatomic0x20
    + +
    + + + +
    +
    + Valid CSS + Valid HTML 4.01 + + LLVM Compiler Infrastructure
    + Last modified: $Date: 2011-11-14 $ +
    + + + From dpatel at apple.com Mon Nov 14 19:14:37 2011 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Nov 2011 01:14:37 -0000 Subject: [llvm-commits] [llvm] r144600 - /llvm/trunk/docs/index.html Message-ID: <20111115011437.85FCD2A6C131@llvm.org> Author: dpatel Date: Mon Nov 14 19:14:37 2011 New Revision: 144600 URL: http://llvm.org/viewvc/llvm-project?rev=144600&view=rev Log: Add ObjCPropertyDebugInfo.html Modified: llvm/trunk/docs/index.html Modified: llvm/trunk/docs/index.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/index.html?rev=144600&r1=144599&r2=144600&view=diff ============================================================================== --- llvm/trunk/docs/index.html (original) +++ llvm/trunk/docs/index.html Mon Nov 14 19:14:37 2011 @@ -212,6 +212,9 @@
  • Branch Weight Metadata - Provides information about Branch Prediction Information.
  • +
  • Objective C Property Debug Info +- Debugging information extension for Objective C Property.
  • +
From stoklund at 2pi.dk Mon Nov 14 19:15:25 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 15 Nov 2011 01:15:25 -0000 Subject: [llvm-commits] [llvm] r144601 - /llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp Message-ID: <20111115011525.697722A6C131@llvm.org> Author: stoklund Date: Mon Nov 14 19:15:25 2011 New Revision: 144601 URL: http://llvm.org/viewvc/llvm-project?rev=144601&view=rev Log: Track register ages more accurately. Keep track of the last instruction to define each register individually instead of per DomainValue. This lets us track more accurately when a register was last written. Also track register ages across basic blocks. When entering a new basic block, use the least stale predecessor def as a worst case estimate for register age. The register age is used to arbitrate between conflicting domains. The most recently defined register wins. Modified: llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp Modified: llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp?rev=144601&r1=144600&r2=144601&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp (original) +++ llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp Mon Nov 14 19:15:25 2011 @@ -45,7 +45,7 @@ /// DomainValue for each register, but it may contain multiple execution /// domains. A register value is initially created in a single execution /// domain, but if we were forced to pay the penalty of a domain crossing, we -/// keep track of the fact the the register is now available in multiple +/// keep track of the fact that the register is now available in multiple /// domains. namespace { struct DomainValue { @@ -57,9 +57,6 @@ // domains where the register is available for free. unsigned AvailableDomains; - // Position of the last defining instruction. - unsigned Dist; - // Pointer to the next DomainValue in a chain. When two DomainValues are // merged, Victim.Next is set to point to Victor, so old DomainValue // references can be updated by folowing the chain. @@ -101,7 +98,7 @@ // Clear this DomainValue and point to next which has all its data. void clear() { - AvailableDomains = Dist = 0; + AvailableDomains = 0; Next = 0; Instrs.clear(); } @@ -109,6 +106,21 @@ } namespace { +/// LiveReg - Information about a live register. +struct LiveReg { + /// Value currently in this register, or NULL when no value is being tracked. + /// This counts as a DomainValue reference. + DomainValue *Value; + + /// Instruction that defined this register, relative to the beginning of the + /// current basic block. When a LiveReg is used to represent a live-out + /// register, this value is relative to the end of the basic block, so it + /// will be a negative number. + int Def; +}; +} // anonynous namespace + +namespace { class ExeDepsFix : public MachineFunctionPass { static char ID; SpecificBumpPtrAllocator Allocator; @@ -120,10 +132,17 @@ const TargetRegisterInfo *TRI; std::vector AliasMap; const unsigned NumRegs; - DomainValue **LiveRegs; - typedef DenseMap LiveOutMap; + LiveReg *LiveRegs; + typedef DenseMap LiveOutMap; LiveOutMap LiveOuts; - unsigned Distance; + + /// Current instruction number. + /// The first instruction in each basic block is 0. + int CurInstr; + + /// True when the current block has a predecessor that hasn't been visited + /// yet. + bool SeenUnknownBackEdge; public: ExeDepsFix(const TargetRegisterClass *rc) @@ -160,10 +179,10 @@ void collapse(DomainValue *dv, unsigned domain); bool merge(DomainValue *A, DomainValue *B); - bool enterBasicBlock(MachineBasicBlock*); + void enterBasicBlock(MachineBasicBlock*); void leaveBasicBlock(MachineBasicBlock*); void visitInstr(MachineInstr*); - void visitGenericInstr(MachineInstr*); + void processDefs(MachineInstr*, bool Kill); void visitSoftInstr(MachineInstr*, unsigned mask); void visitHardInstr(MachineInstr*, unsigned domain); }; @@ -182,7 +201,6 @@ DomainValue *dv = Avail.empty() ? new(Allocator.Allocate()) DomainValue : Avail.pop_back_val(); - dv->Dist = Distance; if (domain >= 0) dv->addDomain(domain); assert(dv->Refs == 0 && "Reference count wasn't cleared"); @@ -231,32 +249,31 @@ /// Set LiveRegs[rx] = dv, updating reference counts. void ExeDepsFix::setLiveReg(int rx, DomainValue *dv) { assert(unsigned(rx) < NumRegs && "Invalid index"); - if (!LiveRegs) { - LiveRegs = new DomainValue*[NumRegs]; - std::fill(LiveRegs, LiveRegs+NumRegs, (DomainValue*)0); - } + assert(LiveRegs && "Must enter basic block first."); - if (LiveRegs[rx] == dv) + if (LiveRegs[rx].Value == dv) return; - if (LiveRegs[rx]) - release(LiveRegs[rx]); - LiveRegs[rx] = retain(dv); + if (LiveRegs[rx].Value) + release(LiveRegs[rx].Value); + LiveRegs[rx].Value = retain(dv); } // Kill register rx, recycle or collapse any DomainValue. void ExeDepsFix::kill(int rx) { assert(unsigned(rx) < NumRegs && "Invalid index"); - if (!LiveRegs || !LiveRegs[rx]) return; + assert(LiveRegs && "Must enter basic block first."); + if (!LiveRegs[rx].Value) + return; - release(LiveRegs[rx]); - LiveRegs[rx] = 0; + release(LiveRegs[rx].Value); + LiveRegs[rx].Value = 0; } /// Force register rx into domain. void ExeDepsFix::force(int rx, unsigned domain) { assert(unsigned(rx) < NumRegs && "Invalid index"); - DomainValue *dv; - if (LiveRegs && (dv = LiveRegs[rx])) { + assert(LiveRegs && "Must enter basic block first."); + if (DomainValue *dv = LiveRegs[rx].Value) { if (dv->isCollapsed()) dv->addDomain(domain); else if (dv->hasDomain(domain)) @@ -265,8 +282,8 @@ // This is an incompatible open DomainValue. Collapse it to whatever and // force the new value into domain. This costs a domain crossing. collapse(dv, dv->getFirstDomain()); - assert(LiveRegs[rx] && "Not live after collapse?"); - LiveRegs[rx]->addDomain(domain); + assert(LiveRegs[rx].Value && "Not live after collapse?"); + LiveRegs[rx].Value->addDomain(domain); } } else { // Set up basic collapsed DomainValue. @@ -287,7 +304,7 @@ // If there are multiple users, give them new, unique DomainValues. if (LiveRegs && dv->Refs > 1) for (unsigned rx = 0; rx != NumRegs; ++rx) - if (LiveRegs[rx] == dv) + if (LiveRegs[rx].Value == dv) setLiveReg(rx, alloc(domain)); } @@ -303,7 +320,6 @@ if (!common) return false; A->AvailableDomains = common; - A->Dist = std::max(A->Dist, B->Dist); A->Instrs.append(B->Instrs.begin(), B->Instrs.end()); // Clear the old DomainValue so we won't try to swizzle instructions twice. @@ -312,66 +328,103 @@ B->Next = retain(A); for (unsigned rx = 0; rx != NumRegs; ++rx) - if (LiveRegs[rx] == B) + if (LiveRegs[rx].Value == B) setLiveReg(rx, A); return true; } // enterBasicBlock - Set up LiveRegs by merging predecessor live-out values. -// Return true if some predecessor hasn't been processed yet (like on a loop -// back-edge). -bool ExeDepsFix::enterBasicBlock(MachineBasicBlock *MBB) { +void ExeDepsFix::enterBasicBlock(MachineBasicBlock *MBB) { // Detect back-edges from predecessors we haven't processed yet. - bool seenBackEdge = false; + SeenUnknownBackEdge = false; - // Try to coalesce live-out registers from predecessors. - for (MachineBasicBlock::livein_iterator i = MBB->livein_begin(), + // Reset instruction counter in each basic block. + CurInstr = 0; + + // Set up LiveRegs to represent registers entering MBB. + if (!LiveRegs) + LiveRegs = new LiveReg[NumRegs]; + + // Default values are 'nothing happened a long time ago'. + for (unsigned rx = 0; rx != NumRegs; ++rx) { + LiveRegs[rx].Value = 0; + LiveRegs[rx].Def = -(1 << 20); + } + + // This is the entry block. + if (MBB->pred_empty()) { + for (MachineBasicBlock::livein_iterator i = MBB->livein_begin(), e = MBB->livein_end(); i != e; ++i) { - int rx = regIndex(*i); - if (rx < 0) continue; - for (MachineBasicBlock::const_pred_iterator pi = MBB->pred_begin(), - pe = MBB->pred_end(); pi != pe; ++pi) { - LiveOutMap::const_iterator fi = LiveOuts.find(*pi); - if (fi == LiveOuts.end()) { - seenBackEdge = true; + int rx = regIndex(*i); + if (rx < 0) continue; - } - if (!fi->second) + // Treat function live-ins as if they were defined just before the first + // instruction. Usually, function arguments are set up immediately + // before the call. + LiveRegs[rx].Def = -1; + } + DEBUG(dbgs() << "BB#" << MBB->getNumber() << ": entry\n"); + return; + } + + // Try to coalesce live-out registers from predecessors. + for (MachineBasicBlock::const_pred_iterator pi = MBB->pred_begin(), + pe = MBB->pred_end(); pi != pe; ++pi) { + LiveOutMap::const_iterator fi = LiveOuts.find(*pi); + if (fi == LiveOuts.end()) { + SeenUnknownBackEdge = true; + continue; + } + assert(fi->second && "Can't have NULL entries"); + + for (unsigned rx = 0; rx != NumRegs; ++rx) { + // Use the most recent predecessor def for each register. + LiveRegs[rx].Def = std::max(LiveRegs[rx].Def, fi->second[rx].Def); + + DomainValue *pdv = resolve(fi->second[rx].Value); + if (!pdv) continue; - DomainValue *pdv = resolve(fi->second[rx]); - if (!pdv) continue; - if (!LiveRegs || !LiveRegs[rx]) { + if (!LiveRegs[rx].Value) { setLiveReg(rx, pdv); continue; } // We have a live DomainValue from more than one predecessor. - if (LiveRegs[rx]->isCollapsed()) { + if (LiveRegs[rx].Value->isCollapsed()) { // We are already collapsed, but predecessor is not. Force him. - unsigned domain = LiveRegs[rx]->getFirstDomain(); - if (!pdv->isCollapsed() && pdv->hasDomain(domain)) - collapse(pdv, domain); + unsigned Domain = LiveRegs[rx].Value->getFirstDomain(); + if (!pdv->isCollapsed() && pdv->hasDomain(Domain)) + collapse(pdv, Domain); continue; } // Currently open, merge in predecessor. if (!pdv->isCollapsed()) - merge(LiveRegs[rx], pdv); + merge(LiveRegs[rx].Value, pdv); else force(rx, pdv->getFirstDomain()); } } - return seenBackEdge; + DEBUG(dbgs() << "BB#" << MBB->getNumber() + << (SeenUnknownBackEdge ? ": incomplete\n" : ": all preds known\n")); } void ExeDepsFix::leaveBasicBlock(MachineBasicBlock *MBB) { + assert(LiveRegs && "Must enter basic block first."); // Save live registers at end of MBB - used by enterBasicBlock(). // Also use LiveOuts as a visited set to detect back-edges. - if (!LiveOuts.insert(std::make_pair(MBB, LiveRegs)).second && LiveRegs) { + bool First = LiveOuts.insert(std::make_pair(MBB, LiveRegs)).second; + + if (First) { + // LiveRegs was inserted in LiveOuts. Adjust all defs to be relative to + // the end of this block instead of the beginning. + for (unsigned i = 0, e = NumRegs; i != e; ++i) + LiveRegs[i].Def -= CurInstr; + } else { // Insertion failed, this must be the second pass. // Release all the DomainValues instead of keeping them. for (unsigned i = 0, e = NumRegs; i != e; ++i) - release(LiveRegs[i]); + release(LiveRegs[i].Value); delete[] LiveRegs; } LiveRegs = 0; @@ -380,15 +433,52 @@ void ExeDepsFix::visitInstr(MachineInstr *MI) { if (MI->isDebugValue()) return; - ++Distance; - std::pair domp = TII->getExecutionDomain(MI); - if (domp.first) - if (domp.second) - visitSoftInstr(MI, domp.second); + + // Update instructions with explicit execution domains. + std::pair DomP = TII->getExecutionDomain(MI); + if (DomP.first) { + if (DomP.second) + visitSoftInstr(MI, DomP.second); else - visitHardInstr(MI, domp.first); - else if (LiveRegs) - visitGenericInstr(MI); + visitHardInstr(MI, DomP.first); + } + + // Process defs to track register ages, and kill values clobbered by generic + // instructions. + processDefs(MI, !DomP.first); +} + +// Update def-ages for registers defined by MI. +// If Kill is set, also kill off DomainValues clobbered by the defs. +void ExeDepsFix::processDefs(MachineInstr *MI, bool Kill) { + assert(!MI->isDebugValue() && "Won't process debug values"); + const MCInstrDesc &MCID = MI->getDesc(); + for (unsigned i = 0, + e = MCID.isVariadic() ? MI->getNumOperands() : MCID.getNumDefs(); + i != e; ++i) { + MachineOperand &MO = MI->getOperand(i); + if (!MO.isReg()) + continue; + if (MO.isImplicit()) + break; + if (MO.isUse()) + continue; + int rx = regIndex(MO.getReg()); + if (rx < 0) + continue; + + // This instruction explicitly defines rx. + DEBUG(dbgs() << TRI->getName(RC->getRegister(rx)) << ":\t" << CurInstr + << '\t' << *MI); + + LiveRegs[rx].Def = CurInstr; + + // Kill off domains redefined by generic instructions. + if (Kill) + kill(rx); + } + + ++CurInstr; } // A hard instruction only works in one domain. All input registers will be @@ -430,7 +520,7 @@ if (!mo.isReg()) continue; int rx = regIndex(mo.getReg()); if (rx < 0) continue; - if (DomainValue *dv = LiveRegs[rx]) { + if (DomainValue *dv = LiveRegs[rx].Value) { // Bitmask of domains that dv and available have in common. unsigned common = dv->getCommonDomains(available); // Is it possible to use this collapsed register for free? @@ -459,52 +549,53 @@ // Kill off any remaining uses that don't match available, and build a list of // incoming DomainValues that we want to merge. - SmallVector doms; + SmallVector Regs; for (SmallVector::iterator i=used.begin(), e=used.end(); i!=e; ++i) { int rx = *i; - DomainValue *dv = LiveRegs[rx]; + const LiveReg &LR = LiveRegs[rx]; // This useless DomainValue could have been missed above. - if (!dv->getCommonDomains(available)) { - kill(*i); + if (!LR.Value->getCommonDomains(available)) { + kill(rx); continue; } - // sorted, uniqued insert. - bool inserted = false; - for (SmallVector::iterator i = doms.begin(), e = doms.end(); - i != e && !inserted; ++i) { - if (dv == *i) - inserted = true; - else if (dv->Dist < (*i)->Dist) { - inserted = true; - doms.insert(i, dv); + // Sorted insertion. + bool Inserted = false; + for (SmallVector::iterator i = Regs.begin(), e = Regs.end(); + i != e && !Inserted; ++i) { + if (LR.Def < i->Def) { + Inserted = true; + Regs.insert(i, LR); } } - if (!inserted) - doms.push_back(dv); + if (!Inserted) + Regs.push_back(LR); } // doms are now sorted in order of appearance. Try to merge them all, giving // priority to the latest ones. DomainValue *dv = 0; - while (!doms.empty()) { + while (!Regs.empty()) { if (!dv) { - dv = doms.pop_back_val(); + dv = Regs.pop_back_val().Value; continue; } - DomainValue *latest = doms.pop_back_val(); - if (merge(dv, latest)) continue; + DomainValue *Latest = Regs.pop_back_val().Value; + // Skip already merged values. + if (Latest == dv || Latest->Next) + continue; + if (merge(dv, Latest)) + continue; // If latest didn't merge, it is useless now. Kill all registers using it. for (SmallVector::iterator i=used.begin(), e=used.end(); i != e; ++i) - if (LiveRegs[*i] == latest) + if (LiveRegs[*i].Value == Latest) kill(*i); } // dv is the DomainValue we are going to use for this instruction. if (!dv) dv = alloc(); - dv->Dist = Distance; dv->AvailableDomains = available; dv->Instrs.push_back(mi); @@ -514,32 +605,23 @@ if (!mo.isReg()) continue; int rx = regIndex(mo.getReg()); if (rx < 0) continue; - if (!LiveRegs || !LiveRegs[rx] || (mo.isDef() && LiveRegs[rx]!=dv)) { + if (!LiveRegs[rx].Value || (mo.isDef() && LiveRegs[rx].Value != dv)) { kill(rx); setLiveReg(rx, dv); } } } -void ExeDepsFix::visitGenericInstr(MachineInstr *mi) { - // Process explicit defs, kill any relevant registers redefined. - for (unsigned i = 0, e = mi->getDesc().getNumDefs(); i != e; ++i) { - MachineOperand &mo = mi->getOperand(i); - if (!mo.isReg()) continue; - int rx = regIndex(mo.getReg()); - if (rx < 0) continue; - kill(rx); - } -} - bool ExeDepsFix::runOnMachineFunction(MachineFunction &mf) { MF = &mf; TII = MF->getTarget().getInstrInfo(); TRI = MF->getTarget().getRegisterInfo(); LiveRegs = 0; - Distance = 0; assert(NumRegs == RC->getNumRegs() && "Bad regclass"); + DEBUG(dbgs() << "********** FIX EXECUTION DEPENDENCIES: " + << RC->getName() << " **********\n"); + // If no relevant registers are used in the function, we can skip it // completely. bool anyregs = false; @@ -567,7 +649,8 @@ for (ReversePostOrderTraversal::rpo_iterator MBBI = RPOT.begin(), MBBE = RPOT.end(); MBBI != MBBE; ++MBBI) { MachineBasicBlock *MBB = *MBBI; - if (enterBasicBlock(MBB)) + enterBasicBlock(MBB); + if (SeenUnknownBackEdge) Loops.push_back(MBB); for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) @@ -590,8 +673,8 @@ if (FI == LiveOuts.end() || !FI->second) continue; for (unsigned i = 0, e = NumRegs; i != e; ++i) - if (FI->second[i]) - release(FI->second[i]); + if (FI->second[i].Value) + release(FI->second[i].Value); delete[] FI->second; } LiveOuts.clear(); From stoklund at 2pi.dk Mon Nov 14 19:15:30 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 15 Nov 2011 01:15:30 -0000 Subject: [llvm-commits] [llvm] r144602 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/ExecutionDepsFix.cpp lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86InstrInfo.h test/CodeGen/X86/sse-domains.ll Message-ID: <20111115011530.9497C2A6C131@llvm.org> Author: stoklund Date: Mon Nov 14 19:15:30 2011 New Revision: 144602 URL: http://llvm.org/viewvc/llvm-project?rev=144602&view=rev Log: Break false dependencies before partial register updates. Two new TargetInstrInfo hooks lets the target tell ExecutionDepsFix about instructions with partial register updates causing false unwanted dependencies. The ExecutionDepsFix pass will break the false dependencies if the updated register was written in the previoius N instructions. The small loop added to sse-domains.ll runs twice as fast with dependency-breaking instructions inserted. Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/test/CodeGen/X86/sse-domains.ll Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=144602&r1=144601&r2=144602&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Nov 14 19:15:30 2011 @@ -718,6 +718,74 @@ /// virtual void setExecutionDomain(MachineInstr *MI, unsigned Domain) const {} + + /// getPartialRegUpdateClearance - Returns the preferred minimum clearance + /// before an instruction with an unwanted partial register update. + /// + /// Some instructions only write part of a register, and implicitly need to + /// read the other parts of the register. This may cause unwanted stalls + /// preventing otherwise unrelated instructions from executing in parallel in + /// an out-of-order CPU. + /// + /// For example, the x86 instruction cvtsi2ss writes its result to bits + /// [31:0] of the destination xmm register. Bits [127:32] are unaffected, so + /// the instruction needs to wait for the old value of the register to become + /// available: + /// + /// addps %xmm1, %xmm0 + /// movaps %xmm0, (%rax) + /// cvtsi2ss %rbx, %xmm0 + /// + /// In the code above, the cvtsi2ss instruction needs to wait for the addps + /// instruction before it can issue, even though the high bits of %xmm0 + /// probably aren't needed. + /// + /// This hook returns the preferred clearance before MI, measured in + /// instructions. Other defs of MI's operand OpNum are avoided in the last N + /// instructions before MI. It should only return a positive value for + /// unwanted dependencies. If the old bits of the defined register have + /// useful values, or if MI is determined to otherwise read the dependency, + /// the hook should return 0. + /// + /// The unwanted dependency may be handled by: + /// + /// 1. Allocating the same register for an MI def and use. That makes the + /// unwanted dependency identical to a required dependency. + /// + /// 2. Allocating a register for the def that has no defs in the previous N + /// instructions. + /// + /// 3. Calling breakPartialRegDependency() with the same arguments. This + /// allows the target to insert a dependency breaking instruction. + /// + virtual unsigned + getPartialRegUpdateClearance(const MachineInstr *MI, unsigned OpNum, + const TargetRegisterInfo *TRI) const { + // The default implementation returns 0 for no partial register dependency. + return 0; + } + + /// breakPartialRegDependency - Insert a dependency-breaking instruction + /// before MI to eliminate an unwanted dependency on OpNum. + /// + /// If it wasn't possible to avoid a def in the last N instructions before MI + /// (see getPartialRegUpdateClearance), this hook will be called to break the + /// unwanted dependency. + /// + /// On x86, an xorps instruction can be used as a dependency breaker: + /// + /// addps %xmm1, %xmm0 + /// movaps %xmm0, (%rax) + /// xorps %xmm0, %xmm0 + /// cvtsi2ss %rbx, %xmm0 + /// + /// An operand should be added to MI if an instruction was + /// inserted. This ties the instructions together in the post-ra scheduler. + /// + virtual void + breakPartialRegDependency(MachineBasicBlock::iterator MI, unsigned OpNum, + const TargetRegisterInfo *TRI) const {} + private: int CallFrameSetupOpcode, CallFrameDestroyOpcode; }; Modified: llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp?rev=144602&r1=144601&r2=144602&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp (original) +++ llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp Mon Nov 14 19:15:30 2011 @@ -471,11 +471,34 @@ DEBUG(dbgs() << TRI->getName(RC->getRegister(rx)) << ":\t" << CurInstr << '\t' << *MI); + // How many instructions since rx was last written? + unsigned Clearance = CurInstr - LiveRegs[rx].Def; LiveRegs[rx].Def = CurInstr; // Kill off domains redefined by generic instructions. if (Kill) kill(rx); + + // Verify clearance before partial register updates. + unsigned Pref = TII->getPartialRegUpdateClearance(MI, i, TRI); + if (!Pref) + continue; + DEBUG(dbgs() << "Clearance: " << Clearance << ", want " << Pref); + if (Pref > Clearance) { + DEBUG(dbgs() << ": Break dependency.\n"); + TII->breakPartialRegDependency(MI, i, TRI); + continue; + } + + // The current clearance seems OK, but we may be ignoring a def from a + // back-edge. + if (!SeenUnknownBackEdge || Pref <= unsigned(CurInstr)) { + DEBUG(dbgs() << ": OK.\n"); + continue; + } + + // A def from an unprocessed back-edge may make us break this dependency. + DEBUG(dbgs() << ": Wait for back-edge to resolve.\n"); } ++CurInstr; @@ -663,6 +686,10 @@ for (unsigned i = 0, e = Loops.size(); i != e; ++i) { MachineBasicBlock *MBB = Loops[i]; enterBasicBlock(MBB); + for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; + ++I) + if (!I->isDebugValue()) + processDefs(I, false); leaveBasicBlock(MBB); } Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=144602&r1=144601&r2=144602&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Nov 14 19:15:30 2011 @@ -2761,6 +2761,10 @@ /// static bool hasPartialRegUpdate(unsigned Opcode) { switch (Opcode) { + case X86::CVTSI2SSrr: + case X86::CVTSI2SS64rr: + case X86::CVTSI2SDrr: + case X86::CVTSI2SD64rr: case X86::CVTSD2SSrr: case X86::Int_CVTSD2SSrr: case X86::CVTSS2SDrr: @@ -2789,6 +2793,54 @@ return false; } +/// getPartialRegUpdateClearance - Inform the ExeDepsFix pass how many idle +/// instructions we would like before a partial register update. +unsigned X86InstrInfo:: +getPartialRegUpdateClearance(const MachineInstr *MI, unsigned OpNum, + const TargetRegisterInfo *TRI) const { + if (OpNum != 0 || !hasPartialRegUpdate(MI->getOpcode())) + return 0; + + // If MI is marked as reading Reg, the partial register update is wanted. + const MachineOperand &MO = MI->getOperand(0); + unsigned Reg = MO.getReg(); + if (TargetRegisterInfo::isVirtualRegister(Reg)) { + if (MO.readsReg() || MI->readsVirtualRegister(Reg)) + return 0; + } else { + if (MI->readsRegister(Reg, TRI)) + return 0; + } + + // If any of the preceding 16 instructions are reading Reg, insert a + // dependency breaking instruction. The magic number is based on a few + // Nehalem experiments. + return 16; +} + +void X86InstrInfo:: +breakPartialRegDependency(MachineBasicBlock::iterator MI, unsigned OpNum, + const TargetRegisterInfo *TRI) const { + unsigned Reg = MI->getOperand(OpNum).getReg(); + if (X86::VR128RegClass.contains(Reg)) { + // These instructions are all floating point domain, so xorps is the best + // choice. + bool HasAVX = TM.getSubtarget().hasAVX(); + unsigned Opc = HasAVX ? X86::VXORPSrr : X86::XORPSrr; + BuildMI(*MI->getParent(), MI, MI->getDebugLoc(), get(Opc), Reg) + .addReg(Reg, RegState::Undef).addReg(Reg, RegState::Undef); + } else if (X86::VR256RegClass.contains(Reg)) { + // Use vxorps to clear the full ymm register. + // It wants to read and write the xmm sub-register. + unsigned XReg = TRI->getSubReg(Reg, X86::sub_xmm); + BuildMI(*MI->getParent(), MI, MI->getDebugLoc(), get(X86::VXORPSrr), XReg) + .addReg(XReg, RegState::Undef).addReg(XReg, RegState::Undef) + .addReg(Reg, RegState::ImplicitDefine); + } else + return; + MI->addRegisterKilled(Reg, TRI, true); +} + MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF, MachineInstr *MI, const SmallVectorImpl &Ops, Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=144602&r1=144601&r2=144602&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Mon Nov 14 19:15:30 2011 @@ -345,6 +345,11 @@ void setExecutionDomain(MachineInstr *MI, unsigned Domain) const; + unsigned getPartialRegUpdateClearance(const MachineInstr *MI, unsigned OpNum, + const TargetRegisterInfo *TRI) const; + void breakPartialRegDependency(MachineBasicBlock::iterator MI, unsigned OpNum, + const TargetRegisterInfo *TRI) const; + MachineInstr* foldMemoryOperandImpl(MachineFunction &MF, MachineInstr* MI, unsigned OpNum, Modified: llvm/trunk/test/CodeGen/X86/sse-domains.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sse-domains.ll?rev=144602&r1=144601&r2=144602&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/sse-domains.ll (original) +++ llvm/trunk/test/CodeGen/X86/sse-domains.ll Mon Nov 14 19:15:30 2011 @@ -43,3 +43,44 @@ while.end: ret void } + +; CHECK: f2 +; +; This loop contains two cvtsi2ss instructions that update the same xmm +; register. Verify that the execution dependency fix pass breaks those +; dependencies by inserting xorps instructions. +; +; If the register allocator chooses different registers for the two cvtsi2ss +; instructions, they are still dependent on themselves. +; CHECK: xorps [[XMM1:%xmm[0-9]+]] +; CHECK: , [[XMM1]] +; CHECK: cvtsi2ss %{{.*}}, [[XMM1]] +; CHECK: xorps [[XMM2:%xmm[0-9]+]] +; CHECK: , [[XMM2]] +; CHECK: cvtsi2ss %{{.*}}, [[XMM2]] +; +define float @f2(i32 %m) nounwind uwtable readnone ssp { +entry: + %tobool3 = icmp eq i32 %m, 0 + br i1 %tobool3, label %for.end, label %for.body + +for.body: ; preds = %entry, %for.body + %m.addr.07 = phi i32 [ %dec, %for.body ], [ %m, %entry ] + %s1.06 = phi float [ %add, %for.body ], [ 0.000000e+00, %entry ] + %s2.05 = phi float [ %add2, %for.body ], [ 0.000000e+00, %entry ] + %n.04 = phi i32 [ %inc, %for.body ], [ 1, %entry ] + %conv = sitofp i32 %n.04 to float + %add = fadd float %s1.06, %conv + %conv1 = sitofp i32 %m.addr.07 to float + %add2 = fadd float %s2.05, %conv1 + %inc = add nsw i32 %n.04, 1 + %dec = add nsw i32 %m.addr.07, -1 + %tobool = icmp eq i32 %dec, 0 + br i1 %tobool, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + %s1.0.lcssa = phi float [ 0.000000e+00, %entry ], [ %add, %for.body ] + %s2.0.lcssa = phi float [ 0.000000e+00, %entry ], [ %add2, %for.body ] + %sub = fsub float %s1.0.lcssa, %s2.0.lcssa + ret float %sub +} From nicholas at mxc.ca Mon Nov 14 19:23:23 2011 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 15 Nov 2011 01:23:23 -0000 Subject: [llvm-commits] [llvm] r144603 - in /llvm/trunk: include/llvm/Support/Valgrind.h lib/Support/Valgrind.cpp Message-ID: <20111115012323.356B52A6C131@llvm.org> Author: nicholas Date: Mon Nov 14 19:23:22 2011 New Revision: 144603 URL: http://llvm.org/viewvc/llvm-project?rev=144603&view=rev Log: Move WEAK marking to the declaration. Modified: llvm/trunk/include/llvm/Support/Valgrind.h llvm/trunk/lib/Support/Valgrind.cpp Modified: llvm/trunk/include/llvm/Support/Valgrind.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Valgrind.h?rev=144603&r1=144602&r2=144603&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Valgrind.h (original) +++ llvm/trunk/include/llvm/Support/Valgrind.h Mon Nov 14 19:23:22 2011 @@ -24,14 +24,12 @@ // tsan (Thread Sanitizer) is a valgrind-based tool that detects these exact // functions by name. extern "C" { -LLVM_ATTRIBUTE_NOINLINE void AnnotateHappensAfter(const char *file, int line, - const volatile void *cv); -LLVM_ATTRIBUTE_NOINLINE void AnnotateHappensBefore(const char *file, int line, - const volatile void *cv); -LLVM_ATTRIBUTE_NOINLINE void AnnotateIgnoreWritesBegin(const char *file, - int line); -LLVM_ATTRIBUTE_NOINLINE void AnnotateIgnoreWritesEnd(const char *file, - int line); +LLVM_ATTRIBUTE_WEAK void AnnotateHappensAfter(const char *file, int line, + const volatile void *cv); +LLVM_ATTRIBUTE_WEAK void AnnotateHappensBefore(const char *file, int line, + const volatile void *cv); +LLVM_ATTRIBUTE_WEAK void AnnotateIgnoreWritesBegin(const char *file, int line); +LLVM_ATTRIBUTE_WEAK void AnnotateIgnoreWritesEnd(const char *file, int line); } #endif Modified: llvm/trunk/lib/Support/Valgrind.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Valgrind.cpp?rev=144603&r1=144602&r2=144603&view=diff ============================================================================== --- llvm/trunk/lib/Support/Valgrind.cpp (original) +++ llvm/trunk/lib/Support/Valgrind.cpp Mon Nov 14 19:23:22 2011 @@ -56,10 +56,10 @@ // These functions require no implementation, tsan just looks at the arguments // they're called with. extern "C" { -LLVM_ATTRIBUTE_WEAK void AnnotateHappensBefore(const char *file, int line, - const volatile void *cv) {} -LLVM_ATTRIBUTE_WEAK void AnnotateHappensAfter(const char *file, int line, - const volatile void *cv) {} -LLVM_ATTRIBUTE_WEAK void AnnotateIgnoreWritesBegin(const char *file, int line){} -LLVM_ATTRIBUTE_WEAK void AnnotateIgnoreWritesEnd(const char *file, int line) {} +void AnnotateHappensBefore(const char *file, int line, + const volatile void *cv) {} +void AnnotateHappensAfter(const char *file, int line, + const volatile void *cv) {} +void AnnotateIgnoreWritesBegin(const char *file, int line) {} +void AnnotateIgnoreWritesEnd(const char *file, int line) {} } From grosbach at apple.com Mon Nov 14 19:46:57 2011 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 15 Nov 2011 01:46:57 -0000 Subject: [llvm-commits] [llvm] r144606 - in /llvm/trunk: lib/Target/ARM/ARMInstrNEON.td utils/TableGen/AsmWriterEmitter.cpp utils/TableGen/CodeGenInstruction.cpp Message-ID: <20111115014657.617422A6C131@llvm.org> Author: grosbach Date: Mon Nov 14 19:46:57 2011 New Revision: 144606 URL: http://llvm.org/viewvc/llvm-project?rev=144606&view=rev Log: ARM parsing datatype suffix variants for fixed-writeback VLD1/VST1 instructions. rdar://10435076 Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=144606&r1=144605&r2=144606&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Mon Nov 14 19:46:57 2011 @@ -5209,6 +5209,15 @@ (VLD1d32 VecListOneD:$Vd, addrmode6:$Rn, pred:$p)>; defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn", (VLD1d64 VecListOneD:$Vd, addrmode6:$Rn, pred:$p)>; +// with writeback, fixed stride +defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d8wb_fixed VecListOneD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d16wb_fixed VecListOneD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d32wb_fixed VecListOneD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d64wb_fixed VecListOneD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; // Load two D registers. defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn", @@ -5219,6 +5228,15 @@ (VLD1q32 VecListTwoD:$Vd, addrmode6:$Rn, pred:$p)>; defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn", (VLD1q64 VecListTwoD:$Vd, addrmode6:$Rn, pred:$p)>; +// with writeback, fixed stride +defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1q8wb_fixed VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1q16wb_fixed VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1q32wb_fixed VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1q64wb_fixed VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; // Load three D registers. defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn", @@ -5229,6 +5247,20 @@ (VLD1d32T VecListThreeD:$Vd, addrmode6:$Rn, pred:$p)>; defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn", (VLD1d64T VecListThreeD:$Vd, addrmode6:$Rn, pred:$p)>; +// with writeback, fixed stride +defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d8Twb_fixed VecListThreeD:$Vd, zero_reg, + addrmode6:$Rn, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d16Twb_fixed VecListThreeD:$Vd, zero_reg, + addrmode6:$Rn, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d32Twb_fixed VecListThreeD:$Vd, zero_reg, + addrmode6:$Rn, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d64Twb_fixed VecListThreeD:$Vd, zero_reg, + addrmode6:$Rn, pred:$p)>; + // Load four D registers. defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn", @@ -5239,9 +5271,22 @@ (VLD1d32Q VecListFourD:$Vd, addrmode6:$Rn, pred:$p)>; defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn", (VLD1d64Q VecListFourD:$Vd, addrmode6:$Rn, pred:$p)>; +// with writeback, fixed stride +defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d8Qwb_fixed VecListFourD:$Vd, zero_reg, + addrmode6:$Rn, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d16Qwb_fixed VecListFourD:$Vd, zero_reg, + addrmode6:$Rn, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d32Qwb_fixed VecListFourD:$Vd, zero_reg, + addrmode6:$Rn, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn!", + (VLD1d64Qwb_fixed VecListFourD:$Vd, zero_reg, + addrmode6:$Rn, pred:$p)>; // VST1 requires a size suffix, but also accepts type specific variants. -// Load one D register. +// Store one D register. defm : VFPDT8ReqInstAlias<"vst1${p}", "$Vd, $Rn", (VST1d8 addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; defm : VFPDT16ReqInstAlias<"vst1${p}", "$Vd, $Rn", @@ -5250,8 +5295,17 @@ (VST1d32 addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; defm : VFPDT64ReqInstAlias<"vst1${p}", "$Vd, $Rn", (VST1d64 addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; +// with writeback, fixed stride +defm : VFPDT8ReqInstAlias<"vst1${p}", "$Vd, $Rn!", + (VST1d8wb_fixed zero_reg, addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vst1${p}", "$Vd, $Rn!", + (VST1d16wb_fixed zero_reg, addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vst1${p}", "$Vd, $Rn!", + (VST1d32wb_fixed zero_reg, addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vst1${p}", "$Vd, $Rn!", + (VST1d64wb_fixed zero_reg, addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; -// Load two D registers. +// Store two D registers. defm : VFPDT8ReqInstAlias<"vst1${p}", "$Vd, $Rn", (VST1q8 addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; defm : VFPDT16ReqInstAlias<"vst1${p}", "$Vd, $Rn", @@ -5260,6 +5314,15 @@ (VST1q32 addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; defm : VFPDT64ReqInstAlias<"vst1${p}", "$Vd, $Rn", (VST1q64 addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; +// with writeback, fixed stride +defm : VFPDT8ReqInstAlias<"vst1${p}", "$Vd, $Rn!", + (VST1q8wb_fixed zero_reg, addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vst1${p}", "$Vd, $Rn!", + (VST1q16wb_fixed zero_reg, addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vst1${p}", "$Vd, $Rn!", + (VST1q32wb_fixed zero_reg, addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vst1${p}", "$Vd, $Rn!", + (VST1q64wb_fixed zero_reg, addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; // FIXME: The three and four register VST1 instructions haven't been moved // to the VecList* encoding yet, so we can't do assembly parsing support Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=144606&r1=144605&r2=144606&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Mon Nov 14 19:46:57 2011 @@ -900,6 +900,13 @@ IAP->addCond(Cond); break; case CodeGenInstAlias::ResultOperand::K_Reg: + // If this is zero_reg, something's playing tricks we're not + // equipped to handle. + if (!CGA->ResultOperands[i].getRegister()) { + CantHandle = true; + break; + } + Cond = std::string("MI->getOperand(") + llvm::utostr(i) + ").getReg() == " + Target.getName() + "::" + CGA->ResultOperands[i].getRegister()->getName(); Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=144606&r1=144605&r2=144606&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Mon Nov 14 19:46:57 2011 @@ -468,9 +468,13 @@ if (ADI && ADI->getDef()->getName() == "zero_reg") { // Check if this is an optional def. - if (!InstOpRec->isSubClassOf("OptionalDefOperand")) - throw TGError(Loc, "reg0 used for result that is not an " - "OptionalDefOperand!"); + // Tied operands where the source is a sub-operand of a complex operand + // need to represent both operands in the alias destination instruction. + // Allow zero_reg for the tied portion. This can and should go away once + // the MC representation of things doesn't use tied operands at all. + //if (!InstOpRec->isSubClassOf("OptionalDefOperand")) + // throw TGError(Loc, "reg0 used for result that is not an " + // "OptionalDefOperand!"); ResOp = ResultOperand(static_cast(0)); return true; @@ -537,8 +541,11 @@ unsigned AliasOpNo = 0; for (unsigned i = 0, e = ResultInst->Operands.size(); i != e; ++i) { - // Tied registers don't have an entry in the result dag. - if (ResultInst->Operands[i].getTiedRegister() != -1) + // Tied registers don't have an entry in the result dag unless they're part + // of a complex operand, in which case we include them anyways, as we + // don't have any other way to specify the whole operand. + if (ResultInst->Operands[i].MINumOperands == 1 && + ResultInst->Operands[i].getTiedRegister() != -1) continue; if (AliasOpNo >= Result->getNumArgs()) From evan.cheng at apple.com Mon Nov 14 20:12:34 2011 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Nov 2011 02:12:34 -0000 Subject: [llvm-commits] [llvm] r144608 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/ARM/ARMInstrNEON.td test/CodeGen/ARM/vmov.ll test/CodeGen/Thumb2/machine-licm.ll utils/TableGen/EDEmitter.cpp Message-ID: <20111115021234.90AAC2A6C131@llvm.org> Author: evancheng Date: Mon Nov 14 20:12:34 2011 New Revision: 144608 URL: http://llvm.org/viewvc/llvm-project?rev=144608&view=rev Log: Add vmov.f32 to materialize f32 immediate splats which cannot be handled by integer variants. rdar://10437054 Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h llvm/trunk/lib/Target/ARM/ARMInstrNEON.td llvm/trunk/test/CodeGen/ARM/vmov.ll llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll llvm/trunk/utils/TableGen/EDEmitter.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=144608&r1=144607&r2=144608&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Nov 14 20:12:34 2011 @@ -912,6 +912,7 @@ case ARMISD::VGETLANEs: return "ARMISD::VGETLANEs"; case ARMISD::VMOVIMM: return "ARMISD::VMOVIMM"; case ARMISD::VMVNIMM: return "ARMISD::VMVNIMM"; + case ARMISD::VMOVFPIMM: return "ARMISD::VMOVFPIMM"; case ARMISD::VDUP: return "ARMISD::VDUP"; case ARMISD::VDUPLANE: return "ARMISD::VDUPLANE"; case ARMISD::VEXT: return "ARMISD::VEXT"; @@ -3986,6 +3987,16 @@ SDValue Vmov = DAG.getNode(ARMISD::VMVNIMM, dl, VmovVT, Val); return DAG.getNode(ISD::BITCAST, dl, VT, Vmov); } + + // Use vmov.f32 to materialize other v2f32 and v4f32 splats. + if (VT == MVT::v2f32 || VT == MVT::v4f32) { + ConstantFPSDNode *C = cast(Op.getOperand(0)); + int ImmVal = ARM_AM::getFP32Imm(C->getValueAPF()); + if (ImmVal != -1) { + SDValue Val = DAG.getTargetConstant(ImmVal, MVT::i32); + return DAG.getNode(ARMISD::VMOVFPIMM, dl, VT, Val); + } + } } } Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=144608&r1=144607&r2=144608&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Mon Nov 14 20:12:34 2011 @@ -146,6 +146,9 @@ VMOVIMM, VMVNIMM, + // Vector move f32 immediate: + VMOVFPIMM, + // Vector duplicate: VDUP, VDUPLANE, Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=144608&r1=144607&r2=144608&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Mon Nov 14 20:12:34 2011 @@ -39,6 +39,10 @@ let PrintMethod = "printNEONModImmOperand"; let ParserMatchClass = nImmVMOVI32AsmOperand; } +def nImmVMOVF32 : Operand { + let PrintMethod = "printFPImmOperand"; + let ParserMatchClass = FPImmOperand; +} def nImmSplatI64AsmOperand : AsmOperandClass { let Name = "NEONi64splat"; } def nImmSplatI64 : Operand { let PrintMethod = "printNEONModImmOperand"; @@ -173,6 +177,7 @@ def SDTARMVMOVIMM : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisVT<1, i32>]>; def NEONvmovImm : SDNode<"ARMISD::VMOVIMM", SDTARMVMOVIMM>; def NEONvmvnImm : SDNode<"ARMISD::VMVNIMM", SDTARMVMOVIMM>; +def NEONvmovFPImm : SDNode<"ARMISD::VMOVFPIMM", SDTARMVMOVIMM>; def SDTARMVORRIMM : SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>, SDTCisVT<2, i32>]>; @@ -4513,6 +4518,15 @@ (ins nImmSplatI64:$SIMM), IIC_VMOVImm, "vmov", "i64", "$Vd, $SIMM", "", [(set QPR:$Vd, (v2i64 (NEONvmovImm timm:$SIMM)))]>; + +def VMOVv2f32 : N1ModImm<1, 0b000, 0b1111, 0, 0, 0, 1, (outs DPR:$Vd), + (ins nImmVMOVF32:$SIMM), IIC_VMOVImm, + "vmov", "f32", "$Vd, $SIMM", "", + [(set DPR:$Vd, (v2f32 (NEONvmovFPImm timm:$SIMM)))]>; +def VMOVv4f32 : N1ModImm<1, 0b000, 0b1111, 0, 1, 0, 1, (outs QPR:$Vd), + (ins nImmVMOVF32:$SIMM), IIC_VMOVImm, + "vmov", "f32", "$Vd, $SIMM", "", + [(set QPR:$Vd, (v4f32 (NEONvmovFPImm timm:$SIMM)))]>; } // isReMaterializable // VMOV : Vector Get Lane (move scalar to ARM core register) Modified: llvm/trunk/test/CodeGen/ARM/vmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vmov.ll?rev=144608&r1=144607&r2=144608&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vmov.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vmov.ll Mon Nov 14 20:12:34 2011 @@ -353,3 +353,21 @@ store <4 x i16> %tmp2, <4 x i16>* %b, align 8 ret void } + +; Use vmov.f32 to materialize f32 immediate splats +; rdar://10437054 +define void @v_mov_v2f32(<2 x float>* nocapture %p) nounwind { +entry: +;CHECK: v_mov_v2f32: +;CHECK: vmov.f32 d{{.*}}, #-1.600000e+01 + store <2 x float> , <2 x float>* %p, align 4 + ret void +} + +define void @v_mov_v4f32(<4 x float>* nocapture %p) nounwind { +entry: +;CHECK: v_mov_v4f32: +;CHECK: vmov.f32 q{{.*}}, #3.100000e+01 + store <4 x float> , <4 x float>* %p, align 4 + ret void +} Modified: llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll?rev=144608&r1=144607&r2=144608&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll (original) +++ llvm/trunk/test/CodeGen/Thumb2/machine-licm.ll Mon Nov 14 20:12:34 2011 @@ -51,12 +51,11 @@ define void @t2(i8* %ptr1, i8* %ptr2) nounwind { entry: ; CHECK: t2: -; CHECK: mov.w [[R3:r[0-9]+]], #1065353216 -; CHECK: vdup.32 q{{.*}}, [[R3]] +; CHECK: vmov.f32 q{{.*}}, #1.000000e+00 br i1 undef, label %bb1, label %bb2 bb1: -; CHECK-NEXT: %bb1 +; CHECK: %bb1 %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ] %tmp1 = shl i32 %indvar, 2 %gep1 = getelementptr i8* %ptr1, i32 %tmp1 Modified: llvm/trunk/utils/TableGen/EDEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/EDEmitter.cpp?rev=144608&r1=144607&r2=144608&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/EDEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/EDEmitter.cpp Mon Nov 14 20:12:34 2011 @@ -607,6 +607,7 @@ IMM("nImmSplatI32"); IMM("nImmSplatI64"); IMM("nImmVMOVI32"); + IMM("nImmVMOVF32"); IMM("imm0_7"); IMM("imm0_15"); IMM("imm0_255"); From stoklund at 2pi.dk Mon Nov 14 20:29:48 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 15 Nov 2011 02:29:48 -0000 Subject: [llvm-commits] [llvm] r144611 - in /llvm/trunk/test/CodeGen/X86: isint.ll uint64-to-float.ll Message-ID: <20111115022948.6E1AB2A6C131@llvm.org> Author: stoklund Date: Mon Nov 14 20:29:48 2011 New Revision: 144611 URL: http://llvm.org/viewvc/llvm-project?rev=144611&view=rev Log: Allow for depencendy-breaking instructions before cvt*. This should unbreak clang-x86_64-darwin10-RA, but I can't actually reproduce the failure. Modified: llvm/trunk/test/CodeGen/X86/isint.ll llvm/trunk/test/CodeGen/X86/uint64-to-float.ll Modified: llvm/trunk/test/CodeGen/X86/isint.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/isint.ll?rev=144611&r1=144610&r2=144611&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/isint.ll (original) +++ llvm/trunk/test/CodeGen/X86/isint.ll Mon Nov 14 20:29:48 2011 @@ -19,7 +19,7 @@ define void @isint_branch(double %d) nounwind { ; CHECK: cvt %i = fptosi double %d to i32 -; CHECK-NEXT: cvt +; CHECK: cvt %e = sitofp i32 %i to double ; CHECK: ucomisd %c = fcmp oeq double %d, %e Modified: llvm/trunk/test/CodeGen/X86/uint64-to-float.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/uint64-to-float.ll?rev=144611&r1=144610&r2=144611&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/uint64-to-float.ll (original) +++ llvm/trunk/test/CodeGen/X86/uint64-to-float.ll Mon Nov 14 20:29:48 2011 @@ -38,7 +38,7 @@ ; CHECK-NEXT: jns LBB0_2 ; CHECK: cvtsi2ss ; CHECK: LBB0_2 -; CHECK-NEXT: cvtsi2ss +; CHECK: cvtsi2ss define float @test(i64 %a) { entry: %b = uitofp i64 %a to float From stoklund at 2pi.dk Mon Nov 14 21:17:01 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 15 Nov 2011 03:17:01 -0000 Subject: [llvm-commits] [llvm] r144613 - /llvm/trunk/test/CodeGen/X86/isint.ll Message-ID: <20111115031701.F3AE22A6C131@llvm.org> Author: stoklund Date: Mon Nov 14 21:17:01 2011 New Revision: 144613 URL: http://llvm.org/viewvc/llvm-project?rev=144613&view=rev Log: Really fix test. Modified: llvm/trunk/test/CodeGen/X86/isint.ll Modified: llvm/trunk/test/CodeGen/X86/isint.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/isint.ll?rev=144613&r1=144612&r2=144613&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/isint.ll (original) +++ llvm/trunk/test/CodeGen/X86/isint.ll Mon Nov 14 21:17:01 2011 @@ -4,7 +4,7 @@ ; CHECK-NOT: xor ; CHECK: cvt %i = fptosi double %d to i32 -; CHECK-NEXT: cvt +; CHECK: cvt %e = sitofp i32 %i to double ; CHECK: cmpeqsd %c = fcmp oeq double %d, %e From geek4civic at gmail.com Mon Nov 14 23:24:26 2011 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Tue, 15 Nov 2011 05:24:26 -0000 Subject: [llvm-commits] [llvm] r144621 - /llvm/trunk/include/llvm/Support/Compiler.h Message-ID: <20111115052426.F10CE2A6C131@llvm.org> Author: chapuni Date: Mon Nov 14 23:24:26 2011 New Revision: 144621 URL: http://llvm.org/viewvc/llvm-project?rev=144621&view=rev Log: include/llvm/Support/Compiler.h: Invalidate LLVM_ATTRIBUTE_WEAK on cygming for now. It triggers generating insane executables with both binutils-2.19.1(msysgit) and 2.22.51.20111013(cygwin). Modified: llvm/trunk/include/llvm/Support/Compiler.h Modified: llvm/trunk/include/llvm/Support/Compiler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=144621&r1=144620&r2=144621&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Compiler.h (original) +++ llvm/trunk/include/llvm/Support/Compiler.h Mon Nov 14 23:24:26 2011 @@ -61,7 +61,7 @@ #define LLVM_ATTRIBUTE_READONLY #endif -#if (__GNUC__ >= 4) +#if (__GNUC__ >= 4) && !defined(__MINGW32__) && !defined(__CYGWIN__) #define LLVM_ATTRIBUTE_WEAK __attribute__((__weak__)) #else #define LLVM_ATTRIBUTE_WEAK From nicholas at mxc.ca Mon Nov 14 23:53:47 2011 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 14 Nov 2011 21:53:47 -0800 Subject: [llvm-commits] [llvm] r144621 - /llvm/trunk/include/llvm/Support/Compiler.h In-Reply-To: <20111115052426.F10CE2A6C131@llvm.org> References: <20111115052426.F10CE2A6C131@llvm.org> Message-ID: <4EC1FE6B.5030802@mxc.ca> NAKAMURA Takumi wrote: > Author: chapuni > Date: Mon Nov 14 23:24:26 2011 > New Revision: 144621 > > URL: http://llvm.org/viewvc/llvm-project?rev=144621&view=rev > Log: > include/llvm/Support/Compiler.h: Invalidate LLVM_ATTRIBUTE_WEAK on cygming for now. > > It triggers generating insane executables with both binutils-2.19.1(msysgit) and 2.22.51.20111013(cygwin). Thanks for diagnosing this for me!! Nick > > Modified: > llvm/trunk/include/llvm/Support/Compiler.h > > Modified: llvm/trunk/include/llvm/Support/Compiler.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=144621&r1=144620&r2=144621&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Support/Compiler.h (original) > +++ llvm/trunk/include/llvm/Support/Compiler.h Mon Nov 14 23:24:26 2011 > @@ -61,7 +61,7 @@ > #define LLVM_ATTRIBUTE_READONLY > #endif > > -#if (__GNUC__>= 4) > +#if (__GNUC__>= 4)&& !defined(__MINGW32__)&& !defined(__CYGWIN__) > #define LLVM_ATTRIBUTE_WEAK __attribute__((__weak__)) > #else > #define LLVM_ATTRIBUTE_WEAK > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From craig.topper at gmail.com Mon Nov 14 23:55:35 2011 From: craig.topper at gmail.com (Craig Topper) Date: Tue, 15 Nov 2011 05:55:35 -0000 Subject: [llvm-commits] [llvm] r144622 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86TargetMachine.cpp test/CodeGen/X86/avx-intrinsics-x86.ll test/CodeGen/X86/avx-logic.ll Message-ID: <20111115055535.EB06B2A6C131@llvm.org> Author: ctopper Date: Mon Nov 14 23:55:35 2011 New Revision: 144622 URL: http://llvm.org/viewvc/llvm-project?rev=144622&view=rev Log: Properly qualify AVX2 specific parts of execution dependency table. Also enable converting between 256-bit PS/PD operations when AVX1 is enabled. Fixes PR11370. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.cpp llvm/trunk/test/CodeGen/X86/avx-intrinsics-x86.ll llvm/trunk/test/CodeGen/X86/avx-logic.ll Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=144622&r1=144621&r2=144622&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Nov 14 23:55:35 2011 @@ -3555,7 +3555,11 @@ { X86::VMOVAPSYrr, X86::VMOVAPDYrr, X86::VMOVDQAYrr }, { X86::VMOVUPSYmr, X86::VMOVUPDYmr, X86::VMOVDQUYmr }, { X86::VMOVUPSYrm, X86::VMOVUPDYrm, X86::VMOVDQUYrm }, - { X86::VMOVNTPSYmr, X86::VMOVNTPDYmr, X86::VMOVNTDQYmr }, + { X86::VMOVNTPSYmr, X86::VMOVNTPDYmr, X86::VMOVNTDQYmr } +}; + +static const unsigned ReplaceableInstrsAVX2[][3] = { + //PackedSingle PackedDouble PackedInt { X86::VANDNPSYrm, X86::VANDNPDYrm, X86::VPANDNYrm }, { X86::VANDNPSYrr, X86::VANDNPDYrr, X86::VPANDNYrr }, { X86::VANDPSYrm, X86::VANDPDYrm, X86::VPANDYrm }, @@ -3563,31 +3567,37 @@ { X86::VORPSYrm, X86::VORPDYrm, X86::VPORYrm }, { X86::VORPSYrr, X86::VORPDYrr, X86::VPORYrr }, { X86::VXORPSYrm, X86::VXORPDYrm, X86::VPXORYrm }, - { X86::VXORPSYrr, X86::VXORPDYrr, X86::VPXORYrr }, + { X86::VXORPSYrr, X86::VXORPDYrr, X86::VPXORYrr } }; // FIXME: Some shuffle and unpack instructions have equivalents in different // domains, but they require a bit more work than just switching opcodes. -static const unsigned *lookup(unsigned opcode, unsigned domain) { +static const unsigned *lookup(unsigned opcode, unsigned domain, bool hasAVX2) { for (unsigned i = 0, e = array_lengthof(ReplaceableInstrs); i != e; ++i) if (ReplaceableInstrs[i][domain-1] == opcode) return ReplaceableInstrs[i]; + if (domain != 3 || hasAVX2) // only use PackedInt domain if AVX2 is enabled + for (unsigned i = 0, e = array_lengthof(ReplaceableInstrsAVX2); i != e; ++i) + if (ReplaceableInstrsAVX2[i][domain-1] == opcode) + return ReplaceableInstrsAVX2[i]; return 0; } std::pair X86InstrInfo::getExecutionDomain(const MachineInstr *MI) const { uint16_t domain = (MI->getDesc().TSFlags >> X86II::SSEDomainShift) & 3; + bool hasAVX2 = TM.getSubtarget().hasAVX2(); return std::make_pair(domain, - domain && lookup(MI->getOpcode(), domain) ? 0xe : 0); + domain && lookup(MI->getOpcode(), domain, hasAVX2) ? 0xe : 0); } void X86InstrInfo::setExecutionDomain(MachineInstr *MI, unsigned Domain) const { assert(Domain>0 && Domain<4 && "Invalid execution domain"); uint16_t dom = (MI->getDesc().TSFlags >> X86II::SSEDomainShift) & 3; assert(dom && "Not an SSE instruction"); - const unsigned *table = lookup(MI->getOpcode(), dom); + bool hasAVX2 = TM.getSubtarget().hasAVX2(); + const unsigned *table = lookup(MI->getOpcode(), dom, hasAVX2); assert(table && "Cannot change domain"); MI->setDesc(get(table[Domain-1])); } Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=144622&r1=144621&r2=144622&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Mon Nov 14 23:55:35 2011 @@ -140,10 +140,7 @@ PM.add(createExecutionDependencyFixPass(&X86::VR128RegClass)); ShouldPrint = true; } - if (Subtarget.hasAVX2()) { - // FIXME this should be turned on for just AVX, but the pass doesn't check - // that instructions are valid before replacing them and there are AVX2 - // integer instructions in the table. + if (Subtarget.hasAVX()) { PM.add(createExecutionDependencyFixPass(&X86::VR256RegClass)); ShouldPrint = true; } Modified: llvm/trunk/test/CodeGen/X86/avx-intrinsics-x86.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-intrinsics-x86.ll?rev=144622&r1=144621&r2=144622&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/avx-intrinsics-x86.ll (original) +++ llvm/trunk/test/CodeGen/X86/avx-intrinsics-x86.ll Mon Nov 14 23:55:35 2011 @@ -2021,7 +2021,9 @@ define <32 x i8> @test_x86_avx_loadu_dq_256(i8* %a0) { ; CHECK: vmovdqu - %res = call <32 x i8> @llvm.x86.avx.loadu.dq.256(i8* %a0) ; <<32 x i8>> [#uses=1] + %a1 = call <32 x i8> @llvm.x86.avx.loadu.dq.256(i8* %a0) ; <<32 x i8>> [#uses=1] + ; add operation forces the execution domain. + %res = add <32 x i8> %a1, ret <32 x i8> %res } declare <32 x i8> @llvm.x86.avx.loadu.dq.256(i8*) nounwind readonly @@ -2029,7 +2031,9 @@ define <4 x double> @test_x86_avx_loadu_pd_256(i8* %a0) { ; CHECK: vmovupd - %res = call <4 x double> @llvm.x86.avx.loadu.pd.256(i8* %a0) ; <<4 x double>> [#uses=1] + %a1 = call <4 x double> @llvm.x86.avx.loadu.pd.256(i8* %a0) ; <<4 x double>> [#uses=1] + ; add operation forces the execution domain. + %res = fadd <4 x double> %a1, ret <4 x double> %res } declare <4 x double> @llvm.x86.avx.loadu.pd.256(i8*) nounwind readonly @@ -2157,7 +2161,9 @@ define void @test_x86_avx_movnt_dq_256(i8* %a0, <4 x i64> %a1) { ; CHECK: vmovntdq - call void @llvm.x86.avx.movnt.dq.256(i8* %a0, <4 x i64> %a1) + ; add operation forces the execution domain. + %a2 = add <4 x i64> %a1, + call void @llvm.x86.avx.movnt.dq.256(i8* %a0, <4 x i64> %a2) ret void } declare void @llvm.x86.avx.movnt.dq.256(i8*, <4 x i64>) nounwind @@ -2165,7 +2171,8 @@ define void @test_x86_avx_movnt_pd_256(i8* %a0, <4 x double> %a1) { ; CHECK: vmovntpd - call void @llvm.x86.avx.movnt.pd.256(i8* %a0, <4 x double> %a1) + %a2 = fadd <4 x double> %a1, + call void @llvm.x86.avx.movnt.pd.256(i8* %a0, <4 x double> %a2) ret void } declare void @llvm.x86.avx.movnt.pd.256(i8*, <4 x double>) nounwind @@ -2258,7 +2265,9 @@ define void @test_x86_avx_storeu_dq_256(i8* %a0, <32 x i8> %a1) { ; CHECK: vmovdqu - call void @llvm.x86.avx.storeu.dq.256(i8* %a0, <32 x i8> %a1) + ; add operation forces the execution domain. + %a2 = add <32 x i8> %a1, + call void @llvm.x86.avx.storeu.dq.256(i8* %a0, <32 x i8> %a2) ret void } declare void @llvm.x86.avx.storeu.dq.256(i8*, <32 x i8>) nounwind @@ -2266,7 +2275,9 @@ define void @test_x86_avx_storeu_pd_256(i8* %a0, <4 x double> %a1) { ; CHECK: vmovupd - call void @llvm.x86.avx.storeu.pd.256(i8* %a0, <4 x double> %a1) + ; add operation forces the execution domain. + %a2 = fadd <4 x double> %a1, + call void @llvm.x86.avx.storeu.pd.256(i8* %a0, <4 x double> %a2) ret void } declare void @llvm.x86.avx.storeu.pd.256(i8*, <4 x double>) nounwind Modified: llvm/trunk/test/CodeGen/X86/avx-logic.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx-logic.ll?rev=144622&r1=144621&r2=144622&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/avx-logic.ll (original) +++ llvm/trunk/test/CodeGen/X86/avx-logic.ll Mon Nov 14 23:55:35 2011 @@ -7,7 +7,9 @@ %1 = bitcast <4 x double> %y to <4 x i64> %and.i = and <4 x i64> %0, %1 %2 = bitcast <4 x i64> %and.i to <4 x double> - ret <4 x double> %2 + ; add forces execution domain + %3 = fadd <4 x double> %2, + ret <4 x double> %3 } ; CHECK: vandpd LCP{{.*}}(%rip) @@ -16,7 +18,9 @@ %0 = bitcast <4 x double> %y to <4 x i64> %and.i = and <4 x i64> %0, %1 = bitcast <4 x i64> %and.i to <4 x double> - ret <4 x double> %1 + ; add forces execution domain + %2 = fadd <4 x double> %1, + ret <4 x double> %2 } ; CHECK: vandps @@ -45,7 +49,9 @@ %1 = bitcast <4 x double> %y to <4 x i64> %xor.i = xor <4 x i64> %0, %1 %2 = bitcast <4 x i64> %xor.i to <4 x double> - ret <4 x double> %2 + ; add forces execution domain + %3 = fadd <4 x double> %2, + ret <4 x double> %3 } ; CHECK: vxorpd LCP{{.*}}(%rip) @@ -54,7 +60,9 @@ %0 = bitcast <4 x double> %y to <4 x i64> %xor.i = xor <4 x i64> %0, %1 = bitcast <4 x i64> %xor.i to <4 x double> - ret <4 x double> %1 + ; add forces execution domain + %2 = fadd <4 x double> %1, + ret <4 x double> %2 } ; CHECK: vxorps @@ -83,7 +91,9 @@ %1 = bitcast <4 x double> %y to <4 x i64> %or.i = or <4 x i64> %0, %1 %2 = bitcast <4 x i64> %or.i to <4 x double> - ret <4 x double> %2 + ; add forces execution domain + %3 = fadd <4 x double> %2, + ret <4 x double> %3 } ; CHECK: vorpd LCP{{.*}}(%rip) @@ -92,7 +102,9 @@ %0 = bitcast <4 x double> %y to <4 x i64> %or.i = or <4 x i64> %0, %1 = bitcast <4 x i64> %or.i to <4 x double> - ret <4 x double> %1 + ; add forces execution domain + %2 = fadd <4 x double> %1, + ret <4 x double> %2 } ; CHECK: vorps @@ -122,7 +134,9 @@ %1 = bitcast <4 x double> %y to <4 x i64> %and.i = and <4 x i64> %1, %neg.i %2 = bitcast <4 x i64> %and.i to <4 x double> - ret <4 x double> %2 + ; add forces execution domain + %3 = fadd <4 x double> %2, + ret <4 x double> %3 } ; CHECK: vandnpd (% @@ -134,7 +148,9 @@ %1 = bitcast <4 x double> %tmp2 to <4 x i64> %and.i = and <4 x i64> %1, %neg.i %2 = bitcast <4 x i64> %and.i to <4 x double> - ret <4 x double> %2 + ; add forces execution domain + %3 = fadd <4 x double> %2, + ret <4 x double> %3 } ; CHECK: vandnps From chandlerc at gmail.com Tue Nov 15 00:26:43 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Tue, 15 Nov 2011 06:26:43 -0000 Subject: [llvm-commits] [llvm] r144627 - in /llvm/trunk: lib/CodeGen/MachineBlockPlacement.cpp test/CodeGen/X86/block-placement.ll Message-ID: <20111115062643.555672A6C131@llvm.org> Author: chandlerc Date: Tue Nov 15 00:26:43 2011 New Revision: 144627 URL: http://llvm.org/viewvc/llvm-project?rev=144627&view=rev Log: Rather than trying to use the loop block sequence *or* the function block sequence when recovering from unanalyzable control flow constructs, *always* use the function sequence. I'm not sure why I ever went down the path of trying to use the loop sequence, it is fundamentally not the correct sequence to use. We're trying to preserve the incoming layout in the cases of unreasonable control flow, and that is only encoded at the function level. We already have a filter to select *exactly* the sub-set of blocks within the function that we're trying to form into a chain. The resulting code layout is also significantly better because of this. In several places we were ending up with completely unreasonable control flow constructs due to the ordering chosen by the loop structure for its internal storage. This change removes a completely wasteful vector of basic blocks, saving memory allocation in the common case even though it costs us CPU in the fairly rare case of unnatural loops. Finally, it fixes the latest crasher reduced out of GCC's single source. Thanks again to Benjamin Kramer for the reduction, my bugpoint skills failed at it. Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp llvm/trunk/test/CodeGen/X86/block-placement.ll Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=144627&r1=144626&r2=144627&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Tue Nov 15 00:26:43 2011 @@ -214,11 +214,12 @@ MachineBasicBlock *selectBestCandidateBlock( BlockChain &Chain, SmallVectorImpl &WorkList, const BlockFilterSet *BlockFilter); - MachineBasicBlock *getFirstUnplacedBlock(const BlockChain &PlacedChain, - ArrayRef Blocks, - unsigned &PrevUnplacedBlockIdx); + MachineBasicBlock *getFirstUnplacedBlock( + MachineFunction &F, + const BlockChain &PlacedChain, + MachineFunction::iterator &PrevUnplacedBlockIt, + const BlockFilterSet *BlockFilter); void buildChain(MachineBasicBlock *BB, BlockChain &Chain, - ArrayRef Blocks, SmallVectorImpl &BlockWorkList, const BlockFilterSet *BlockFilter = 0); void buildLoopChains(MachineFunction &F, MachineLoop &L); @@ -444,18 +445,20 @@ /// /// This routine is called when we are unable to use the CFG to walk through /// all of the basic blocks and form a chain due to unnatural loops in the CFG. -/// We walk through the sequence of blocks, starting from the -/// LastUnplacedBlockIdx. We update this index to avoid re-scanning the entire -/// sequence on repeated calls to this routine. +/// We walk through the function's blocks in order, starting from the +/// LastUnplacedBlockIt. We update this iterator on each call to avoid +/// re-scanning the entire sequence on repeated calls to this routine. MachineBasicBlock *MachineBlockPlacement::getFirstUnplacedBlock( - const BlockChain &PlacedChain, - ArrayRef Blocks, - unsigned &PrevUnplacedBlockIdx) { - for (unsigned i = PrevUnplacedBlockIdx, e = Blocks.size(); i != e; ++i) { - MachineBasicBlock *BB = Blocks[i]; - if (BlockToChain[BB] != &PlacedChain) { - PrevUnplacedBlockIdx = i; - return BB; + MachineFunction &F, const BlockChain &PlacedChain, + MachineFunction::iterator &PrevUnplacedBlockIt, + const BlockFilterSet *BlockFilter) { + for (MachineFunction::iterator I = PrevUnplacedBlockIt, E = F.end(); I != E; + ++I) { + if (BlockFilter && !BlockFilter->count(I)) + continue; + if (BlockToChain[I] != &PlacedChain) { + PrevUnplacedBlockIt = I; + return I; } } return 0; @@ -464,14 +467,14 @@ void MachineBlockPlacement::buildChain( MachineBasicBlock *BB, BlockChain &Chain, - ArrayRef Blocks, SmallVectorImpl &BlockWorkList, const BlockFilterSet *BlockFilter) { assert(BB); assert(BlockToChain[BB] == &Chain); assert(*Chain.begin() == BB); SmallVector Cond; // For AnalyzeBranch. - unsigned PrevUnplacedBlockIdx = 0; + MachineFunction &F = *BB->getParent(); + MachineFunction::iterator PrevUnplacedBlockIt = F.begin(); MachineBasicBlock *LoopHeaderBB = BB; markChainSuccessors(Chain, LoopHeaderBB, BlockWorkList, BlockFilter); @@ -510,7 +513,8 @@ BestSucc = selectBestCandidateBlock(Chain, BlockWorkList, BlockFilter); if (!BestSucc) { - BestSucc = getFirstUnplacedBlock(Chain, Blocks, PrevUnplacedBlockIdx); + BestSucc = getFirstUnplacedBlock(F, Chain, PrevUnplacedBlockIt, + BlockFilter); if (!BestSucc) break; @@ -579,8 +583,7 @@ BlockWorkList.push_back(*BI); } - buildChain(*L.block_begin(), LoopChain, L.getBlocks(), BlockWorkList, - &LoopBlockSet); + buildChain(*L.block_begin(), LoopChain, BlockWorkList, &LoopBlockSet); DEBUG({ // Crash at the end so we get all of the debugging output first. @@ -630,17 +633,11 @@ ++LI) buildLoopChains(F, **LI); - // We need a vector of blocks so that buildChain can handle unnatural CFG - // constructs by searching for unplaced blocks and just concatenating them. - SmallVector Blocks; - Blocks.reserve(F.size()); - SmallVector BlockWorkList; SmallPtrSet UpdatedPreds; for (MachineFunction::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) { MachineBasicBlock *BB = &*FI; - Blocks.push_back(BB); BlockChain &Chain = *BlockToChain[BB]; if (!UpdatedPreds.insert(&Chain)) continue; @@ -663,7 +660,7 @@ } BlockChain &FunctionChain = *BlockToChain[&F.front()]; - buildChain(&F.front(), FunctionChain, Blocks, BlockWorkList); + buildChain(&F.front(), FunctionChain, BlockWorkList); typedef SmallPtrSet FunctionBlockSetType; DEBUG({ Modified: llvm/trunk/test/CodeGen/X86/block-placement.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/block-placement.ll?rev=144627&r1=144626&r2=144627&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/block-placement.ll (original) +++ llvm/trunk/test/CodeGen/X86/block-placement.ll Tue Nov 15 00:26:43 2011 @@ -241,8 +241,8 @@ ; CHECK: unnatural_cfg1 ; CHECK: %entry ; CHECK: %loop.body1 -; CHECK: %loop.body3 ; CHECK: %loop.body2 +; CHECK: %loop.body3 entry: br label %loop.header @@ -272,6 +272,77 @@ br label %loop.body3 } +define void @unnatural_cfg2() { +; Test that we can handle a loop with a nested natural loop *and* an unnatural +; loop. This was reduced from a crash on block placement when run over +; single-source GCC. +; CHECK: unnatural_cfg2 +; CHECK: %entry +; CHECK: %loop.header +; CHECK: %loop.body1 +; CHECK: %loop.body2 +; CHECK: %loop.body3 +; CHECK: %loop.inner1.begin +; The end block is folded with %loop.body3... +; CHECK-NOT: %loop.inner1.end +; CHECK: %loop.body4 +; CHECK: %loop.inner2.begin +; The loop.inner2.end block is folded +; CHECK: %bail + +entry: + br label %loop.header + +loop.header: + %comp0 = icmp eq i32* undef, null + br i1 %comp0, label %bail, label %loop.body1 + +loop.body1: + %val0 = load i32** undef, align 4 + br i1 undef, label %loop.body2, label %loop.inner1.begin + +loop.body2: + br i1 undef, label %loop.body4, label %loop.body3 + +loop.body3: + %ptr1 = getelementptr inbounds i32* %val0, i32 0 + %castptr1 = bitcast i32* %ptr1 to i32** + %val1 = load i32** %castptr1, align 4 + br label %loop.inner1.begin + +loop.inner1.begin: + %valphi = phi i32* [ %val2, %loop.inner1.end ], [ %val1, %loop.body3 ], [ %val0, %loop.body1 ] + %castval = bitcast i32* %valphi to i32* + %comp1 = icmp eq i32 undef, 48 + br i1 %comp1, label %loop.inner1.end, label %loop.body4 + +loop.inner1.end: + %ptr2 = getelementptr inbounds i32* %valphi, i32 0 + %castptr2 = bitcast i32* %ptr2 to i32** + %val2 = load i32** %castptr2, align 4 + br label %loop.inner1.begin + +loop.body4.dead: + br label %loop.body4 + +loop.body4: + %comp2 = icmp ult i32 undef, 3 + br i1 %comp2, label %loop.inner2.begin, label %loop.end + +loop.inner2.begin: + br i1 false, label %loop.end, label %loop.inner2.end + +loop.inner2.end: + %comp3 = icmp eq i32 undef, 1769472 + br i1 %comp3, label %loop.end, label %loop.inner2.begin + +loop.end: + br label %loop.header + +bail: + unreachable +} + define i32 @problematic_switch() { ; This function's CFG caused overlow in the machine branch probability ; calculation, triggering asserts. Make sure we don't crash on it. From evan.cheng at apple.com Tue Nov 15 00:26:51 2011 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Nov 2011 06:26:51 -0000 Subject: [llvm-commits] [llvm] r144628 - /llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Message-ID: <20111115062651.71B0F2A6C131@llvm.org> Author: evancheng Date: Tue Nov 15 00:26:51 2011 New Revision: 144628 URL: http://llvm.org/viewvc/llvm-project?rev=144628&view=rev Log: Set SeenStore to true to prevent loads from being moved; also eliminates a non-deterministic behavior. Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=144628&r1=144627&r2=144628&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Tue Nov 15 00:26:51 2011 @@ -924,7 +924,7 @@ if (isTwoAddrUse(*KillMI, Reg, DstReg)) return false; - bool SeenStore; + bool SeenStore = true; if (!MI->isSafeToMove(TII, AA, SeenStore)) return false; @@ -1071,7 +1071,7 @@ if (isTwoAddrUse(*KillMI, Reg, DstReg)) return false; - bool SeenStore; + bool SeenStore = true; if (!KillMI->isSafeToMove(TII, AA, SeenStore)) return false; From craig.topper at gmail.com Tue Nov 15 00:39:01 2011 From: craig.topper at gmail.com (Craig Topper) Date: Tue, 15 Nov 2011 06:39:01 -0000 Subject: [llvm-commits] [llvm] r144629 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <20111115063901.8D0552A6C131@llvm.org> Author: ctopper Date: Tue Nov 15 00:39:01 2011 New Revision: 144629 URL: http://llvm.org/viewvc/llvm-project?rev=144629&view=rev Log: Fix PR11370 for real. Prevents converting 256-bit FP instruction to AVX2 256-bit integer instructions when AVX2 isn't enabled. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=144629&r1=144628&r2=144629&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Nov 15 00:39:01 2011 @@ -3573,14 +3573,17 @@ // FIXME: Some shuffle and unpack instructions have equivalents in different // domains, but they require a bit more work than just switching opcodes. -static const unsigned *lookup(unsigned opcode, unsigned domain, bool hasAVX2) { +static const unsigned *lookup(unsigned opcode, unsigned domain) { for (unsigned i = 0, e = array_lengthof(ReplaceableInstrs); i != e; ++i) if (ReplaceableInstrs[i][domain-1] == opcode) return ReplaceableInstrs[i]; - if (domain != 3 || hasAVX2) // only use PackedInt domain if AVX2 is enabled - for (unsigned i = 0, e = array_lengthof(ReplaceableInstrsAVX2); i != e; ++i) - if (ReplaceableInstrsAVX2[i][domain-1] == opcode) - return ReplaceableInstrsAVX2[i]; + return 0; +} + +static const unsigned *lookupAVX2(unsigned opcode, unsigned domain) { + for (unsigned i = 0, e = array_lengthof(ReplaceableInstrsAVX2); i != e; ++i) + if (ReplaceableInstrsAVX2[i][domain-1] == opcode) + return ReplaceableInstrsAVX2[i]; return 0; } @@ -3588,16 +3591,21 @@ X86InstrInfo::getExecutionDomain(const MachineInstr *MI) const { uint16_t domain = (MI->getDesc().TSFlags >> X86II::SSEDomainShift) & 3; bool hasAVX2 = TM.getSubtarget().hasAVX2(); - return std::make_pair(domain, - domain && lookup(MI->getOpcode(), domain, hasAVX2) ? 0xe : 0); + uint16_t validDomains = 0; + if (domain && lookup(MI->getOpcode(), domain)) + validDomains = 0xe; + else if (domain && lookupAVX2(MI->getOpcode(), domain)) + validDomains = hasAVX2 ? 0xe : 0x6; + return std::make_pair(domain, validDomains); } void X86InstrInfo::setExecutionDomain(MachineInstr *MI, unsigned Domain) const { assert(Domain>0 && Domain<4 && "Invalid execution domain"); uint16_t dom = (MI->getDesc().TSFlags >> X86II::SSEDomainShift) & 3; assert(dom && "Not an SSE instruction"); - bool hasAVX2 = TM.getSubtarget().hasAVX2(); - const unsigned *table = lookup(MI->getOpcode(), dom, hasAVX2); + const unsigned *table = lookup(MI->getOpcode(), dom); + if (!table) // try the other table + table = lookupAVX2(MI->getOpcode(), dom); assert(table && "Cannot change domain"); MI->setDesc(get(table[Domain-1])); } From stoklund at 2pi.dk Tue Nov 15 00:54:12 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 14 Nov 2011 22:54:12 -0800 Subject: [llvm-commits] [llvm] r144622 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86TargetMachine.cpp test/CodeGen/X86/avx-intrinsics-x86.ll test/CodeGen/X86/avx-logic.ll In-Reply-To: <20111115055535.EB06B2A6C131@llvm.org> References: <20111115055535.EB06B2A6C131@llvm.org> Message-ID: <947DF93D-22AD-4681-8F76-82A9EEC2A9AA@2pi.dk> On Nov 14, 2011, at 9:55 PM, Craig Topper wrote: > --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Mon Nov 14 23:55:35 2011 > @@ -140,10 +140,7 @@ > PM.add(createExecutionDependencyFixPass(&X86::VR128RegClass)); > ShouldPrint = true; > } > - if (Subtarget.hasAVX2()) { > - // FIXME this should be turned on for just AVX, but the pass doesn't check > - // that instructions are valid before replacing them and there are AVX2 > - // integer instructions in the table. > + if (Subtarget.hasAVX()) { > PM.add(createExecutionDependencyFixPass(&X86::VR256RegClass)); > ShouldPrint = true; > } Perhaps you could change this back to the simpler (Subtarget.hasSSE2() || Subtarget.hasAVX())? It doesn't make a difference if you pass the VR128 or VR256 register class. The pass collapses aliases anyway. /jakob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20111114/302c6176/attachment.html From stoklund at 2pi.dk Tue Nov 15 01:13:03 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 15 Nov 2011 07:13:03 -0000 Subject: [llvm-commits] [llvm] r144630 - in /llvm/trunk/test/CodeGen/X86: isint.ll uint64-to-float.ll Message-ID: <20111115071303.5708D2A6C131@llvm.org> Author: stoklund Date: Tue Nov 15 01:13:03 2011 New Revision: 144630 URL: http://llvm.org/viewvc/llvm-project?rev=144630&view=rev Log: Revert r144611 and r144613. These tests are actually correct, clang was miscompiling ExeDepsFix::processUses. Evan fixed the miscompilation in r144628. Modified: llvm/trunk/test/CodeGen/X86/isint.ll llvm/trunk/test/CodeGen/X86/uint64-to-float.ll Modified: llvm/trunk/test/CodeGen/X86/isint.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/isint.ll?rev=144630&r1=144629&r2=144630&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/isint.ll (original) +++ llvm/trunk/test/CodeGen/X86/isint.ll Tue Nov 15 01:13:03 2011 @@ -4,7 +4,7 @@ ; CHECK-NOT: xor ; CHECK: cvt %i = fptosi double %d to i32 -; CHECK: cvt +; CHECK-NEXT: cvt %e = sitofp i32 %i to double ; CHECK: cmpeqsd %c = fcmp oeq double %d, %e @@ -19,7 +19,7 @@ define void @isint_branch(double %d) nounwind { ; CHECK: cvt %i = fptosi double %d to i32 -; CHECK: cvt +; CHECK-NEXT: cvt %e = sitofp i32 %i to double ; CHECK: ucomisd %c = fcmp oeq double %d, %e Modified: llvm/trunk/test/CodeGen/X86/uint64-to-float.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/uint64-to-float.ll?rev=144630&r1=144629&r2=144630&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/uint64-to-float.ll (original) +++ llvm/trunk/test/CodeGen/X86/uint64-to-float.ll Tue Nov 15 01:13:03 2011 @@ -38,7 +38,7 @@ ; CHECK-NEXT: jns LBB0_2 ; CHECK: cvtsi2ss ; CHECK: LBB0_2 -; CHECK: cvtsi2ss +; CHECK-NEXT: cvtsi2ss define float @test(i64 %a) { entry: %b = uitofp i64 %a to float From jay.foad at gmail.com Tue Nov 15 01:24:32 2011 From: jay.foad at gmail.com (Jay Foad) Date: Tue, 15 Nov 2011 07:24:32 -0000 Subject: [llvm-commits] [llvm] r144631 - in /llvm/trunk/lib/Target: ARM/ARMFastISel.cpp ARM/ARMISelLowering.cpp CellSPU/SPUISelDAGToDAG.cpp MSP430/MSP430ISelLowering.cpp PowerPC/PPCISelLowering.cpp X86/X86ISelLowering.cpp X86/X86InstrBuilder.h X86/X86InstrInfo.cpp Message-ID: <20111115072433.17C5B2A6C131@llvm.org> Author: foad Date: Tue Nov 15 01:24:32 2011 New Revision: 144631 URL: http://llvm.org/viewvc/llvm-project?rev=144631&view=rev Log: Remove some unnecessary includes of PseudoSourceValue.h. Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86InstrBuilder.h llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=144631&r1=144630&r2=144631&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Tue Nov 15 01:24:32 2011 @@ -37,7 +37,6 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=144631&r1=144630&r2=144631&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Nov 15 01:24:32 2011 @@ -40,7 +40,6 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/MC/MCSectionMachO.h" #include "llvm/Target/TargetOptions.h" Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=144631&r1=144630&r2=144631&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Tue Nov 15 01:24:32 2011 @@ -22,7 +22,6 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGISel.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetOptions.h" #include "llvm/ADT/Statistic.h" #include "llvm/Constants.h" Modified: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp?rev=144631&r1=144630&r2=144631&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp Tue Nov 15 01:24:32 2011 @@ -29,7 +29,6 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/CodeGen/ValueTypes.h" Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=144631&r1=144630&r2=144631&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Nov 15 01:24:32 2011 @@ -23,7 +23,6 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/CallingConv.h" Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=144631&r1=144630&r2=144631&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Nov 15 01:24:32 2011 @@ -35,7 +35,6 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" Modified: llvm/trunk/lib/Target/X86/X86InstrBuilder.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrBuilder.h?rev=144631&r1=144630&r2=144631&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrBuilder.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrBuilder.h Tue Nov 15 01:24:32 2011 @@ -27,7 +27,6 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineMemOperand.h" -#include "llvm/CodeGen/PseudoSourceValue.h" namespace llvm { Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=144631&r1=144630&r2=144631&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Nov 15 01:24:32 2011 @@ -25,7 +25,6 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/LiveVariables.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/MC/MCInst.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" From jay.foad at gmail.com Tue Nov 15 01:34:52 2011 From: jay.foad at gmail.com (Jay Foad) Date: Tue, 15 Nov 2011 07:34:52 -0000 Subject: [llvm-commits] [llvm] r144632 - in /llvm/trunk/lib/Target: ARM/ARMBaseInstrInfo.cpp ARM/Thumb1InstrInfo.cpp ARM/Thumb2InstrInfo.cpp MSP430/MSP430InstrInfo.cpp PowerPC/PPCInstrInfo.cpp Message-ID: <20111115073452.D63762A6C131@llvm.org> Author: foad Date: Tue Nov 15 01:34:52 2011 New Revision: 144632 URL: http://llvm.org/viewvc/llvm-project?rev=144632&view=rev Log: Make use of MachinePointerInfo::getFixedStack. This removes all mention of PseudoSourceValue from lib/Target/. Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.cpp llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=144632&r1=144631&r2=144632&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Tue Nov 15 01:34:52 2011 @@ -28,7 +28,6 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/BranchProbability.h" @@ -710,8 +709,7 @@ unsigned Align = MFI.getObjectAlignment(FI); MachineMemOperand *MMO = - MF.getMachineMemOperand(MachinePointerInfo( - PseudoSourceValue::getFixedStack(FI)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI), MachineMemOperand::MOStore, MFI.getObjectSize(FI), Align); @@ -862,7 +860,7 @@ unsigned Align = MFI.getObjectAlignment(FI); MachineMemOperand *MMO = MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)), + MachinePointerInfo::getFixedStack(FI), MachineMemOperand::MOLoad, MFI.getObjectSize(FI), Align); Modified: llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp?rev=144632&r1=144631&r2=144632&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp Tue Nov 15 01:34:52 2011 @@ -18,7 +18,6 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/MachineMemOperand.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/ADT/SmallVector.h" #include "Thumb1InstrInfo.h" @@ -60,8 +59,7 @@ MachineFunction &MF = *MBB.getParent(); MachineFrameInfo &MFI = *MF.getFrameInfo(); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI), MachineMemOperand::MOStore, MFI.getObjectSize(FI), MFI.getObjectAlignment(FI)); @@ -89,8 +87,7 @@ MachineFunction &MF = *MBB.getParent(); MachineFrameInfo &MFI = *MF.getFrameInfo(); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI), MachineMemOperand::MOLoad, MFI.getObjectSize(FI), MFI.getObjectAlignment(FI)); Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=144632&r1=144631&r2=144632&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Tue Nov 15 01:34:52 2011 @@ -20,7 +20,6 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineMemOperand.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/CommandLine.h" @@ -130,8 +129,7 @@ MachineFunction &MF = *MBB.getParent(); MachineFrameInfo &MFI = *MF.getFrameInfo(); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI), MachineMemOperand::MOStore, MFI.getObjectSize(FI), MFI.getObjectAlignment(FI)); @@ -158,8 +156,7 @@ MachineFunction &MF = *MBB.getParent(); MachineFrameInfo &MFI = *MF.getFrameInfo(); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI), MachineMemOperand::MOLoad, MFI.getObjectSize(FI), MFI.getObjectAlignment(FI)); Modified: llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.cpp?rev=144632&r1=144631&r2=144632&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.cpp Tue Nov 15 01:34:52 2011 @@ -19,7 +19,6 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/TargetRegistry.h" @@ -43,8 +42,7 @@ MachineFrameInfo &MFI = *MF.getFrameInfo(); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FrameIdx)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx), MachineMemOperand::MOStore, MFI.getObjectSize(FrameIdx), MFI.getObjectAlignment(FrameIdx)); @@ -72,8 +70,7 @@ MachineFrameInfo &MFI = *MF.getFrameInfo(); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FrameIdx)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx), MachineMemOperand::MOLoad, MFI.getObjectSize(FrameIdx), MFI.getObjectAlignment(FrameIdx)); Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp?rev=144632&r1=144631&r2=144632&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp Tue Nov 15 01:34:52 2011 @@ -22,7 +22,6 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" @@ -501,8 +500,7 @@ const MachineFrameInfo &MFI = *MF.getFrameInfo(); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FrameIdx)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx), MachineMemOperand::MOStore, MFI.getObjectSize(FrameIdx), MFI.getObjectAlignment(FrameIdx)); @@ -623,8 +621,7 @@ const MachineFrameInfo &MFI = *MF.getFrameInfo(); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FrameIdx)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx), MachineMemOperand::MOLoad, MFI.getObjectSize(FrameIdx), MFI.getObjectAlignment(FrameIdx)); From jay.foad at gmail.com Tue Nov 15 01:50:05 2011 From: jay.foad at gmail.com (Jay Foad) Date: Tue, 15 Nov 2011 07:50:05 -0000 Subject: [llvm-commits] [llvm] r144633 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Message-ID: <20111115075005.948FE2A6C131@llvm.org> Author: foad Date: Tue Nov 15 01:50:05 2011 New Revision: 144633 URL: http://llvm.org/viewvc/llvm-project?rev=144633&view=rev Log: Fix typo in comment. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=144633&r1=144632&r2=144633&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Nov 15 01:50:05 2011 @@ -1555,7 +1555,7 @@ } // Atomic pseudo-insts which will be lowered to ldrexd/strexd loops. -// (These psuedos use a hand-written selection code). +// (These pseudos use a hand-written selection code). let usesCustomInserter = 1, Defs = [CPSR], mayLoad = 1, mayStore = 1 in { def ATOMOR6432 : PseudoInst<(outs GPR:$dst1, GPR:$dst2), (ins GPR:$addr, GPR:$src1, GPR:$src2), From jay.foad at gmail.com Tue Nov 15 01:50:46 2011 From: jay.foad at gmail.com (Jay Foad) Date: Tue, 15 Nov 2011 07:50:46 -0000 Subject: [llvm-commits] [llvm] r144634 - in /llvm/trunk/lib/CodeGen/SelectionDAG: DAGCombiner.cpp LegalizeIntegerTypes.cpp LegalizeTypesGeneric.cpp LegalizeVectorTypes.cpp SelectionDAG.cpp SelectionDAGBuilder.cpp SelectionDAGPrinter.cpp Message-ID: <20111115075046.865C32A6C131@llvm.org> Author: foad Date: Tue Nov 15 01:50:46 2011 New Revision: 144634 URL: http://llvm.org/viewvc/llvm-project?rev=144634&view=rev Log: Remove some unnecessary includes of PseudoSourceValue.h. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=144634&r1=144633&r2=144634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Nov 15 01:50:46 2011 @@ -22,7 +22,6 @@ #include "llvm/LLVMContext.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFrameInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLowering.h" Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=144634&r1=144633&r2=144634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Tue Nov 15 01:50:46 2011 @@ -20,7 +20,6 @@ #include "LegalizeTypes.h" #include "llvm/DerivedTypes.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp?rev=144634&r1=144633&r2=144634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp Tue Nov 15 01:50:46 2011 @@ -21,7 +21,6 @@ #include "LegalizeTypes.h" #include "llvm/Target/TargetData.h" -#include "llvm/CodeGen/PseudoSourceValue.h" using namespace llvm; //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=144634&r1=144633&r2=144634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Tue Nov 15 01:50:46 2011 @@ -21,7 +21,6 @@ //===----------------------------------------------------------------------===// #include "LegalizeTypes.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=144634&r1=144633&r2=144634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Nov 15 01:50:46 2011 @@ -28,7 +28,6 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLowering.h" Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=144634&r1=144633&r2=144634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Nov 15 01:50:46 2011 @@ -41,7 +41,6 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/Analysis/DebugInfo.h" #include "llvm/Target/TargetData.h" Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=144634&r1=144633&r2=144634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Tue Nov 15 01:50:46 2011 @@ -19,7 +19,6 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" -#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Analysis/DebugInfo.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetMachine.h" From jay.foad at gmail.com Tue Nov 15 01:51:13 2011 From: jay.foad at gmail.com (Jay Foad) Date: Tue, 15 Nov 2011 07:51:13 -0000 Subject: [llvm-commits] [llvm] r144635 - /llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Message-ID: <20111115075113.E24582A6C131@llvm.org> Author: foad Date: Tue Nov 15 01:51:13 2011 New Revision: 144635 URL: http://llvm.org/viewvc/llvm-project?rev=144635&view=rev Log: Make use of MachinePointerInfo::getFixedStack. Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp?rev=144635&r1=144634&r2=144635&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp (original) +++ llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Tue Nov 15 01:51:13 2011 @@ -296,8 +296,7 @@ const MachineFrameInfo &MFI = *MF.getFrameInfo(); assert(MFI.getObjectOffset(FI) != -1); MachineMemOperand *MMO = - MF.getMachineMemOperand( - MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)), + MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI), Flags, MFI.getObjectSize(FI), MFI.getObjectAlignment(FI)); NewMI->addMemOperand(MF, MMO); From stoklund at 2pi.dk Tue Nov 15 02:20:43 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 15 Nov 2011 08:20:43 -0000 Subject: [llvm-commits] [llvm] r144636 - /llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp Message-ID: <20111115082043.AB2412A6C131@llvm.org> Author: stoklund Date: Tue Nov 15 02:20:43 2011 New Revision: 144636 URL: http://llvm.org/viewvc/llvm-project?rev=144636&view=rev Log: Check all overlaps when looking for used registers. A function using any RC alias is enough to enable the ExeDepsFix pass. Modified: llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp Modified: llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp?rev=144636&r1=144635&r2=144636&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp (original) +++ llvm/trunk/lib/CodeGen/ExecutionDepsFix.cpp Tue Nov 15 02:20:43 2011 @@ -650,10 +650,11 @@ bool anyregs = false; for (TargetRegisterClass::const_iterator I = RC->begin(), E = RC->end(); I != E; ++I) - if (MF->getRegInfo().isPhysRegUsed(*I)) { - anyregs = true; - break; - } + for (const unsigned *AI = TRI->getOverlaps(*I); *AI; ++AI) + if (MF->getRegInfo().isPhysRegUsed(*AI)) { + anyregs = true; + break; + } if (!anyregs) return false; // Initialize the AliasMap on the first use. From jay.foad at gmail.com Tue Nov 15 02:29:45 2011 From: jay.foad at gmail.com (Jay Foad) Date: Tue, 15 Nov 2011 08:29:45 +0000 Subject: [llvm-commits] [PATCH] PR889: devirtualize Value::printCustom In-Reply-To: <28388F1A-D44C-4218-A157-A177E2D114FB@apple.com> References: <28388F1A-D44C-4218-A157-A177E2D114FB@apple.com> Message-ID: On 14 November 2011 18:38, Chris Lattner wrote: > The "right" way to fix this is to eliminate PseudoSourceValue, which has always been a disgusting hack. ?Places in codegen that can uses PseudoSourceValue (e.g. the SDLoadNode and memoperands) LoadSDNode has-a MachineMemOperand, which has-a MachinePointerInfo, which is the (only?) thing that can refer to PseudoSourceValues. > should use a discriminated union of "Value* and SomeMachineLocationType". I assume you're not talking about (MC's) MachineLocation here, but about some new machine location type yet to be invented. Jay. From grosser at fim.uni-passau.de Tue Nov 15 05:38:37 2011 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Tue, 15 Nov 2011 11:38:37 -0000 Subject: [llvm-commits] [polly] r144638 - in /polly/trunk: include/polly/LinkAllPasses.h lib/Exchange/JSONExporter.cpp lib/RegisterPasses.cpp www/example_load_Polly_into_clang.html Message-ID: <20111115113837.1A12E2A6C131@llvm.org> Author: grosser Date: Tue Nov 15 05:38:36 2011 New Revision: 144638 URL: http://llvm.org/viewvc/llvm-project?rev=144638&view=rev Log: Make JScop export/reimport accessible from clang Modified: polly/trunk/include/polly/LinkAllPasses.h polly/trunk/lib/Exchange/JSONExporter.cpp polly/trunk/lib/RegisterPasses.cpp polly/trunk/www/example_load_Polly_into_clang.html Modified: polly/trunk/include/polly/LinkAllPasses.h URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/LinkAllPasses.h?rev=144638&r1=144637&r2=144638&view=diff ============================================================================== --- polly/trunk/include/polly/LinkAllPasses.h (original) +++ polly/trunk/include/polly/LinkAllPasses.h Tue Nov 15 05:38:36 2011 @@ -112,6 +112,8 @@ void initializeCodeGenerationPass(llvm::PassRegistry&); void initializeCodePreparationPass(llvm::PassRegistry&); void initializeIndependentBlocksPass(llvm::PassRegistry&); + void initializeJSONExporterPass(llvm::PassRegistry&); + void initializeJSONImporterPass(llvm::PassRegistry&); void initializeIslScheduleOptimizerPass(llvm::PassRegistry&); #ifdef SCOPLIB_FOUND void initializePoccPass(llvm::PassRegistry&); Modified: polly/trunk/lib/Exchange/JSONExporter.cpp URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=144638&r1=144637&r2=144638&view=diff ============================================================================== --- polly/trunk/lib/Exchange/JSONExporter.cpp (original) +++ polly/trunk/lib/Exchange/JSONExporter.cpp Tue Nov 15 05:38:36 2011 @@ -167,10 +167,13 @@ AU.addRequired(); } -static RegisterPass A("polly-export-jscop", - "Polly - Export Scops as JSON" - " (Writes a .jscop file for each Scop)" - ); +INITIALIZE_PASS_BEGIN(JSONExporter, "polly-export-jscop", + "Polly - Export Scops as JSON" + " (Writes a .jscop file for each Scop)", false, false) +INITIALIZE_PASS_DEPENDENCY(Dependences) +INITIALIZE_PASS_END(JSONExporter, "polly-export-jscop", + "Polly - Export Scops as JSON" + " (Writes a .jscop file for each Scop)", false, false) Pass *polly::createJSONExporterPass() { return new JSONExporter(); @@ -304,10 +307,13 @@ AU.addRequired(); } -static RegisterPass B("polly-import-jscop", - "Polly - Import Scops from JSON" - " (Reads a .jscop file for each Scop)" - ); +INITIALIZE_PASS_BEGIN(JSONImporter, "polly-import-jscop", + "Polly - Import Scops from JSON" + " (Reads a .jscop file for each Scop)", false, false) +INITIALIZE_PASS_DEPENDENCY(Dependences) +INITIALIZE_PASS_END(JSONImporter, "polly-import-jscop", + "Polly - Import Scops from JSON" + " (Reads a .jscop file for each Scop)", false, false) Pass *polly::createJSONImporterPass() { return new JSONImporter(); Modified: polly/trunk/lib/RegisterPasses.cpp URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/RegisterPasses.cpp?rev=144638&r1=144637&r2=144638&view=diff ============================================================================== --- polly/trunk/lib/RegisterPasses.cpp (original) +++ polly/trunk/lib/RegisterPasses.cpp Tue Nov 15 05:38:36 2011 @@ -41,6 +41,14 @@ cl::desc("Use the PoCC optimizer instead of the one in isl"), cl::Hidden, cl::init(false)); static cl::opt +ImportJScop("polly-run-import-jscop", + cl::desc("Export the JScop description of the detected Scops"), + cl::Hidden, cl::init(false)); +static cl::opt +ExportJScop("polly-run-export-jscop", + cl::desc("Export the JScop description of the detected Scops"), + cl::Hidden, cl::init(false)); +static cl::opt PollyViewer("polly-show", cl::desc("Enable the Polly DOT viewer in -O3"), cl::Hidden, cl::value_desc("Run the Polly DOT viewer at -O3"), @@ -69,6 +77,8 @@ initializeCodePreparationPass(Registry); initializeDependencesPass(Registry); initializeIndependentBlocksPass(Registry); + initializeJSONExporterPass(Registry); + initializeJSONImporterPass(Registry); initializeIslScheduleOptimizerPass(Registry); #ifdef SCOPLIB_FOUND initializePoccPass(Registry); @@ -137,6 +147,9 @@ if (PollyOnlyPrinter) PM.add(polly::createDOTOnlyPrinterPass()); + if (ImportJScop) + PM.add(polly::createJSONImporterPass()); + if (!DisableScheduler) { if (!UsePocc) PM.add(polly::createIslScheduleOptimizerPass()); @@ -150,9 +163,12 @@ PM.add(polly::createIslScheduleOptimizerPass()); #endif } - } + if (ExportJScop) + PM.add(polly::createJSONExporterPass()); + + if (!DisableCodegen) PM.add(polly::createCodeGenerationPass()); } Modified: polly/trunk/www/example_load_Polly_into_clang.html URL: http://llvm.org/viewvc/llvm-project/polly/trunk/www/example_load_Polly_into_clang.html?rev=144638&r1=144637&r2=144638&view=diff ============================================================================== --- polly/trunk/www/example_load_Polly_into_clang.html (original) +++ polly/trunk/www/example_load_Polly_into_clang.html Tue Nov 15 05:38:36 2011 @@ -99,6 +99,11 @@ no aliasing is possible. In case the user knows no aliasing can happen in the code the -polly-ignore-aliasing can be used to disable the check for possible aliasing. + +

Importing and exporting JScop files

+The flags -polly-run-import-jscop and -polly-run-export-jscop +allow the export and reimport of the polyhedral representation that Polly +generates for the Scops.
From grosser at fim.uni-passau.de Tue Nov 15 05:38:44 2011 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Tue, 15 Nov 2011 11:38:44 -0000 Subject: [llvm-commits] [polly] r144639 - in /polly/trunk: include/polly/ScopInfo.h lib/Analysis/ScopInfo.cpp lib/Exchange/JSONExporter.cpp Message-ID: <20111115113844.4F3BC2A6C131@llvm.org> Author: grosser Date: Tue Nov 15 05:38:44 2011 New Revision: 144639 URL: http://llvm.org/viewvc/llvm-project?rev=144639&view=rev Log: JScop: Allow to update the context Modified: polly/trunk/include/polly/ScopInfo.h polly/trunk/lib/Analysis/ScopInfo.cpp polly/trunk/lib/Exchange/JSONExporter.cpp Modified: polly/trunk/include/polly/ScopInfo.h URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=144639&r1=144638&r2=144639&view=diff ============================================================================== --- polly/trunk/include/polly/ScopInfo.h (original) +++ polly/trunk/include/polly/ScopInfo.h Tue Nov 15 05:38:44 2011 @@ -547,6 +547,8 @@ const_reverse_iterator rend() const { return Stmts.rend(); } //@} + void setContext(isl_set* NewContext); + /// @brief Align the parameters in the statement to the scop context void realignParams(); Modified: polly/trunk/lib/Analysis/ScopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=144639&r1=144638&r2=144639&view=diff ============================================================================== --- polly/trunk/lib/Analysis/ScopInfo.cpp (original) +++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Nov 15 05:38:44 2011 @@ -843,6 +843,12 @@ //===----------------------------------------------------------------------===// /// Scop class implement +void Scop::setContext(__isl_take isl_set* NewContext) { + NewContext = isl_set_align_params(NewContext, isl_set_get_space(Context)); + isl_set_free(Context); + Context = NewContext; +} + void Scop::addParams(std::vector NewParameters) { for (std::vector::iterator PI = NewParameters.begin(), PE = NewParameters.end(); PI != PE; ++PI) { Modified: polly/trunk/lib/Exchange/JSONExporter.cpp URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=144639&r1=144638&r2=144639&view=diff ============================================================================== --- polly/trunk/lib/Exchange/JSONExporter.cpp (original) +++ polly/trunk/lib/Exchange/JSONExporter.cpp Tue Nov 15 05:38:44 2011 @@ -228,6 +228,19 @@ return false; } + isl_set *OldContext = S->getContext(); + isl_set *NewContext = isl_set_read_from_str(S->getIslCtx(), + jscop["context"].asCString()); + + for (unsigned i = 0; i < isl_set_dim(OldContext, isl_dim_param); i++) { + isl_id *id = isl_set_get_dim_id(OldContext, isl_dim_param, i); + NewContext = isl_set_set_dim_id(NewContext, isl_dim_param, i, id); + + } + + isl_set_free(OldContext); + S->setContext(NewContext); + StatementToIslMapTy &NewScattering = *(new StatementToIslMapTy()); int index = 0; From grosser at fim.uni-passau.de Tue Nov 15 05:38:47 2011 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Tue, 15 Nov 2011 11:38:47 -0000 Subject: [llvm-commits] [polly] r144640 - /polly/trunk/lib/Cloog.cpp Message-ID: <20111115113847.CC2112A6C131@llvm.org> Author: grosser Date: Tue Nov 15 05:38:47 2011 New Revision: 144640 URL: http://llvm.org/viewvc/llvm-project?rev=144640&view=rev Log: Cloog: Copy parameter names from isl data structures Modified: polly/trunk/lib/Cloog.cpp Modified: polly/trunk/lib/Cloog.cpp URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Cloog.cpp?rev=144640&r1=144639&r2=144640&view=diff ============================================================================== --- polly/trunk/lib/Cloog.cpp (original) +++ polly/trunk/lib/Cloog.cpp Tue Nov 15 05:38:47 2011 @@ -179,6 +179,18 @@ CloogInput *Cloog::buildCloogInput() { CloogDomain *Context = cloog_domain_from_isl_set(S->getContext()); CloogUnionDomain *Statements = buildCloogUnionDomain(); + + isl_set *ScopContext = S->getContext(); + + for (unsigned i = 0; i < isl_set_dim(ScopContext, isl_dim_param); i++) { + isl_id *id = isl_set_get_dim_id(ScopContext, isl_dim_param, i); + Statements = cloog_union_domain_set_name(Statements, CLOOG_PARAM, i, + isl_id_get_name(id)); + isl_id_free(id); + } + + isl_set_free(ScopContext); + CloogInput *Input = cloog_input_alloc(Context, Statements); return Input; } From grosser at fim.uni-passau.de Tue Nov 15 05:38:55 2011 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Tue, 15 Nov 2011 11:38:55 -0000 Subject: [llvm-commits] [polly] r144641 - in /polly/trunk: lib/Analysis/ScopInfo.cpp test/CodeGen/loop_with_condition_2.ll test/CodeGen/single_loop_param.ll test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll test/ScopInfo/20111108-Parameter-not-detected.ll test/ScopInfo/loop_carry.ll Message-ID: <20111115113855.4EBE72A6C131@llvm.org> Author: grosser Date: Tue Nov 15 05:38:55 2011 New Revision: 144641 URL: http://llvm.org/viewvc/llvm-project?rev=144641&view=rev Log: ScopInfo: Use names of simple parameters to name the isl parameter dimensions. Parameters can be complex SCEV expressions, but they can also be single scalar values. If a parameters is such a simple scalar value and the value is named, use this name to name the isl parameter dimensions. Modified: polly/trunk/lib/Analysis/ScopInfo.cpp polly/trunk/test/CodeGen/loop_with_condition_2.ll polly/trunk/test/CodeGen/single_loop_param.ll polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll polly/trunk/test/ScopInfo/loop_carry.ll Modified: polly/trunk/lib/Analysis/ScopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=144641&r1=144640&r2=144641&view=diff ============================================================================== --- polly/trunk/lib/Analysis/ScopInfo.cpp (original) +++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Nov 15 05:38:55 2011 @@ -870,7 +870,16 @@ if (IdIter == ParameterIds.end()) return NULL; - std::string ParameterName = "p" + convertInt(IdIter->second); + std::string ParameterName; + + if (const SCEVUnknown *ValueParameter = dyn_cast(Parameter)) { + Value *Val = ValueParameter->getValue(); + ParameterName = Val->getNameStr(); + } + + if (ParameterName == "" || ParameterName.substr(0, 2) == "p_") + ParameterName = "p_" + convertInt(IdIter->second); + return isl_id_alloc(getIslCtx(), ParameterName.c_str(), (void *) Parameter); } Modified: polly/trunk/test/CodeGen/loop_with_condition_2.ll URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/loop_with_condition_2.ll?rev=144641&r1=144640&r2=144641&view=diff ============================================================================== --- polly/trunk/test/CodeGen/loop_with_condition_2.ll (original) +++ polly/trunk/test/CodeGen/loop_with_condition_2.ll Tue Nov 15 05:38:55 2011 @@ -132,11 +132,11 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind -; CHECK: for (c2=0;c2<=min(1023,M+1024);c2++) { +; CHECK: for (c2=0;c2<=min(1023,m+1024);c2++) { ; CHECK: Stmt_if_then(c2); ; CHECK: Stmt_if_end(c2); ; CHECK: } -; CHECK: for (c2=max(0,M+1025);c2<=1023;c2++) { +; CHECK: for (c2=max(0,m+1025);c2<=1023;c2++) { ; CHECK: Stmt_if_else(c2); ; CHECK: Stmt_if_end(c2); ; CHECK: } Modified: polly/trunk/test/CodeGen/single_loop_param.ll URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/single_loop_param.ll?rev=144641&r1=144640&r2=144641&view=diff ============================================================================== --- polly/trunk/test/CodeGen/single_loop_param.ll (original) +++ polly/trunk/test/CodeGen/single_loop_param.ll Tue Nov 15 05:38:55 2011 @@ -70,8 +70,8 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind -; CHECK: if (M >= 1) { -; CHECK: for (c2=0;c2<=M-1;c2++) { +; CHECK: if (n >= 1) { +; CHECK: for (c2=0;c2<=n-1;c2++) { ; CHECK: Stmt_bb2(c2); ; CHECK: } ; CHECK: } Modified: polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll?rev=144641&r1=144640&r2=144641&view=diff ============================================================================== --- polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll (original) +++ polly/trunk/test/ScheduleOptimizer/2011-08-25-crash_in_vectorizer.ll Tue Nov 15 05:38:55 2011 @@ -29,18 +29,18 @@ ret void } -; CHECK: if (M >= 1) { -; CHECK: for (c1=0;c1<=M-1;c1+=32) { -; CHECK: for (c2=c1;c2<=min(M-1,c1+31);c2++) { +; CHECK: if (p_0 >= 1) { +; CHECK: for (c1=0;c1<=p_0-1;c1+=32) { +; CHECK: for (c2=c1;c2<=min(c1+31,p_0-1);c2++) { ; CHECK: Stmt_bb2(c2); ; CHECK: } ; CHECK: } ; CHECK: } -; VECTOR: if (M >= 1) { -; VECTOR: for (c1=0;c1<=M-1;c1+=32) { -; VECTOR: for (c2=-4*floord(-c1,4);c2<=min(M-1,c1+31);c2+=4) { -; VECTOR: for (c3=c2;c3<=min(M-1,c2+3);c3++) { +; VECTOR: if (p_0 >= 1) { +; VECTOR: for (c1=0;c1<=p_0-1;c1+=32) { +; VECTOR: for (c2=-4*floord(-c1,4);c2<=min(c1+31,p_0-1);c2+=4) { +; VECTOR: for (c3=c2;c3<=min(c2+3,p_0-1);c3++) { ; VECTOR: Stmt_bb2(c3); ; VECTOR: } ; VECTOR: } Modified: polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll?rev=144641&r1=144640&r2=144641&view=diff ============================================================================== --- polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll (original) +++ polly/trunk/test/ScopInfo/20111108-Parameter-not-detected.ll Tue Nov 15 05:38:55 2011 @@ -52,5 +52,5 @@ } ; CHECK: Domain := -; CHECK: [p0] -> { Stmt_if_then[i0] : i0 >= 0 and i0 <= 1022 and i0 >= 1001 - p0 }; +; CHECK: [p_0] -> { Stmt_if_then[i0] : i0 >= 0 and i0 <= 1022 and i0 >= 1001 - p_0 }; Modified: polly/trunk/test/ScopInfo/loop_carry.ll URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/loop_carry.ll?rev=144641&r1=144640&r2=144641&view=diff ============================================================================== --- polly/trunk/test/ScopInfo/loop_carry.ll (original) +++ polly/trunk/test/ScopInfo/loop_carry.ll Tue Nov 15 05:38:55 2011 @@ -47,46 +47,46 @@ } ; CHECK: Context: -; CHECK: [p0] -> { : } +; CHECK: [n] -> { : } ; CHECK: Statements { ; CHECK: Stmt_bb_nph ; CHECK: Domain := -; CHECK: [p0] -> { Stmt_bb_nph[] : p0 >= 2 }; +; CHECK: [n] -> { Stmt_bb_nph[] : n >= 2 }; ; CHECK: Scattering := -; CHECK: [p0] -> { Stmt_bb_nph[] -> scattering[0, 0, 0] }; +; CHECK: [n] -> { Stmt_bb_nph[] -> scattering[0, 0, 0] }; ; CHECK: ReadAccess := -; CHECK: [p0] -> { Stmt_bb_nph[] -> MemRef_a[0] }; +; CHECK: [n] -> { Stmt_bb_nph[] -> MemRef_a[0] }; ; CHECK: WriteAccess := -; CHECK: [p0] -> { Stmt_bb_nph[] -> MemRef_k_05_reg2mem[0] }; +; CHECK: [n] -> { Stmt_bb_nph[] -> MemRef_k_05_reg2mem[0] }; ; CHECK: WriteAccess := -; CHECK: [p0] -> { Stmt_bb_nph[] -> MemRef__reg2mem[0] }; +; CHECK: [n] -> { Stmt_bb_nph[] -> MemRef__reg2mem[0] }; ; CHECK: Stmt_bb ; CHECK: Domain := -; CHECK: [p0] -> { Stmt_bb[i0] : i0 >= 0 and i0 <= -2 + p0 and p0 >= 2 }; +; CHECK: [n] -> { Stmt_bb[i0] : i0 >= 0 and i0 <= -2 + n and n >= 2 }; ; CHECK: Scattering := -; CHECK: [p0] -> { Stmt_bb[i0] -> scattering[1, i0, 0] }; +; CHECK: [n] -> { Stmt_bb[i0] -> scattering[1, i0, 0] }; ; CHECK: ReadAccess := -; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef__reg2mem[0] }; +; CHECK: [n] -> { Stmt_bb[i0] -> MemRef__reg2mem[0] }; ; CHECK: ReadAccess := -; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_k_05_reg2mem[0] }; +; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_k_05_reg2mem[0] }; ; CHECK: WriteAccess := -; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_a[1 + i0] }; +; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_a[1 + i0] }; ; CHECK: ReadAccess := -; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_a[2 + 2i0] }; +; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_a[2 + 2i0] }; ; CHECK: ReadAccess := -; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_a[4 + i0] }; +; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_a[4 + i0] }; ; CHECK: WriteAccess := -; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef_k_05_reg2mem[0] }; +; CHECK: [n] -> { Stmt_bb[i0] -> MemRef_k_05_reg2mem[0] }; ; CHECK: WriteAccess := -; CHECK: [p0] -> { Stmt_bb[i0] -> MemRef__reg2mem[0] }; +; CHECK: [n] -> { Stmt_bb[i0] -> MemRef__reg2mem[0] }; ; CHECK: FinalRead ; CHECK: Domain := -; CHECK: [p0] -> { FinalRead[0] }; +; CHECK: [n] -> { FinalRead[0] }; ; CHECK: Scattering := -; CHECK: [p0] -> { FinalRead[i0] -> scattering[200000000, o1, o2] }; +; CHECK: [n] -> { FinalRead[i0] -> scattering[200000000, o1, o2] }; ; CHECK: ReadAccess := -; CHECK: [p0] -> { FinalRead[i0] -> MemRef_a[o0] }; +; CHECK: [n] -> { FinalRead[i0] -> MemRef_a[o0] }; ; CHECK: ReadAccess := -; CHECK: [p0] -> { FinalRead[i0] -> MemRef_k_05_reg2mem[o0] }; +; CHECK: [n] -> { FinalRead[i0] -> MemRef_k_05_reg2mem[o0] }; ; CHECK: ReadAccess := ; CHECK: -> { FinalRead[i0] -> MemRef__reg2mem[o0] }; From grosser at fim.uni-passau.de Tue Nov 15 05:38:59 2011 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Tue, 15 Nov 2011 11:38:59 -0000 Subject: [llvm-commits] [polly] r144642 - /polly/trunk/lib/Exchange/JSONExporter.cpp Message-ID: <20111115113859.603292A6C131@llvm.org> Author: grosser Date: Tue Nov 15 05:38:59 2011 New Revision: 144642 URL: http://llvm.org/viewvc/llvm-project?rev=144642&view=rev Log: JSONImporter: Fix parameter ids when importing new access functions The new isl_id support for parmeters created problems when importing new access functions. Even though the parameters had the same names, they were mapped to different ids and where therefore incompatible. We copy the ids now from the old parameter dimensions. This fixes the problem. Modified: polly/trunk/lib/Exchange/JSONExporter.cpp Modified: polly/trunk/lib/Exchange/JSONExporter.cpp URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=144642&r1=144641&r2=144642&view=diff ============================================================================== --- polly/trunk/lib/Exchange/JSONExporter.cpp (original) +++ polly/trunk/lib/Exchange/JSONExporter.cpp Tue Nov 15 05:38:59 2011 @@ -285,6 +285,25 @@ isl_map *newAccessMap = isl_map_read_from_str(S->getIslCtx(), accesses.asCString()); isl_map *currentAccessMap = (*MI)->getAccessRelation(); + + if (isl_map_dim(newAccessMap, isl_dim_param) != + isl_map_dim(currentAccessMap, isl_dim_param)) { + errs() << "JScop file changes the number of parameter dimensions\n"; + isl_map_free(currentAccessMap); + isl_map_free(newAccessMap); + return false; + + } + + // We need to copy the isl_ids for the parameter dimensions to the new + // map. Without doing this the current map would have different + // ids then the new one, even though both are named identically. + for (unsigned i = 0; i < isl_map_dim(currentAccessMap, isl_dim_param); + i++) { + isl_id *id = isl_map_get_dim_id(currentAccessMap, isl_dim_param, i); + newAccessMap = isl_map_set_dim_id(newAccessMap, isl_dim_param, i, id); + } + if (!isl_map_has_equal_space(currentAccessMap, newAccessMap)) { errs() << "JScop file contains access function with incompatible " << "dimensions\n"; From grosser at fim.uni-passau.de Tue Nov 15 05:39:03 2011 From: grosser at fim.uni-passau.de (Tobias Grosser) Date: Tue, 15 Nov 2011 11:39:03 -0000 Subject: [llvm-commits] [polly] r144643 - /polly/trunk/lib/Exchange/ScopLib.cpp Message-ID: <20111115113903.2D4002A6C131@llvm.org> Author: grosser Date: Tue Nov 15 05:39:02 2011 New Revision: 144643 URL: http://llvm.org/viewvc/llvm-project?rev=144643&view=rev Log: ScopLib: Fix export/import after parameters are now tagged with isl_ids. Modified: polly/trunk/lib/Exchange/ScopLib.cpp Modified: polly/trunk/lib/Exchange/ScopLib.cpp URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/ScopLib.cpp?rev=144643&r1=144642&r2=144643&view=diff ============================================================================== --- polly/trunk/lib/Exchange/ScopLib.cpp (original) +++ polly/trunk/lib/Exchange/ScopLib.cpp Tue Nov 15 05:39:02 2011 @@ -641,6 +641,20 @@ isl_ctx *ctx = PollyStmt->getParent()->getIslCtx(); isl_space *Space = isl_dim_alloc(ctx, NbParam, NbIterators, NbScattering); + + isl_space *ParamSpace = PollyStmt->getParent()->getParamSpace(); + + // We need to copy the isl_ids for the parameter dimensions to the new + // map. Without doing this the current map would have different + // ids then the new one, even though both are named identically. + for (unsigned i = 0; i < isl_space_dim(Space, isl_dim_param); + i++) { + isl_id *id = isl_space_get_dim_id(ParamSpace, isl_dim_param, i); + Space = isl_space_set_dim_id(Space, isl_dim_param, i, id); + } + + isl_space_free(ParamSpace); + Space = isl_space_set_tuple_name(Space, isl_dim_out, "scattering"); Space = isl_space_set_tuple_name(Space, isl_dim_in, PollyStmt->getBaseName()); @@ -663,6 +677,14 @@ typedef Dependences::StatementToIslMapTy StatementToIslMapTy; +void freeStmtToIslMap(StatementToIslMapTy *Map) { + for (StatementToIslMapTy::iterator MI = Map->begin(), ME = Map->end(); + MI != ME; ++MI) + isl_map_free(MI->second); + + delete (Map); +} + /// @brief Read the new scattering from the scoplib description. /// /// @S The Scop to update @@ -690,7 +712,7 @@ if (!stmt) { errs() << "Not enough statements available in OpenScop file\n"; - delete &NewScattering; + freeStmtToIslMap(&NewScattering); return NULL; } @@ -701,7 +723,7 @@ if (stmt) { errs() << "Too many statements in OpenScop file\n"; - delete &NewScattering; + freeStmtToIslMap(&NewScattering); return NULL; } @@ -720,6 +742,7 @@ return false; if (!D->isValidScattering(NewScattering)) { + freeStmtToIslMap(NewScattering); errs() << "OpenScop file contains a scattering that changes the " << "dependences. Use -disable-polly-legality to continue anyways\n"; return false; @@ -730,9 +753,10 @@ ScopStmt *Stmt = *SI; if (NewScattering->find(Stmt) != NewScattering->end()) - Stmt->setScattering((*NewScattering)[Stmt]); + Stmt->setScattering(isl_map_copy((*NewScattering)[Stmt])); } + freeStmtToIslMap(NewScattering); return true; } } From rafael.espindola at gmail.com Tue Nov 15 09:05:43 2011 From: rafael.espindola at gmail.com (=?ISO-8859-1?Q?Rafael_=C1vila_de_Esp=EDndola?=) Date: Tue, 15 Nov 2011 10:05:43 -0500 Subject: [llvm-commits] [llvm] r144267 - in /llvm/trunk: lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp test/CodeGen/X86/2006-05-11-InstrSched.ll test/CodeGen/X86/2009-04-21-NoReloadImpDef.ll test/CodeGen/X86/change-compare-stride-1.ll test/CodeGen/X86/fold-pcmpeqd-0.ll test/CodeGen/X86/iv-users-in-other-loops.ll test/CodeGen/X86/lsr-loop-exit-cond.ll test/CodeGen/X86/lsr-reuse-trunc.ll test/CodeGen/X86/masked-iv-safe.ll test/CodeGen/X86/multiple-loop-post-inc.ll test/CodeGen/X86/sse2.ll test/CodeGen/X86/sse3.ll In-Reply-To: <4EBC9D90.50805@free.fr> References: <20111110074316.A97871BE001@llvm.org> <4EBBB1ED.8000105@free.fr> <9FD603CE-74CE-4B7A-AC1D-87466E187F82@apple.com> <4EBC9D90.50805@free.fr> Message-ID: <4EC27FC7.4020205@gmail.com> On 11/10/2011 10:59 PM, Duncan Sands wrote: > Hi Evan, > >> That's really bizarre. It's obviously exposing a unrelated bug. Thanks for looking into this. > > I think this is a case of PR11200: the code generators make decisions based on > floating point computations. On i386, GCC uses the floating point stack, while > LLVM uses xmm registers, when building LLVM. This results in codegen sometimes > making different decisions due to different rounding. Can't we just use -msse when building stage1 or do a bootstrap4? > I've disabled the part of the dragonegg bootstrap that compares object files > produced by GCC compiled LLVM with those produced by LLVM compiled LLVM as a > workaround. > > Ciao, Duncan. Cheers, Rafael From benny.kra at googlemail.com Tue Nov 15 10:26:39 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 15 Nov 2011 16:26:39 -0000 Subject: [llvm-commits] [llvm] r144647 - in /llvm/trunk: include/llvm/CodeGen/EdgeBundles.h include/llvm/Support/GraphWriter.h lib/Analysis/CFGPrinter.cpp lib/CodeGen/EdgeBundles.cpp lib/CodeGen/MachineFunction.cpp lib/CodeGen/ScheduleDAGPrinter.cpp lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Message-ID: <20111115162639.533842A6C131@llvm.org> Author: d0k Date: Tue Nov 15 10:26:38 2011 New Revision: 144647 URL: http://llvm.org/viewvc/llvm-project?rev=144647&view=rev Log: Twinify GraphWriter a little bit. Modified: llvm/trunk/include/llvm/CodeGen/EdgeBundles.h llvm/trunk/include/llvm/Support/GraphWriter.h llvm/trunk/lib/Analysis/CFGPrinter.cpp llvm/trunk/lib/CodeGen/EdgeBundles.cpp llvm/trunk/lib/CodeGen/MachineFunction.cpp llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Modified: llvm/trunk/include/llvm/CodeGen/EdgeBundles.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/EdgeBundles.h?rev=144647&r1=144646&r2=144647&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/EdgeBundles.h (original) +++ llvm/trunk/include/llvm/CodeGen/EdgeBundles.h Tue Nov 15 10:26:38 2011 @@ -18,6 +18,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/IntEqClasses.h" +#include "llvm/ADT/Twine.h" #include "llvm/CodeGen/MachineFunctionPass.h" namespace llvm { @@ -61,7 +62,7 @@ /// Specialize WriteGraph, the standard implementation won't work. raw_ostream &WriteGraph(raw_ostream &O, const EdgeBundles &G, bool ShortNames = false, - const std::string &Title = ""); + const Twine &Title = ""); } // end namespace llvm Modified: llvm/trunk/include/llvm/Support/GraphWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GraphWriter.h?rev=144647&r1=144646&r2=144647&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/GraphWriter.h (original) +++ llvm/trunk/include/llvm/Support/GraphWriter.h Tue Nov 15 10:26:38 2011 @@ -296,26 +296,26 @@ template raw_ostream &WriteGraph(raw_ostream &O, const GraphType &G, bool ShortNames = false, - const std::string &Title = "") { + const Twine &Title = "") { // Start the graph emission process... GraphWriter W(O, G, ShortNames); // Emit the graph. - W.writeGraph(Title); + W.writeGraph(Title.str()); return O; } template -sys::Path WriteGraph(const GraphType &G, const std::string &Name, - bool ShortNames = false, const std::string &Title = "") { +sys::Path WriteGraph(const GraphType &G, const Twine &Name, + bool ShortNames = false, const Twine &Title = "") { std::string ErrMsg; sys::Path Filename = sys::Path::GetTemporaryDirectory(&ErrMsg); if (Filename.isEmpty()) { errs() << "Error: " << ErrMsg << "\n"; return Filename; } - Filename.appendComponent(Name + ".dot"); + Filename.appendComponent((Name + ".dot").str()); if (Filename.makeUnique(true,&ErrMsg)) { errs() << "Error: " << ErrMsg << "\n"; return sys::Path(); @@ -341,8 +341,8 @@ /// then cleanup. For use from the debugger. /// template -void ViewGraph(const GraphType &G, const std::string &Name, - bool ShortNames = false, const std::string &Title = "", +void ViewGraph(const GraphType &G, const Twine &Name, + bool ShortNames = false, const Twine &Title = "", GraphProgram::Name Program = GraphProgram::DOT) { sys::Path Filename = llvm::WriteGraph(G, Name, ShortNames, Title); Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=144647&r1=144646&r2=144647&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Tue Nov 15 10:26:38 2011 @@ -143,7 +143,7 @@ /// being a 'dot' and 'gv' program in your path. /// void Function::viewCFG() const { - ViewGraph(this, "cfg" + getNameStr()); + ViewGraph(this, "cfg" + getName()); } /// viewCFGOnly - This function is meant for use from the debugger. It works @@ -152,7 +152,7 @@ /// his can make the graph smaller. /// void Function::viewCFGOnly() const { - ViewGraph(this, "cfg" + getNameStr(), true); + ViewGraph(this, "cfg" + getName(), true); } FunctionPass *llvm::createCFGPrinterPass () { Modified: llvm/trunk/lib/CodeGen/EdgeBundles.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/EdgeBundles.cpp?rev=144647&r1=144646&r2=144647&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/EdgeBundles.cpp (original) +++ llvm/trunk/lib/CodeGen/EdgeBundles.cpp Tue Nov 15 10:26:38 2011 @@ -77,7 +77,7 @@ /// Specialize WriteGraph, the standard implementation won't work. raw_ostream &llvm::WriteGraph(raw_ostream &O, const EdgeBundles &G, bool ShortNames, - const std::string &Title) { + const Twine &Title) { const MachineFunction *MF = G.getMachineFunction(); O << "digraph {\n"; Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=144647&r1=144646&r2=144647&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Tue Nov 15 10:26:38 2011 @@ -368,7 +368,7 @@ void MachineFunction::viewCFG() const { #ifndef NDEBUG - ViewGraph(this, "mf" + getFunction()->getNameStr()); + ViewGraph(this, "mf" + getFunction()->getName()); #else errs() << "MachineFunction::viewCFG is only available in debug builds on " << "systems with Graphviz or gv!\n"; @@ -378,7 +378,7 @@ void MachineFunction::viewCFGOnly() const { #ifndef NDEBUG - ViewGraph(this, "mf" + getFunction()->getNameStr(), true); + ViewGraph(this, "mf" + getFunction()->getName(), true); #else errs() << "MachineFunction::viewCFGOnly is only available in debug builds on " << "systems with Graphviz or gv!\n"; Modified: llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp?rev=144647&r1=144646&r2=144647&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp Tue Nov 15 10:26:38 2011 @@ -86,12 +86,12 @@ // This code is only for debugging! #ifndef NDEBUG if (BB->getBasicBlock()) - ViewGraph(this, "dag." + MF.getFunction()->getNameStr(), false, - "Scheduling-Units Graph for " + MF.getFunction()->getNameStr() + - ":" + BB->getBasicBlock()->getNameStr()); + ViewGraph(this, "dag." + MF.getFunction()->getName(), false, + "Scheduling-Units Graph for " + MF.getFunction()->getName() + + ":" + BB->getBasicBlock()->getName()); else - ViewGraph(this, "dag." + MF.getFunction()->getNameStr(), false, - "Scheduling-Units Graph for " + MF.getFunction()->getNameStr()); + ViewGraph(this, "dag." + MF.getFunction()->getName(), false, + "Scheduling-Units Graph for " + MF.getFunction()->getName()); #else errs() << "ScheduleDAG::viewGraph is only available in debug builds on " << "systems with Graphviz or gv!\n"; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=144647&r1=144646&r2=144647&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Tue Nov 15 10:26:38 2011 @@ -147,7 +147,7 @@ void SelectionDAG::viewGraph(const std::string &Title) { // This code is only for debugging! #ifndef NDEBUG - ViewGraph(this, "dag." + getMachineFunction().getFunction()->getNameStr(), + ViewGraph(this, "dag." + getMachineFunction().getFunction()->getName(), false, Title); #else errs() << "SelectionDAG::viewGraph is only available in debug builds on " From benny.kra at googlemail.com Tue Nov 15 10:27:03 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 15 Nov 2011 16:27:03 -0000 Subject: [llvm-commits] [llvm] r144648 - in /llvm/trunk: include/llvm/Analysis/ lib/Analysis/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/Interpreter/ lib/ExecutionEngine/JIT/ lib/Transforms/IPO/ lib/Transforms/InstCombine/ lib/Transforms/Instrumentation/ lib/VMCore/ tools/bugpoint/ tools/llvm-prof/ tools/opt/ Message-ID: <20111115162704.C55002A6C131@llvm.org> Author: d0k Date: Tue Nov 15 10:27:03 2011 New Revision: 144648 URL: http://llvm.org/viewvc/llvm-project?rev=144648&view=rev Log: Remove all remaining uses of Value::getNameStr(). Modified: llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h llvm/trunk/include/llvm/Analysis/CFGPrinter.h llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp llvm/trunk/lib/Analysis/CFGPrinter.cpp llvm/trunk/lib/Analysis/PathProfileVerifier.cpp llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp llvm/trunk/lib/Analysis/SparsePropagation.cpp llvm/trunk/lib/Analysis/Trace.cpp llvm/trunk/lib/CodeGen/GCMetadata.cpp llvm/trunk/lib/CodeGen/MachineFunction.cpp llvm/trunk/lib/CodeGen/MachineVerifier.cpp llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/ShrinkWrapping.cpp llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp llvm/trunk/lib/VMCore/Value.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/llvm-prof/llvm-prof.cpp llvm/trunk/tools/opt/PrintSCC.cpp llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h (original) +++ llvm/trunk/include/llvm/Analysis/BlockFrequencyImpl.h Tue Nov 15 10:27:03 2011 @@ -24,7 +24,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include -#include #include namespace llvm { @@ -52,15 +51,16 @@ const uint32_t EntryFreq; std::string getBlockName(BasicBlock *BB) const { - return BB->getNameStr(); + return BB->getName().str(); } std::string getBlockName(MachineBasicBlock *MBB) const { - std::stringstream ss; + std::string str; + raw_string_ostream ss(str); ss << "BB#" << MBB->getNumber(); if (const BasicBlock *BB = MBB->getBasicBlock()) - ss << " derived from LLVM BB " << BB->getNameStr(); + ss << " derived from LLVM BB " << BB->getName(); return ss.str(); } Modified: llvm/trunk/include/llvm/Analysis/CFGPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CFGPrinter.h?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/CFGPrinter.h (original) +++ llvm/trunk/include/llvm/Analysis/CFGPrinter.h Tue Nov 15 10:27:03 2011 @@ -29,13 +29,13 @@ DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {} static std::string getGraphName(const Function *F) { - return "CFG for '" + F->getNameStr() + "' function"; + return "CFG for '" + F->getName().str() + "' function"; } static std::string getSimpleNodeLabel(const BasicBlock *Node, const Function *) { if (!Node->getName().empty()) - return Node->getNameStr(); + return Node->getName().str(); std::string Str; raw_string_ostream OS(Str); Modified: llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h (original) +++ llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h Tue Nov 15 10:27:03 2011 @@ -31,7 +31,7 @@ std::string Title, GraphName; Graph = &getAnalysis(); GraphName = DOTGraphTraits::getGraphName(Graph); - Title = GraphName + " for '" + F.getNameStr() + "' function"; + Title = GraphName + " for '" + F.getName().str() + "' function"; ViewGraph(Graph, Name, Simple, Title); return false; @@ -55,7 +55,7 @@ virtual bool runOnFunction(Function &F) { Analysis *Graph; - std::string Filename = Name + "." + F.getNameStr() + ".dot"; + std::string Filename = Name + "." + F.getName().str() + ".dot"; errs() << "Writing '" << Filename << "'..."; std::string ErrorInfo; @@ -64,7 +64,7 @@ std::string Title, GraphName; GraphName = DOTGraphTraits::getGraphName(Graph); - Title = GraphName + " for '" + F.getNameStr() + "' function"; + Title = GraphName + " for '" + F.getName().str() + "' function"; if (ErrorInfo.empty()) WriteGraph(File, Graph, Simple, Title); Modified: llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp (original) +++ llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp Tue Nov 15 10:27:03 2011 @@ -480,8 +480,8 @@ void BranchProbabilityInfo:: setEdgeWeight(const BasicBlock *Src, const BasicBlock *Dst, uint32_t Weight) { Weights[std::make_pair(Src, Dst)] = Weight; - DEBUG(dbgs() << "set edge " << Src->getNameStr() << " -> " - << Dst->getNameStr() << " weight to " << Weight + DEBUG(dbgs() << "set edge " << Src->getName() << " -> " + << Dst->getName() << " weight to " << Weight << (isEdgeHot(Src, Dst) ? " [is HOT now]\n" : "\n")); } @@ -501,7 +501,7 @@ const BasicBlock *Dst) const { const BranchProbability Prob = getEdgeProbability(Src, Dst); - OS << "edge " << Src->getNameStr() << " -> " << Dst->getNameStr() + OS << "edge " << Src->getName() << " -> " << Dst->getName() << " probability is " << Prob << (isEdgeHot(Src, Dst) ? " [HOT edge]\n" : "\n"); Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Tue Nov 15 10:27:03 2011 @@ -77,7 +77,7 @@ } virtual bool runOnFunction(Function &F) { - std::string Filename = "cfg." + F.getNameStr() + ".dot"; + std::string Filename = "cfg." + F.getName().str() + ".dot"; errs() << "Writing '" << Filename << "'..."; std::string ErrorInfo; @@ -111,7 +111,7 @@ } virtual bool runOnFunction(Function &F) { - std::string Filename = "cfg." + F.getNameStr() + ".dot"; + std::string Filename = "cfg." + F.getName().str() + ".dot"; errs() << "Writing '" << Filename << "'..."; std::string ErrorInfo; Modified: llvm/trunk/lib/Analysis/PathProfileVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PathProfileVerifier.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/PathProfileVerifier.cpp (original) +++ llvm/trunk/lib/Analysis/PathProfileVerifier.cpp Tue Nov 15 10:27:03 2011 @@ -137,22 +137,22 @@ BasicBlock* source = nextEdge->getSource(); BasicBlock* target = nextEdge->getTarget(); unsigned duplicateNumber = nextEdge->getDuplicateNumber(); - DEBUG(dbgs () << source->getNameStr() << " --{" << duplicateNumber - << "}--> " << target->getNameStr()); + DEBUG(dbgs() << source->getName() << " --{" << duplicateNumber + << "}--> " << target->getName()); // Ensure all the referenced edges exist // TODO: make this a separate function if( !arrayMap.count(source) ) { - errs() << " error [" << F->getNameStr() << "()]: source '" - << source->getNameStr() + errs() << " error [" << F->getName() << "()]: source '" + << source->getName() << "' does not exist in the array map.\n"; } else if( !arrayMap[source].count(target) ) { - errs() << " error [" << F->getNameStr() << "()]: target '" - << target->getNameStr() + errs() << " error [" << F->getName() << "()]: target '" + << target->getName() << "' does not exist in the array map.\n"; } else if( !arrayMap[source][target].count(duplicateNumber) ) { - errs() << " error [" << F->getNameStr() << "()]: edge " - << source->getNameStr() << " -> " << target->getNameStr() + errs() << " error [" << F->getName() << "()]: edge " + << source->getName() << " -> " << target->getName() << " duplicate number " << duplicateNumber << " does not exist in the array map.\n"; } else { Modified: llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp Tue Nov 15 10:27:03 2011 @@ -332,7 +332,7 @@ // Clear Minimal Edges. MinimalWeight.clear(); - DEBUG(dbgs() << "Working on function " << F.getNameStr() << "\n"); + DEBUG(dbgs() << "Working on function " << F.getName() << "\n"); // Since the entry block is the first one and has no predecessors, the edge // (0,entry) is inserted with the starting weight of 1. Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Tue Nov 15 10:27:03 2011 @@ -160,7 +160,7 @@ ReadCount = 0; for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { if (F->isDeclaration()) continue; - DEBUG(dbgs()<<"Working on "<getNameStr()<<"\n"); + DEBUG(dbgs() << "Working on " << F->getName() << "\n"); readEdge(getEdge(0,&F->getEntryBlock()), Counters); for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { TerminatorInst *TI = BB->getTerminator(); @@ -181,7 +181,7 @@ ReadCount = 0; for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { if (F->isDeclaration()) continue; - DEBUG(dbgs()<<"Working on "<getNameStr()<<"\n"); + DEBUG(dbgs() << "Working on " << F->getName() << "\n"); readEdge(getEdge(0,&F->getEntryBlock()), Counters); for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { TerminatorInst *TI = BB->getTerminator(); Modified: llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp Tue Nov 15 10:27:03 2011 @@ -125,8 +125,8 @@ outCount++; } } - dbgs() << "Block " << BB->getNameStr() << " in " - << BB->getParent()->getNameStr() << ":" + dbgs() << "Block " << BB->getName() << " in " + << BB->getParent()->getName() << ":" << "BBWeight=" << format("%20.20g",BBWeight) << "," << "inWeight=" << format("%20.20g",inWeight) << "," << "inCount=" << inCount << "," @@ -143,8 +143,8 @@ template void ProfileVerifierPassT::debugEntry (DetailedBlockInfo *DI) { - dbgs() << "TROUBLE: Block " << DI->BB->getNameStr() << " in " - << DI->BB->getParent()->getNameStr() << ":" + dbgs() << "TROUBLE: Block " << DI->BB->getName() << " in " + << DI->BB->getParent()->getName() << ":" << "BBWeight=" << format("%20.20g",DI->BBWeight) << "," << "inWeight=" << format("%20.20g",DI->inWeight) << "," << "inCount=" << DI->inCount << "," @@ -201,13 +201,13 @@ double EdgeWeight = PI->getEdgeWeight(E); if (EdgeWeight == ProfileInfoT::MissingValue) { dbgs() << "Edge " << E << " in Function " - << ProfileInfoT::getFunction(E)->getNameStr() << ": "; + << ProfileInfoT::getFunction(E)->getName() << ": "; ASSERTMESSAGE("Edge has missing value"); return 0; } else { if (EdgeWeight < 0) { dbgs() << "Edge " << E << " in Function " - << ProfileInfoT::getFunction(E)->getNameStr() << ": "; + << ProfileInfoT::getFunction(E)->getName() << ": "; ASSERTMESSAGE("Edge has negative value"); } return EdgeWeight; @@ -220,8 +220,8 @@ DetailedBlockInfo *DI) { if (Error) { DEBUG(debugEntry(DI)); - dbgs() << "Block " << DI->BB->getNameStr() << " in Function " - << DI->BB->getParent()->getNameStr() << ": "; + dbgs() << "Block " << DI->BB->getName() << " in Function " + << DI->BB->getParent()->getName() << ": "; ASSERTMESSAGE(Message); } return; Modified: llvm/trunk/lib/Analysis/SparsePropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/SparsePropagation.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/SparsePropagation.cpp (original) +++ llvm/trunk/lib/Analysis/SparsePropagation.cpp Tue Nov 15 10:27:03 2011 @@ -327,13 +327,13 @@ } void SparseSolver::Print(Function &F, raw_ostream &OS) const { - OS << "\nFUNCTION: " << F.getNameStr() << "\n"; + OS << "\nFUNCTION: " << F.getName() << "\n"; for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { if (!BBExecutable.count(BB)) OS << "INFEASIBLE: "; OS << "\t"; if (BB->hasName()) - OS << BB->getNameStr() << ":\n"; + OS << BB->getName() << ":\n"; else OS << "; anon bb\n"; for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) { Modified: llvm/trunk/lib/Analysis/Trace.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Trace.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Trace.cpp (original) +++ llvm/trunk/lib/Analysis/Trace.cpp Tue Nov 15 10:27:03 2011 @@ -34,7 +34,7 @@ /// void Trace::print(raw_ostream &O) const { Function *F = getFunction(); - O << "; Trace from function " << F->getNameStr() << ", blocks:\n"; + O << "; Trace from function " << F->getName() << ", blocks:\n"; for (const_iterator i = begin(), e = end(); i != e; ++i) { O << "; "; WriteAsOperand(O, *i, true, getModule()); Modified: llvm/trunk/lib/CodeGen/GCMetadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCMetadata.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCMetadata.cpp (original) +++ llvm/trunk/lib/CodeGen/GCMetadata.cpp Tue Nov 15 10:27:03 2011 @@ -156,12 +156,12 @@ GCFunctionInfo *FD = &getAnalysis().getFunctionInfo(F); - OS << "GC roots for " << FD->getFunction().getNameStr() << ":\n"; + OS << "GC roots for " << FD->getFunction().getName() << ":\n"; for (GCFunctionInfo::roots_iterator RI = FD->roots_begin(), RE = FD->roots_end(); RI != RE; ++RI) OS << "\t" << RI->Num << "\t" << RI->StackOffset << "[sp]\n"; - OS << "GC safe points for " << FD->getFunction().getNameStr() << ":\n"; + OS << "GC safe points for " << FD->getFunction().getName() << ":\n"; for (GCFunctionInfo::iterator PI = FD->begin(), PE = FD->end(); PI != PE; ++PI) { Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Tue Nov 15 10:27:03 2011 @@ -335,7 +335,7 @@ DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {} static std::string getGraphName(const MachineFunction *F) { - return "CFG for '" + F->getFunction()->getNameStr() + "' function"; + return "CFG for '" + F->getFunction()->getName().str() + "' function"; } std::string getNodeLabel(const MachineBasicBlock *Node, Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Tue Nov 15 10:27:03 2011 @@ -320,7 +320,7 @@ MF->print(*OS, Indexes); } *OS << "*** Bad machine code: " << msg << " ***\n" - << "- function: " << MF->getFunction()->getNameStr() << "\n"; + << "- function: " << MF->getFunction()->getName() << "\n"; } void MachineVerifier::report(const char *msg, const MachineBasicBlock *MBB) { Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Tue Nov 15 10:27:03 2011 @@ -248,8 +248,8 @@ static int bbcnt = 0; if (bbcnt++ % DebugDiv != DebugMod) continue; - dbgs() << "*** DEBUG scheduling " << Fn.getFunction()->getNameStr() << - ":BB#" << MBB->getNumber() << " ***\n"; + dbgs() << "*** DEBUG scheduling " << Fn.getFunction()->getName() + << ":BB#" << MBB->getNumber() << " ***\n"; } #endif Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Nov 15 10:27:03 2011 @@ -476,8 +476,8 @@ #endif { BlockNumber = FuncInfo->MBB->getNumber(); - BlockName = MF->getFunction()->getNameStr() + ":" + - FuncInfo->MBB->getBasicBlock()->getNameStr(); + BlockName = MF->getFunction()->getName().str() + ":" + + FuncInfo->MBB->getBasicBlock()->getName().str(); } DEBUG(dbgs() << "Initial selection DAG: BB#" << BlockNumber << " '" << BlockName << "'\n"; CurDAG->dump()); Modified: llvm/trunk/lib/CodeGen/ShrinkWrapping.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ShrinkWrapping.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ShrinkWrapping.cpp (original) +++ llvm/trunk/lib/CodeGen/ShrinkWrapping.cpp Tue Nov 15 10:27:03 2011 @@ -158,7 +158,7 @@ // via --shrink-wrap-func=. #ifndef NDEBUG if (ShrinkWrapFunc != "") { - std::string MFName = MF->getFunction()->getNameStr(); + std::string MFName = MF->getFunction()->getName().str(); ShrinkWrapThisFunction = (MFName == ShrinkWrapFunc); } #endif @@ -1045,7 +1045,7 @@ return ""; if (MBB->getBasicBlock()) - return MBB->getBasicBlock()->getNameStr(); + return MBB->getBasicBlock()->getName().str(); std::ostringstream name; name << "_MBB_" << MBB->getNumber(); Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original) +++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Tue Nov 15 10:27:03 2011 @@ -358,9 +358,9 @@ TAA, TAAParsed, StubSize); if (!ErrorCode.empty()) { // If invalid, report the error with report_fatal_error. - report_fatal_error("Global variable '" + GV->getNameStr() + - "' has an invalid section specifier '" + GV->getSection()+ - "': " + ErrorCode + "."); + report_fatal_error("Global variable '" + GV->getName() + + "' has an invalid section specifier '" + + GV->getSection() + "': " + ErrorCode + "."); // Fall back to dropping it into the data section. return DataSection; } @@ -379,9 +379,9 @@ // to reject it here. if (S->getTypeAndAttributes() != TAA || S->getStubSize() != StubSize) { // If invalid, report the error with report_fatal_error. - report_fatal_error("Global variable '" + GV->getNameStr() + - "' section type or attributes does not match previous" - " section specifier"); + report_fatal_error("Global variable '" + GV->getName() + + "' section type or attributes does not match previous" + " section specifier"); } return S; Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Tue Nov 15 10:27:03 2011 @@ -94,15 +94,16 @@ FunctionType *FT = F->getFunctionType(); for (unsigned i = 0, e = FT->getNumContainedTypes(); i != e; ++i) ExtName += getTypeID(FT->getContainedType(i)); - ExtName + "_" + F->getNameStr(); + ExtName += "_" + F->getName().str(); sys::ScopedLock Writer(*FunctionsLock); ExFunc FnPtr = FuncNames[ExtName]; if (FnPtr == 0) - FnPtr = FuncNames["lle_X_" + F->getNameStr()]; + FnPtr = FuncNames["lle_X_" + F->getName().str()]; if (FnPtr == 0) // Try calling a generic function... if it exists... FnPtr = (ExFunc)(intptr_t) - sys::DynamicLibrary::SearchForAddressOfSymbol("lle_X_"+F->getNameStr()); + sys::DynamicLibrary::SearchForAddressOfSymbol("lle_X_" + + F->getName().str()); if (FnPtr != 0) ExportedFunctions->insert(std::make_pair(F, FnPtr)); // Cache for later return FnPtr; Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp Tue Nov 15 10:27:03 2011 @@ -118,7 +118,7 @@ if (JITEmitDebugInfoToDisk) { std::string Filename; raw_string_ostream O2(Filename); - O2 << "/tmp/llvm_function_" << I.FnStart << "_" << F->getNameStr() << ".o"; + O2 << "/tmp/llvm_function_" << I.FnStart << "_" << F->getName() << ".o"; O2.flush(); std::string Errors; raw_fd_ostream O3(Filename.c_str(), Errors); Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue Nov 15 10:27:03 2011 @@ -74,7 +74,7 @@ std::string getDescription() const { return std::string((IsArg ? "Argument #" : "Return value #")) - + utostr(Idx) + " of function " + F->getNameStr(); + + utostr(Idx) + " of function " + F->getName().str(); } }; Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Tue Nov 15 10:27:03 2011 @@ -1902,7 +1902,7 @@ MadeIRChange = false; DEBUG(errs() << "\n\nINSTCOMBINE ITERATION #" << Iteration << " on " - << F.getNameStr() << "\n"); + << F.getName() << "\n"); { // Do a depth-first traversal of the function, populate the worklist with Modified: llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp Tue Nov 15 10:27:03 2011 @@ -69,7 +69,7 @@ BasicBlock* b, unsigned i) { DEBUG(dbgs() << "--Edge Counter for " << (e) << " in " \ - << ((b)?(b)->getNameStr():"0") << " (# " << (i) << ")\n"); + << ((b)?(b)->getName():"0") << " (# " << (i) << ")\n"); } bool OptimalEdgeProfiler::runOnModule(Module &M) { @@ -127,7 +127,7 @@ unsigned i = 0; for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { if (F->isDeclaration()) continue; - DEBUG(dbgs() << "Working on " << F->getNameStr() << "\n"); + DEBUG(dbgs() << "Working on " << F->getName() << "\n"); // Calculate a Maximum Spanning Tree with the edge weights determined by // ProfileEstimator. ProfileEstimator also assign weights to the virtual Modified: llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp Tue Nov 15 10:27:03 2011 @@ -665,7 +665,7 @@ // Generate a .dot graph to represent the DAG and pathNumbers void BLInstrumentationDag::generateDotGraph() { std::string errorInfo; - std::string functionName = getFunction().getNameStr(); + std::string functionName = getFunction().getName().str(); std::string filename = "pathdag." + functionName + ".dot"; DEBUG (dbgs() << "Writing '" << filename << "'...\n"); @@ -750,7 +750,8 @@ // Sets the Value of the pathNumber. Used by the instrumentation code. void BLInstrumentationNode::setStartingPathNumber(Value* pathNumber) { DEBUG(dbgs() << " SPN-" << getName() << " <-- " << (pathNumber ? - pathNumber->getNameStr() : "unused") << "\n"); + pathNumber->getName() : + "unused") << "\n"); _startingPathNumber = pathNumber; } @@ -760,7 +761,7 @@ void BLInstrumentationNode::setEndingPathNumber(Value* pathNumber) { DEBUG(dbgs() << " EPN-" << getName() << " <-- " - << (pathNumber ? pathNumber->getNameStr() : "unused") << "\n"); + << (pathNumber ? pathNumber->getName() : "unused") << "\n"); _endingPathNumber = pathNumber; } @@ -1239,9 +1240,9 @@ insertPoint++; DEBUG(dbgs() << "\nInstrumenting method call block '" - << node->getBlock()->getNameStr() << "'\n"); + << node->getBlock()->getName() << "'\n"); DEBUG(dbgs() << " Path number initialized: " - << ((node->getStartingPathNumber()) ? "yes" : "no") << "\n"); + << ((node->getStartingPathNumber()) ? "yes" : "no") << "\n"); Value* newpn; if( node->getStartingPathNumber() ) { @@ -1370,7 +1371,7 @@ if (F->isDeclaration()) continue; - DEBUG(dbgs() << "Function: " << F->getNameStr() << "\n"); + DEBUG(dbgs() << "Function: " << F->getName() << "\n"); functionNumber++; // set function number Modified: llvm/trunk/lib/VMCore/Value.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Value.cpp (original) +++ llvm/trunk/lib/VMCore/Value.cpp Tue Nov 15 10:27:03 2011 @@ -66,7 +66,7 @@ // a // if (!use_empty()) { - dbgs() << "While deleting: " << *VTy << " %" << getNameStr() << "\n"; + dbgs() << "While deleting: " << *VTy << " %" << getName() << "\n"; for (use_iterator I = use_begin(), E = use_end(); I != E; ++I) dbgs() << "Use still stuck around after Def is destroyed:" << **I << "\n"; @@ -554,7 +554,7 @@ // All callbacks, weak references, and assertingVHs should be dropped by now. if (V->HasValueHandle) { #ifndef NDEBUG // Only in +Asserts mode... - dbgs() << "While deleting: " << *V->getType() << " %" << V->getNameStr() + dbgs() << "While deleting: " << *V->getType() << " %" << V->getName() << "\n"; if (pImpl->ValueHandles[V]->getKind() == Assert) llvm_unreachable("An asserting value handle still pointed to this" @@ -617,8 +617,8 @@ case Tracking: case Weak: dbgs() << "After RAUW from " << *Old->getType() << " %" - << Old->getNameStr() << " to " << *New->getType() << " %" - << New->getNameStr() << "\n"; + << Old->getName() << " to " << *New->getType() << " %" + << New->getName() << "\n"; llvm_unreachable("A tracking or weak value handle still pointed to the" " old value!\n"); default: Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Tue Nov 15 10:27:03 2011 @@ -340,7 +340,7 @@ // If the BB doesn't have a name, give it one so we have something to key // off of. if (!BB->hasName()) BB->setName("tmpbb"); - BlocksToNotExtractFile.os() << BB->getParent()->getNameStr() << " " + BlocksToNotExtractFile.os() << BB->getParent()->getName() << " " << BB->getName() << "\n"; } BlocksToNotExtractFile.os().close(); Modified: llvm/trunk/tools/llvm-prof/llvm-prof.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-prof/llvm-prof.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/tools/llvm-prof/llvm-prof.cpp (original) +++ llvm/trunk/tools/llvm-prof/llvm-prof.cpp Tue Nov 15 10:27:03 2011 @@ -200,9 +200,9 @@ } outs() << format("%3d", i+1) << ". " - << format("%5.2g", FunctionCounts[i].second) << "/" - << format("%g", TotalExecutions) << " " - << FunctionCounts[i].first->getNameStr() << "\n"; + << format("%5.2g", FunctionCounts[i].second) << "/" + << format("%g", TotalExecutions) << " " + << FunctionCounts[i].first->getName() << "\n"; } std::set FunctionsToPrint; @@ -225,12 +225,12 @@ for (unsigned i = 0; i != BlocksToPrint; ++i) { if (Counts[i].second == 0) break; Function *F = Counts[i].first->getParent(); - outs() << format("%3d", i+1) << ". " - << format("%5g", Counts[i].second/(double)TotalExecutions*100) << "% " - << format("%5.0f", Counts[i].second) << "/" - << format("%g", TotalExecutions) << "\t" - << F->getNameStr() << "() - " - << Counts[i].first->getNameStr() << "\n"; + outs() << format("%3d", i+1) << ". " + << format("%5g", Counts[i].second/(double)TotalExecutions*100)<<"% " + << format("%5.0f", Counts[i].second) << "/" + << format("%g", TotalExecutions) << "\t" + << F->getName() << "() - " + << Counts[i].first->getName() << "\n"; FunctionsToPrint.insert(F); } Modified: llvm/trunk/tools/opt/PrintSCC.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/tools/opt/PrintSCC.cpp (original) +++ llvm/trunk/tools/opt/PrintSCC.cpp Tue Nov 15 10:27:03 2011 @@ -101,8 +101,8 @@ errs() << "\nSCC #" << ++sccNum << " : "; for (std::vector::const_iterator I = nextSCC.begin(), E = nextSCC.end(); I != E; ++I) - errs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr() - : std::string("external node")) << ", "; + errs() << ((*I)->getFunction() ? (*I)->getFunction()->getName() + : "external node") << ", "; if (nextSCC.size() == 1 && SCCI.hasLoop()) errs() << " (Has self-loop)."; } Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=144648&r1=144647&r2=144648&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Tue Nov 15 10:27:03 2011 @@ -291,8 +291,8 @@ virtual bool runOnRegion(Region *R, RGPassManager &RGM) { if (!Quiet) { Out << "Printing analysis '" << PassToPrint->getPassName() << "' for " - << "region: '" << R->getNameStr() << "' in function '" - << R->getEntry()->getParent()->getNameStr() << "':\n"; + << "region: '" << R->getNameStr() << "' in function '" + << R->getEntry()->getParent()->getName() << "':\n"; } // Get and print pass... getAnalysisID(PassToPrint->getTypeInfo()).print(Out, From grosbach at apple.com Tue Nov 15 10:46:22 2011 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 15 Nov 2011 16:46:22 -0000 Subject: [llvm-commits] [llvm] r144649 - in /llvm/trunk/lib/MC: ELFObjectWriter.cpp ELFObjectWriter.h MCELFStreamer.cpp MCModule.cpp MCObjectFileInfo.cpp Message-ID: <20111115164622.8599F2A6C131@llvm.org> Author: grosbach Date: Tue Nov 15 10:46:22 2011 New Revision: 144649 URL: http://llvm.org/viewvc/llvm-project?rev=144649&view=rev Log: Tidy up. 80 columns. Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp llvm/trunk/lib/MC/ELFObjectWriter.h llvm/trunk/lib/MC/MCELFStreamer.cpp llvm/trunk/lib/MC/MCModule.cpp llvm/trunk/lib/MC/MCObjectFileInfo.cpp Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=144649&r1=144648&r2=144649&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Nov 15 10:46:22 2011 @@ -1579,8 +1579,8 @@ return Type; } -void -PPCELFObjectWriter::adjustFixupOffset(const MCFixup &Fixup, uint64_t &RelocOffset) { +void PPCELFObjectWriter:: +adjustFixupOffset(const MCFixup &Fixup, uint64_t &RelocOffset) { switch ((unsigned)Fixup.getKind()) { case PPC::fixup_ppc_ha16: case PPC::fixup_ppc_lo16: Modified: llvm/trunk/lib/MC/ELFObjectWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.h?rev=144649&r1=144648&r2=144649&view=diff ============================================================================== --- llvm/trunk/lib/MC/ELFObjectWriter.h (original) +++ llvm/trunk/lib/MC/ELFObjectWriter.h Tue Nov 15 10:46:22 2011 @@ -240,33 +240,38 @@ F.getContents() += StringRef(buf, 8); } - virtual void WriteHeader(uint64_t SectionDataSize, unsigned NumberOfSections); + virtual void WriteHeader(uint64_t SectionDataSize, + unsigned NumberOfSections); /// Default e_flags = 0 virtual void WriteEFlags() { Write32(0); } - virtual void WriteSymbolEntry(MCDataFragment *SymtabF, MCDataFragment *ShndxF, - uint64_t name, uint8_t info, - uint64_t value, uint64_t size, - uint8_t other, uint32_t shndx, - bool Reserved); + virtual void WriteSymbolEntry(MCDataFragment *SymtabF, + MCDataFragment *ShndxF, + uint64_t name, uint8_t info, + uint64_t value, uint64_t size, + uint8_t other, uint32_t shndx, + bool Reserved); virtual void WriteSymbol(MCDataFragment *SymtabF, MCDataFragment *ShndxF, ELFSymbolData &MSD, const MCAsmLayout &Layout); typedef DenseMap SectionIndexMapTy; - virtual void WriteSymbolTable(MCDataFragment *SymtabF, MCDataFragment *ShndxF, - const MCAssembler &Asm, - const MCAsmLayout &Layout, - const SectionIndexMapTy &SectionIndexMap); - - virtual void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout, - const MCFragment *Fragment, const MCFixup &Fixup, + virtual void WriteSymbolTable(MCDataFragment *SymtabF, + MCDataFragment *ShndxF, + const MCAssembler &Asm, + const MCAsmLayout &Layout, + const SectionIndexMapTy &SectionIndexMap); + + virtual void RecordRelocation(const MCAssembler &Asm, + const MCAsmLayout &Layout, + const MCFragment *Fragment, + const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue); virtual uint64_t getSymbolIndexInSymbolTable(const MCAssembler &Asm, - const MCSymbol *S); + const MCSymbol *S); // Map from a group section to the signature symbol typedef DenseMap GroupMapTy; @@ -347,7 +352,8 @@ virtual unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup, bool IsPCRel, bool IsRelocWithSymbol, int64_t Addend) = 0; - virtual void adjustFixupOffset(const MCFixup &Fixup, uint64_t &RelocOffset) { } + virtual void adjustFixupOffset(const MCFixup &Fixup, + uint64_t &RelocOffset) {} }; //===- X86ELFObjectWriter -------------------------------------------===// Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=144649&r1=144648&r2=144649&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCELFStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCELFStreamer.cpp Tue Nov 15 10:46:22 2011 @@ -205,10 +205,10 @@ if (MCELF::GetBinding(SD) == ELF_STB_Local) { const MCSection *Section = getAssembler().getContext().getELFSection(".bss", - ELF::SHT_NOBITS, - ELF::SHF_WRITE | - ELF::SHF_ALLOC, - SectionKind::getBSS()); + ELF::SHT_NOBITS, + ELF::SHF_WRITE | + ELF::SHF_ALLOC, + SectionKind::getBSS()); Symbol->setSection(*Section); struct LocalCommon L = {&SD, Size, ByteAlignment}; Modified: llvm/trunk/lib/MC/MCModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCModule.cpp?rev=144649&r1=144648&r2=144649&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCModule.cpp (original) +++ llvm/trunk/lib/MC/MCModule.cpp Tue Nov 15 10:46:22 2011 @@ -1,4 +1,4 @@ -//===- lib/MC/MCModule.cpp - MCModule implementation --------------------------===// +//===- lib/MC/MCModule.cpp - MCModule implementation ----------------------===// // // The LLVM Compiler Infrastructure // Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=144649&r1=144648&r2=144649&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original) +++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Tue Nov 15 10:46:22 2011 @@ -56,8 +56,8 @@ TLSThreadInitSection = Ctx->getMachOSection("__DATA", "__thread_init", - MCSectionMachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS, - SectionKind::getDataRel()); + MCSectionMachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS, + SectionKind::getDataRel()); CStringSection // .cstring = Ctx->getMachOSection("__TEXT", "__cstring", @@ -221,8 +221,8 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) { if (T.getArch() == Triple::x86) { PersonalityEncoding = (RelocM == Reloc::PIC_) - ? dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 - : dwarf::DW_EH_PE_absptr; + ? dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 + : dwarf::DW_EH_PE_absptr; LSDAEncoding = (RelocM == Reloc::PIC_) ? dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_absptr; @@ -230,8 +230,8 @@ ? dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_absptr; TTypeEncoding = (RelocM == Reloc::PIC_) - ? dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 - : dwarf::DW_EH_PE_absptr; + ? dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 + : dwarf::DW_EH_PE_absptr; } else if (T.getArch() == Triple::x86_64) { FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; From clattner at apple.com Tue Nov 15 11:43:33 2011 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Nov 2011 09:43:33 -0800 Subject: [llvm-commits] [PATCH] PR889: devirtualize Value::printCustom In-Reply-To: References: <28388F1A-D44C-4218-A157-A177E2D114FB@apple.com> Message-ID: <85F11A88-37FF-45DE-97D0-CB44D23B8EE6@apple.com> On Nov 15, 2011, at 12:29 AM, Jay Foad wrote: > On 14 November 2011 18:38, Chris Lattner wrote: >> The "right" way to fix this is to eliminate PseudoSourceValue, which has always been a disgusting hack. Places in codegen that can uses PseudoSourceValue (e.g. the SDLoadNode and memoperands) > > LoadSDNode has-a MachineMemOperand, which has-a MachinePointerInfo, > which is the (only?) thing that can refer to PseudoSourceValues. Aha, so we're already making progress there :). >> should use a discriminated union of "Value* and SomeMachineLocationType". > > I assume you're not talking about (MC's) MachineLocation here, but > about some new machine location type yet to be invented. Right. Now that you've forced me to actually look at the code ;-) I see that we're well placed for this. Basically MachinePointerInfo becomes a PointerUnion where the SomethingElse pointers are pointers to singletons that represent the stack and other things that PseudoSourceValue references. My recollection is that the Value* is used for alias queries and for printing stuff out with verbose asm. MachinePointerInfo should just get helper methods that check for the special cases, then bounce on to the standard AliasAnalysis interface if it has a real Value*. -Chris From clattner at apple.com Tue Nov 15 11:45:48 2011 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Nov 2011 09:45:48 -0800 Subject: [llvm-commits] pr11367 In-Reply-To: <1CF650DE-6A87-445E-8F76-A3034E121D98@gmail.com> References: <1CF650DE-6A87-445E-8F76-A3034E121D98@gmail.com> Message-ID: <34B7AD23-CF92-4485-B2BB-ED55C9C5F628@apple.com> On Nov 14, 2011, at 11:24 AM, Matt Pharr wrote: > It's not a completely theoretical use case: the ispc compiler depended on the old behavior from LinkModules() ("link everything in the provided modules together, and don't be clever about skipping stuff that seems to not be used"), and the lazy linking change broke that. Why? Can you explain the use case? -Chris From grosbach at apple.com Tue Nov 15 11:49:59 2011 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 15 Nov 2011 17:49:59 -0000 Subject: [llvm-commits] [llvm] r144650 - /llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Message-ID: <20111115175000.0EBE12A6C131@llvm.org> Author: grosbach Date: Tue Nov 15 11:49:59 2011 New Revision: 144650 URL: http://llvm.org/viewvc/llvm-project?rev=144650&view=rev Log: ARM parsing datatype suffix variants for register-writeback VLD1/VST1 instructions. rdar://10435076 Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=144650&r1=144649&r2=144650&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Tue Nov 15 11:49:59 2011 @@ -5232,6 +5232,19 @@ (VLD1d32wb_fixed VecListOneD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn!", (VLD1d64wb_fixed VecListOneD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +// with writeback, register stride +defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d8wb_register VecListOneD:$Vd, zero_reg, addrmode6:$Rn, + rGPR:$Rm, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d16wb_register VecListOneD:$Vd, zero_reg, addrmode6:$Rn, + rGPR:$Rm, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d32wb_register VecListOneD:$Vd, zero_reg, addrmode6:$Rn, + rGPR:$Rm, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d64wb_register VecListOneD:$Vd, zero_reg, addrmode6:$Rn, + rGPR:$Rm, pred:$p)>; // Load two D registers. defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn", @@ -5251,6 +5264,19 @@ (VLD1q32wb_fixed VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn!", (VLD1q64wb_fixed VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +// with writeback, register stride +defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1q8wb_register VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, + rGPR:$Rm, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1q16wb_register VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, + rGPR:$Rm, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1q32wb_register VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, + rGPR:$Rm, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1q64wb_register VecListTwoD:$Vd, zero_reg, addrmode6:$Rn, + rGPR:$Rm, pred:$p)>; // Load three D registers. defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn", @@ -5274,6 +5300,19 @@ defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn!", (VLD1d64Twb_fixed VecListThreeD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +// with writeback, register stride +defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d8Twb_register VecListThreeD:$Vd, zero_reg, + addrmode6:$Rn, rGPR:$Rm, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d16Twb_register VecListThreeD:$Vd, zero_reg, + addrmode6:$Rn, rGPR:$Rm, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d32Twb_register VecListThreeD:$Vd, zero_reg, + addrmode6:$Rn, rGPR:$Rm, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d64Twb_register VecListThreeD:$Vd, zero_reg, + addrmode6:$Rn, rGPR:$Rm, pred:$p)>; // Load four D registers. @@ -5298,6 +5337,19 @@ defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn!", (VLD1d64Qwb_fixed VecListFourD:$Vd, zero_reg, addrmode6:$Rn, pred:$p)>; +// with writeback, register stride +defm : VFPDT8ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d8Qwb_register VecListFourD:$Vd, zero_reg, + addrmode6:$Rn, rGPR:$Rm, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d16Qwb_register VecListFourD:$Vd, zero_reg, + addrmode6:$Rn, rGPR:$Rm, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d32Qwb_register VecListFourD:$Vd, zero_reg, + addrmode6:$Rn, rGPR:$Rm, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vld1${p}", "$Vd, $Rn, $Rm", + (VLD1d64Qwb_register VecListFourD:$Vd, zero_reg, + addrmode6:$Rn, rGPR:$Rm, pred:$p)>; // VST1 requires a size suffix, but also accepts type specific variants. // Store one D register. @@ -5318,6 +5370,19 @@ (VST1d32wb_fixed zero_reg, addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; defm : VFPDT64ReqInstAlias<"vst1${p}", "$Vd, $Rn!", (VST1d64wb_fixed zero_reg, addrmode6:$Rn, VecListOneD:$Vd, pred:$p)>; +// with writeback, register stride +defm : VFPDT8ReqInstAlias<"vst1${p}", "$Vd, $Rn, $Rm", + (VST1d8wb_register zero_reg, addrmode6:$Rn, rGPR:$Rm, + VecListOneD:$Vd, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vst1${p}", "$Vd, $Rn, $Rm", + (VST1d16wb_register zero_reg, addrmode6:$Rn, rGPR:$Rm, + VecListOneD:$Vd, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vst1${p}", "$Vd, $Rn, $Rm", + (VST1d32wb_register zero_reg, addrmode6:$Rn, rGPR:$Rm, + VecListOneD:$Vd, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vst1${p}", "$Vd, $Rn, $Rm", + (VST1d64wb_register zero_reg, addrmode6:$Rn, rGPR:$Rm, + VecListOneD:$Vd, pred:$p)>; // Store two D registers. defm : VFPDT8ReqInstAlias<"vst1${p}", "$Vd, $Rn", @@ -5337,6 +5402,19 @@ (VST1q32wb_fixed zero_reg, addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; defm : VFPDT64ReqInstAlias<"vst1${p}", "$Vd, $Rn!", (VST1q64wb_fixed zero_reg, addrmode6:$Rn, VecListTwoD:$Vd, pred:$p)>; +// with writeback, register stride +defm : VFPDT8ReqInstAlias<"vst1${p}", "$Vd, $Rn, $Rm", + (VST1q8wb_register zero_reg, addrmode6:$Rn, + rGPR:$Rm, VecListTwoD:$Vd, pred:$p)>; +defm : VFPDT16ReqInstAlias<"vst1${p}", "$Vd, $Rn, $Rm", + (VST1q16wb_register zero_reg, addrmode6:$Rn, + rGPR:$Rm, VecListTwoD:$Vd, pred:$p)>; +defm : VFPDT32ReqInstAlias<"vst1${p}", "$Vd, $Rn, $Rm", + (VST1q32wb_register zero_reg, addrmode6:$Rn, + rGPR:$Rm, VecListTwoD:$Vd, pred:$p)>; +defm : VFPDT64ReqInstAlias<"vst1${p}", "$Vd, $Rn, $Rm", + (VST1q64wb_register zero_reg, addrmode6:$Rn, + rGPR:$Rm, VecListTwoD:$Vd, pred:$p)>; // FIXME: The three and four register VST1 instructions haven't been moved // to the VecList* encoding yet, so we can't do assembly parsing support From clattner at apple.com Tue Nov 15 11:53:39 2011 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Nov 2011 09:53:39 -0800 Subject: [llvm-commits] [llvm] r144600 - /llvm/trunk/docs/index.html In-Reply-To: <20111115011437.85FCD2A6C131@llvm.org> References: <20111115011437.85FCD2A6C131@llvm.org> Message-ID: <17583FD5-F653-485D-9255-19A42D71BFFB@apple.com> On Nov 14, 2011, at 5:14 PM, Devang Patel wrote: > Author: dpatel > Date: Mon Nov 14 19:14:37 2011 > New Revision: 144600 > > URL: http://llvm.org/viewvc/llvm-project?rev=144600&view=rev > Log: > Add ObjCPropertyDebugInfo.html Hi Devang, Can this be merged into some other document, like the SourceLevelDebugging doc? -Chris > > Modified: > llvm/trunk/docs/index.html > > Modified: llvm/trunk/docs/index.html > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/index.html?rev=144600&r1=144599&r2=144600&view=diff > ============================================================================== > --- llvm/trunk/docs/index.html (original) > +++ llvm/trunk/docs/index.html Mon Nov 14 19:14:37 2011 > @@ -212,6 +212,9 @@ >
  • Branch Weight Metadata - Provides > information about Branch Prediction Information.
  • > > +
  • Objective C Property Debug Info > +- Debugging information extension for Objective C Property.
  • > + > > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Tue Nov 15 12:06:28 2011 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Nov 2011 10:06:28 -0800 Subject: [llvm-commits] [llvm] r144600 - /llvm/trunk/docs/index.html In-Reply-To: <17583FD5-F653-485D-9255-19A42D71BFFB@apple.com> References: <20111115011437.85FCD2A6C131@llvm.org> <17583FD5-F653-485D-9255-19A42D71BFFB@apple.com> Message-ID: <04027E85-8C4F-4DCD-AAF7-68CE8C9C036F@apple.com> Hi Chris, On Nov 15, 2011, at 9:53 AM, Chris Lattner wrote: > On Nov 14, 2011, at 5:14 PM, Devang Patel wrote: > >> Author: dpatel >> Date: Mon Nov 14 19:14:37 2011 >> New Revision: 144600 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=144600&view=rev >> Log: >> Add ObjCPropertyDebugInfo.html > > Hi Devang, > > Can this be merged into some other document, like the SourceLevelDebugging doc? > SourceLevelDebugging is meant for clang+llvm developers. Where as lldb developers are also targeted by this doc and I also expect to see a doc on recent accelerator tables work where audience is llvm+lldb developers. If you still think SourceLevelDebugging is appropriate then I'll merge them. - Devang > -Chris > >> >> Modified: >> llvm/trunk/docs/index.html >> >> Modified: llvm/trunk/docs/index.html >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/index.html?rev=144600&r1=144599&r2=144600&view=diff >> ============================================================================== >> --- llvm/trunk/docs/index.html (original) >> +++ llvm/trunk/docs/index.html Mon Nov 14 19:14:37 2011 >> @@ -212,6 +212,9 @@ >>
  • Branch Weight Metadata - Provides >> information about Branch Prediction Information.
  • >> >> +
  • Objective C Property Debug Info >> +- Debugging information extension for Objective C Property.
  • >> + >> >> >> >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From benny.kra at googlemail.com Tue Nov 15 12:13:17 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 15 Nov 2011 18:13:17 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r144652 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp Message-ID: <20111115181317.C504B2A6C131@llvm.org> Author: d0k Date: Tue Nov 15 12:13:17 2011 New Revision: 144652 URL: http://llvm.org/viewvc/llvm-project?rev=144652&view=rev Log: Remove uses of Value::getNameStr from llvm-gcc. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=144652&r1=144651&r2=144652&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Nov 15 12:13:17 2011 @@ -1649,13 +1649,9 @@ } if (TheDebugInfo) { - std::string Name = GV->getNameStr(); - const char LPrefix[] = "\01L_OBJC_"; - const char lPrefix[] = "\01l_OBJC_"; - if (flag_objc_abi == -1 || flag_objc_abi == 0 || - (strncmp(Name.c_str(), LPrefix, sizeof(LPrefix) - 1) != 0 && - strncmp(Name.c_str(), lPrefix, sizeof(lPrefix) - 1) != 0)) + (!GV->getName().startswith("\01L_OBJC_") && + !GV->getName().startswith("\01l_OBJC_"))) TheDebugInfo->EmitGlobalVariable(GV, decl); } Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=144652&r1=144651&r2=144652&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Nov 15 12:13:17 2011 @@ -3615,7 +3615,7 @@ Value *TreeToLLVM::EmitABS_EXPR(tree exp) { Value *Op = Emit(TREE_OPERAND(exp, 0), 0); if (!Op->getType()->isFloatingPointTy()) { - Value *OpN = Builder.CreateNeg(Op, (Op->getNameStr()+"neg").c_str()); + Value *OpN = Builder.CreateNeg(Op, Op->getName() + "neg"); ICmpInst::Predicate pred = TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))) ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_SGE; Value *Cmp = Builder.CreateICmp(pred, Op, @@ -3689,8 +3689,7 @@ cast(Ty)->getElementType()->isFloatingPointTy())) { Op = BitCastToType(Op, getSuitableBitCastIntType(Ty)); } - return BitCastToType(Builder.CreateNot(Op, - (Op->getNameStr()+"not").c_str()),Ty); + return BitCastToType(Builder.CreateNot(Op, Op->getName() + "not", Ty); } Value *TreeToLLVM::EmitTRUTH_NOT_EXPR(tree exp) { @@ -3698,7 +3697,7 @@ if (V->getType() != Type::getInt1Ty(Context)) V = Builder.CreateICmpNE(V, Constant::getNullValue(V->getType()), "toBool"); - V = Builder.CreateNot(V, (V->getNameStr()+"not").c_str()); + V = Builder.CreateNot(V, V->getName() + "not"); return CastToUIntType(V, ConvertType(TREE_TYPE(exp))); } @@ -3914,7 +3913,7 @@ Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); if (RHS->getType() != LHS->getType()) RHS = Builder.CreateIntCast(RHS, LHS->getType(), false, - (RHS->getNameStr()+".cast").c_str()); + RHS->getName() + ".cast"); return Builder.CreateBinOp((Instruction::BinaryOps)Opc, LHS, RHS); } @@ -3927,13 +3926,12 @@ Type *Ty = IntegerType::get(Context, TYPE_PRECISION(TREE_TYPE (TREE_OPERAND (exp, 0)))); - In = Builder.CreatePtrToInt(In, Ty, - (In->getNameStr()+".cast").c_str()); + In = Builder.CreatePtrToInt(In, Ty, In->getName() + ".cast"); } if (Amt->getType() != In->getType()) Amt = Builder.CreateIntCast(Amt, In->getType(), false, - (Amt->getNameStr()+".cast").c_str()); + Amt->getName() + ".cast"); Value *TypeSize = ConstantInt::get(In->getType(), @@ -4175,11 +4173,11 @@ // Calculate |LHS| ... Value *MinusLHS = Builder.CreateNeg(LHS); Value *AbsLHS = Builder.CreateSelect(LHSIsPositive, LHS, MinusLHS, - (LHS->getNameStr()+".abs").c_str()); + LHS->getName() + ".abs"); // ... and |RHS| Value *MinusRHS = Builder.CreateNeg(RHS); Value *AbsRHS = Builder.CreateSelect(RHSIsPositive, RHS, MinusRHS, - (RHS->getNameStr()+".abs").c_str()); + RHS->getName() + ".abs"); // Calculate AbsRDiv = (|LHS| + (|RHS| UDiv 2)) UDiv |RHS|. Value *HalfAbsRHS = Builder.CreateUDiv(AbsRHS, Two); From benny.kra at googlemail.com Tue Nov 15 12:13:19 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 15 Nov 2011 18:13:19 -0000 Subject: [llvm-commits] [dragonegg] r144653 - in /dragonegg/trunk: include/dragonegg/Debug.h src/Convert.cpp src/Debug.cpp Message-ID: <20111115181319.C61D32A6C131@llvm.org> Author: d0k Date: Tue Nov 15 12:13:19 2011 New Revision: 144653 URL: http://llvm.org/viewvc/llvm-project?rev=144653&view=rev Log: Remove uses of Value::getNameStr from DragonEgg. Modified: dragonegg/trunk/include/dragonegg/Debug.h dragonegg/trunk/src/Convert.cpp dragonegg/trunk/src/Debug.cpp Modified: dragonegg/trunk/include/dragonegg/Debug.h URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/Debug.h?rev=144653&r1=144652&r2=144653&view=diff ============================================================================== --- dragonegg/trunk/include/dragonegg/Debug.h (original) +++ dragonegg/trunk/include/dragonegg/Debug.h Tue Nov 15 12:13:19 2011 @@ -307,7 +307,7 @@ /// EmitDeclare - Constructs the debug code for allocation of a new variable. /// region - "llvm.dbg.declare." - void EmitDeclare(tree_node *decl, unsigned Tag, const char *Name, + void EmitDeclare(tree_node *decl, unsigned Tag, StringRef Name, tree_node *type, Value *AI, LLVMBuilder &Builder); /// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of Modified: dragonegg/trunk/src/Convert.cpp URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=144653&r1=144652&r2=144653&view=diff ============================================================================== --- dragonegg/trunk/src/Convert.cpp (original) +++ dragonegg/trunk/src/Convert.cpp Tue Nov 15 12:13:19 2011 @@ -1862,12 +1862,10 @@ if (EmitDebugInfo()) { if (DECL_NAME(decl)) { TheDebugInfo->EmitDeclare(decl, dwarf::DW_TAG_auto_variable, - AI->getNameStr().c_str(), TREE_TYPE(decl), AI, - Builder); + AI->getName(), TREE_TYPE(decl), AI, Builder); } else if (TREE_CODE(decl) == RESULT_DECL) { TheDebugInfo->EmitDeclare(decl, dwarf::DW_TAG_return_variable, - AI->getNameStr().c_str(), TREE_TYPE(decl), AI, - Builder); + AI->getName(), TREE_TYPE(decl), AI, Builder); } } } Modified: dragonegg/trunk/src/Debug.cpp URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Debug.cpp?rev=144653&r1=144652&r2=144653&view=diff ============================================================================== --- dragonegg/trunk/src/Debug.cpp (original) +++ dragonegg/trunk/src/Debug.cpp Tue Nov 15 12:13:19 2011 @@ -372,7 +372,7 @@ } /// EmitDeclare - Constructs the debug code for allocation of a new variable. -void DebugInfo::EmitDeclare(tree decl, unsigned Tag, const char *Name, +void DebugInfo::EmitDeclare(tree decl, unsigned Tag, StringRef Name, tree type, Value *AI, LLVMBuilder &Builder) { // Ignore compiler generated temporaries. From ahatanaka at mips.com Tue Nov 15 12:20:08 2011 From: ahatanaka at mips.com (Akira Hatanaka) Date: Tue, 15 Nov 2011 18:20:08 -0000 Subject: [llvm-commits] [llvm] r144654 - in /llvm/trunk/lib/Target/Mips: CMakeLists.txt MipsAsmPrinter.cpp Message-ID: <20111115182008.AFE902A6C131@llvm.org> Author: ahatanak Date: Tue Nov 15 12:20:08 2011 New Revision: 144654 URL: http://llvm.org/viewvc/llvm-project?rev=144654&view=rev Log: Remove MipsMCSymbolRefExpr. Modified: llvm/trunk/lib/Target/Mips/CMakeLists.txt llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Modified: llvm/trunk/lib/Target/Mips/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/CMakeLists.txt?rev=144654&r1=144653&r2=144654&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/CMakeLists.txt (original) +++ llvm/trunk/lib/Target/Mips/CMakeLists.txt Tue Nov 15 12:20:08 2011 @@ -22,7 +22,6 @@ MipsISelLowering.cpp MipsFrameLowering.cpp MipsMCInstLower.cpp - MipsMCSymbolRefExpr.cpp MipsRegisterInfo.cpp MipsSubtarget.cpp MipsTargetMachine.cpp Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=144654&r1=144653&r2=144654&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Tue Nov 15 12:20:08 2011 @@ -18,7 +18,6 @@ #include "MipsInstrInfo.h" #include "MipsMachineFunction.h" #include "MipsMCInstLower.h" -#include "MipsMCSymbolRefExpr.h" #include "InstPrinter/MipsInstPrinter.h" #include "MCTargetDesc/MipsBaseInfo.h" #include "llvm/ADT/SmallString.h" From ahatanaka at mips.com Tue Nov 15 12:22:49 2011 From: ahatanaka at mips.com (Akira Hatanaka) Date: Tue, 15 Nov 2011 18:22:49 -0000 Subject: [llvm-commits] [llvm] r144655 - in /llvm/trunk/lib/Target/Mips: MipsMCSymbolRefExpr.cpp MipsMCSymbolRefExpr.h Message-ID: <20111115182249.327DE2A6C131@llvm.org> Author: ahatanak Date: Tue Nov 15 12:22:48 2011 New Revision: 144655 URL: http://llvm.org/viewvc/llvm-project?rev=144655&view=rev Log: Delete files. Removed: llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.cpp llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.h Removed: llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.cpp?rev=144654&view=auto ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.cpp (removed) @@ -1,70 +0,0 @@ -//===-- MipsMCSymbolRefExpr.cpp - Mips specific MC expression classes -----===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "mipsmcsymbolrefexpr" -#include "MipsMCSymbolRefExpr.h" -#include "llvm/MC/MCAssembler.h" -#include "llvm/MC/MCContext.h" -#include "llvm/MC/MCSymbol.h" -using namespace llvm; - -const MipsMCSymbolRefExpr* -MipsMCSymbolRefExpr::Create(VariantKind Kind, const MCSymbol *Symbol, - int Offset, MCContext &Ctx) { - return new (Ctx) MipsMCSymbolRefExpr(Kind, Symbol, Offset); -} - -void MipsMCSymbolRefExpr::PrintImpl(raw_ostream &OS) const { - switch (Kind) { - default: assert(0 && "Invalid kind!"); - case VK_Mips_None: break; - case VK_Mips_GPREL: OS << "%gp_rel("; break; - case VK_Mips_GOT_CALL: OS << "%call16("; break; - case VK_Mips_GOT: OS << "%got("; break; - case VK_Mips_ABS_HI: OS << "%hi("; break; - case VK_Mips_ABS_LO: OS << "%lo("; break; - case VK_Mips_TLSGD: OS << "%tlsgd("; break; - case VK_Mips_GOTTPREL: OS << "%gottprel("; break; - case VK_Mips_TPREL_HI: OS << "%tprel_hi("; break; - case VK_Mips_TPREL_LO: OS << "%tprel_lo("; break; - case VK_Mips_GPOFF_HI: OS << "%hi(%neg(%gp_rel("; break; - case VK_Mips_GPOFF_LO: OS << "%lo(%neg(%gp_rel("; break; - case VK_Mips_GOT_DISP: OS << "%got_disp("; break; - case VK_Mips_GOT_PAGE: OS << "%got_page("; break; - case VK_Mips_GOT_OFST: OS << "%got_ofst("; break; - } - - OS << *Symbol; - - if (Offset) { - if (Offset > 0) - OS << '+'; - OS << Offset; - } - - if (Kind == VK_Mips_GPOFF_HI || Kind == VK_Mips_GPOFF_LO) - OS << ")))"; - else if (Kind != VK_Mips_None) - OS << ')'; -} - -bool -MipsMCSymbolRefExpr::EvaluateAsRelocatableImpl(MCValue &Res, - const MCAsmLayout *Layout) const { - return false; -} - -void MipsMCSymbolRefExpr::AddValueSymbols(MCAssembler *Asm) const { - Asm->getOrCreateSymbolData(*Symbol); -} - -const MCSection *MipsMCSymbolRefExpr::FindAssociatedSection() const { - return Symbol->isDefined() ? &Symbol->getSection() : NULL; -} - Removed: llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.h?rev=144654&view=auto ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.h (original) +++ llvm/trunk/lib/Target/Mips/MipsMCSymbolRefExpr.h (removed) @@ -1,67 +0,0 @@ -//===-- MipsMCSymbolRefExpr.h - Mips specific MCSymbolRefExpr class -------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef MIPSMCSYMBOLREFEXPR_H -#define MIPSMCSYMBOLREFEXPR_H -#include "llvm/MC/MCExpr.h" - -namespace llvm { - -class MipsMCSymbolRefExpr : public MCTargetExpr { -public: - enum VariantKind { - VK_Mips_None, - VK_Mips_GPREL, - VK_Mips_GOT_CALL, - VK_Mips_GOT, - VK_Mips_ABS_HI, - VK_Mips_ABS_LO, - VK_Mips_TLSGD, - VK_Mips_GOTTPREL, - VK_Mips_TPREL_HI, - VK_Mips_TPREL_LO, - VK_Mips_GPOFF_HI, - VK_Mips_GPOFF_LO, - VK_Mips_GOT_DISP, - VK_Mips_GOT_PAGE, - VK_Mips_GOT_OFST - }; - -private: - const VariantKind Kind; - const MCSymbol *Symbol; - int Offset; - - explicit MipsMCSymbolRefExpr(VariantKind _Kind, const MCSymbol *_Symbol, - int _Offset) - : Kind(_Kind), Symbol(_Symbol), Offset(_Offset) {} - -public: - static const MipsMCSymbolRefExpr *Create(VariantKind Kind, - const MCSymbol *Symbol, int Offset, - MCContext &Ctx); - - void PrintImpl(raw_ostream &OS) const; - bool EvaluateAsRelocatableImpl(MCValue &Res, - const MCAsmLayout *Layout) const; - void AddValueSymbols(MCAssembler *) const; - const MCSection *FindAssociatedSection() const; - - static bool classof(const MCExpr *E) { - return E->getKind() == MCExpr::Target; - } - - static bool classof(const MipsMCSymbolRefExpr *) { return true; } - - int getOffset() const { return Offset; } - void setOffset(int O) { Offset = O; } -}; -} // end namespace llvm - -#endif From benny.kra at googlemail.com Tue Nov 15 12:30:06 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 15 Nov 2011 18:30:06 -0000 Subject: [llvm-commits] [llvm] r144656 - in /llvm/trunk: include/llvm/Analysis/RegionInfo.h lib/Analysis/RegionInfo.cpp Message-ID: <20111115183006.976C42A6C131@llvm.org> Author: d0k Date: Tue Nov 15 12:30:06 2011 New Revision: 144656 URL: http://llvm.org/viewvc/llvm-project?rev=144656&view=rev Log: Missed some users of Value::getNameStr. Modified: llvm/trunk/include/llvm/Analysis/RegionInfo.h llvm/trunk/lib/Analysis/RegionInfo.cpp Modified: llvm/trunk/include/llvm/Analysis/RegionInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/RegionInfo.h?rev=144656&r1=144655&r2=144656&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/RegionInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/RegionInfo.h Tue Nov 15 12:30:06 2011 @@ -681,7 +681,7 @@ if (Node.isSubRegion()) return OS << Node.getNodeAs()->getNameStr(); else - return OS << Node.getNodeAs()->getNameStr(); + return OS << Node.getNodeAs()->getName(); } } // End llvm namespace #endif Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=144656&r1=144655&r2=144656&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionInfo.cpp (original) +++ llvm/trunk/lib/Analysis/RegionInfo.cpp Tue Nov 15 12:30:06 2011 @@ -186,18 +186,16 @@ raw_string_ostream OS(entryName); WriteAsOperand(OS, getEntry(), false); - entryName = OS.str(); } else - entryName = getEntry()->getNameStr(); + entryName = getEntry()->getName(); if (getExit()) { if (getExit()->getName().empty()) { raw_string_ostream OS(exitName); WriteAsOperand(OS, getExit(), false); - exitName = OS.str(); } else - exitName = getExit()->getNameStr(); + exitName = getExit()->getName(); } else exitName = ""; From benny.kra at googlemail.com Tue Nov 15 12:30:13 2011 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Tue, 15 Nov 2011 18:30:13 -0000 Subject: [llvm-commits] [llvm] r144657 - in /llvm/trunk: include/llvm/Value.h lib/VMCore/Value.cpp Message-ID: <20111115183013.1709E2A6C131@llvm.org> Author: d0k Date: Tue Nov 15 12:30:12 2011 New Revision: 144657 URL: http://llvm.org/viewvc/llvm-project?rev=144657&view=rev Log: Remove Value::getNameStr. It has been deprecated for a while and provides no additional value over getName(). Modified: llvm/trunk/include/llvm/Value.h llvm/trunk/lib/VMCore/Value.cpp Modified: llvm/trunk/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=144657&r1=144656&r2=144657&view=diff ============================================================================== --- llvm/trunk/include/llvm/Value.h (original) +++ llvm/trunk/include/llvm/Value.h Tue Nov 15 12:30:12 2011 @@ -117,19 +117,8 @@ /// getName() - Return a constant reference to the value's name. This is cheap /// and guaranteed to return the same reference as long as the value is not /// modified. - /// - /// This is currently guaranteed to return a StringRef for which data() points - /// to a valid null terminated string. The use of StringRef.data() is - /// deprecated here, however, and clients should not rely on it. If such - /// behavior is needed, clients should use expensive getNameStr(), or switch - /// to an interface that does not depend on null termination. StringRef getName() const; - /// getNameStr() - Return the name of the specified value, *constructing a - /// string* to hold it. This is guaranteed to construct a string and is very - /// expensive, clients should use getName() unless necessary. - std::string getNameStr() const; - /// setName() - Change the name of the value, choosing a new unique name if /// the provided name is taken. /// Modified: llvm/trunk/lib/VMCore/Value.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=144657&r1=144656&r2=144657&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Value.cpp (original) +++ llvm/trunk/lib/VMCore/Value.cpp Tue Nov 15 12:30:12 2011 @@ -156,10 +156,6 @@ return Name->getKey(); } -std::string Value::getNameStr() const { - return getName().str(); -} - void Value::setName(const Twine &NewName) { // Fast path for common IRBuilder case of setName("") when there is no name. if (NewName.isTriviallyEmpty() && !hasName()) From daniel at zuster.org Tue Nov 15 12:34:17 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Nov 2011 18:34:17 -0000 Subject: [llvm-commits] [compiler-rt] r144658 - in /compiler-rt/trunk/make/platform: clang_darwin.mk darwin_fat.mk multi_arch.mk Message-ID: <20111115183417.A61BF2A6C131@llvm.org> Author: ddunbar Date: Tue Nov 15 12:34:17 2011 New Revision: 144658 URL: http://llvm.org/viewvc/llvm-project?rev=144658&view=rev Log: build: Change default CC to be clang instead of gcc. Modified: compiler-rt/trunk/make/platform/clang_darwin.mk compiler-rt/trunk/make/platform/darwin_fat.mk compiler-rt/trunk/make/platform/multi_arch.mk Modified: compiler-rt/trunk/make/platform/clang_darwin.mk URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_darwin.mk?rev=144658&r1=144657&r2=144658&view=diff ============================================================================== --- compiler-rt/trunk/make/platform/clang_darwin.mk (original) +++ compiler-rt/trunk/make/platform/clang_darwin.mk Tue Nov 15 12:34:17 2011 @@ -67,7 +67,7 @@ ### -CC := gcc +CC := clang # Forcibly strip off any -arch, as that totally breaks our universal support. override CC := $(subst -arch ,-arch_,$(CC)) Modified: compiler-rt/trunk/make/platform/darwin_fat.mk URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/darwin_fat.mk?rev=144658&r1=144657&r2=144658&view=diff ============================================================================== --- compiler-rt/trunk/make/platform/darwin_fat.mk (original) +++ compiler-rt/trunk/make/platform/darwin_fat.mk Tue Nov 15 12:34:17 2011 @@ -37,7 +37,7 @@ #