From jyasskin at google.com Sun Nov 1 01:40:50 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Sat, 31 Oct 2009 23:40:50 -0700 Subject: [LLVMdev] Should LLVM JIT default to lazy or non-lazy? In-Reply-To: <4AEAAECE.3040102@gmail.com> References: <0A272AD2-24B8-4FF6-8F0C-3A291CE5DBBE@apple.com> <4AEA0971.6020803@lip6.fr> <4AEAAECE.3040102@gmail.com> Message-ID: 2009/10/30 T?r?k Edwin : > On 2009-10-29 23:55, Jeffrey Yasskin wrote: >> On Thu, Oct 29, 2009 at 2:30 PM, Nicolas Geoffray >> wrote: >> >>> Hi Jeffrey, >>> >>> Jeffrey Yasskin wrote: >>> >>>> Cool, I'll start implementing it. >>>> >>>> >>> Great! Thanks. >>> >>> Just to clarify things: on my end, it doesn't really matter what is the >>> default behavior, as long as vmkit can continue to have the existing >>> behavior of lazy compilation. With Chris' solution, I was wondering how you >>> would implement the getPointerToFunction{Eager, Lazy} functions when the >>> getPointerToFunction is called by the JIT, not the user. For example, when >>> Function F calls Function G and the JIT needs an address for G (either a >>> callback or the function address), how will it know if it must call >>> getPointerToFunctionEager or getPointerToFunctionLazy? Do you plan on >>> continuing having a flag that enables/disables lazy compilation and poll >>> this flag on each function call? How is that different than the existing >>> system? >>> >> >> Semantically, I'll thread the flag through all the calls that may >> eventually need to recursively call getPointerToFunction. To implement >> that without having to modify lots of calls, I'll probably replace the >> current public default eager/lazy setting with a private flag with >> values {Unknown, Lazy, Eager}, set it on entry and exit of >> getPointerToFunction, and check it on each internal recursive call. >> The difference with the current system is that the user is forced to >> set the flag to their desired value whenever they call into the JIT, >> rather than relying on a default. That choice then propagates through >> the whole recursive tree of codegens, without affecting the next tree. >> >> Note that I'm using getPointerToFunction as an abbreviation for the >> 3ish public functions that'll need to take this option. > > The documentation should also be updated > (http://llvm.org/docs/ProgrammersManual.html#threading) to reflect what > one needs to do, > to ensure thread-safe JITing. Thanks for that reminder. I've updated it in the patch I'm about to mail, but I should apply the update regardless of whether the rest of the patch goes in. > Also does every JIT target support non-lazy JITing now? ?See PR4816, > last time I checked (r83242) it only worked on X86, and failed on PPC; > so I had to keep lazy JITing enabled even if its not what I want for > many reasons. It's still the case that only X86 supports eager jitting. It doesn't look that hard to add it to the rest of the targets though. > Also perhaps the lazy compilation stub should spin waiting on a lock > (implemented using atomics), and the compilation callback should > execute while holding the lock just before patching the callsite, so it > would look like this in pseudocode: Good idea. This increases the code size a bit, but it's clearly better than the "load the target address" option I mentioned in the bug. Would you add it to the bug so we don't lose it? I think we can put the entire "not yet patched" branch inside the compilation callback to minimize the code size impact: callsite_patch_state = 0;// for each callsite one byte of memory callsite: if (atomic_load(&callsite_patch_state) != 2) { call CompilationCallback // Doesn't return until the patchsite is patched. } //fast- and slow-path: already compiled and patched patchsite: call // will be patched > callsite_patch_state = 0;// for each callsite one byte of memory > > callsite: > if ?(atomic_load(&callsite_patch_state) == 2) { > ? ? ?//fast-path: already compiled and patched > patchsite: > ? ? ? jmp // will be patched > } > // not yet patched, it may already be compiling > if ?(atomic_test_and_set(&callsite_patch_state, 0, 1) == 0) { > ? ? ?// not yet compiling, set state to compiling, and start compiling > ? ? ?call CompilationCallBack > ? ? ?// set state to patched > ? ? ?atomic_set(&callsite_patch_state, 2) > } > // wait for patched state > while (atomic_load(&callsite_patch_state) != 2) { > ?waitJIT(); > } > // serialize > CPUID > patchsite2: > // execute new code > jmp // will be patched > > waitJIT: > ? ?jitLock() > ? ?jitUnlock() > > ^This should be consistent with the Intel Manual's requirements on XMC, > which has a similar algorithm, except for the fast-path. > > CompilationCallBack: > ? jitLock(); > ? ? ? ?if (isJITed(F)) {jitUnlock(); return;} > ? ? ? ?JIT function > > ? ? ? ?patch_callsite(&patchsite, compiledFunctionAddress); > ? ? ? ?patch_callsite(&patchsite2, compiledFunctionAddress); > ? ? ? ?setJITed(F, true); > > ? jitUnlock(); > > This way once it is compiled the callsite will only execute: > ? ?atomic_load(&callsite_patch_state) > ? ?== 2 > ? ?jmp compiledFunctionAddress > > Best regards, > --Edwin > From mdevan.foobar at gmail.com Sun Nov 1 01:47:59 2009 From: mdevan.foobar at gmail.com (Mahadevan R) Date: Sun, 1 Nov 2009 12:17:59 +0530 Subject: [LLVMdev] Something wrong with my libpthread.so In-Reply-To: References: Message-ID: Hi, On Sat, Oct 31, 2009 at 11:42 AM, Nan Zhu wrote: > Hi,all > > I tried to run the generated whole-program bitcode of BIND,but I got some > information: > > 0?? lli???????????? 0x0000000000feda16 > 1?? lli???????????? 0x0000000000fed88f > 2?? libpthread.so.0 0x0000003df340eee0 > 3?? libc.so.6?????? 0x0000003df28332f5 gsignal + 53 > 4?? libc.so.6?????? 0x0000003df2834b20 abort + 384 > 5?? libc.so.6?????? 0x0000003df282c2fa __assert_fail + 234 > 6?? lli???????????? 0x000000000085ece9 > llvm::SmallVectorImpl::operator[](unsigned int) + 77 > 7?? lli???????????? 0x0000000000850ce0 > llvm::BitcodeReader::ParseMetadataAttachment() + 448 > 8?? lli???????????? 0x0000000000851043 Looks like a bug in the following piece of code, from BitcodeReader::ParseMetadataAttachment(): 1601 case bitc::METADATA_ATTACHMENT: { 1602 unsigned RecordLength = Record.size(); 1603 if (Record.empty() || (RecordLength - 1) % 2 == 1) 1604 return Error ("Invalid METADATA_ATTACHMENT reader!"); 1605 Instruction *Inst = InstructionList[Record[0]]; 1606 for (unsigned i = 1; i != RecordLength; i = i+2) { 1607 unsigned Kind = Record[i]; 1608 Value *Node = MDValueList.getValueFwdRef(Record[i+1]); 1609 TheMetadata.addMD(Kind, cast(Node), Inst); 1610 } 1611 break; 1612 } At line 1606, i never becomes equal to RecordLength. Regards, -Mahadevan. From nicholas at mxc.ca Sun Nov 1 01:51:22 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Sat, 31 Oct 2009 23:51:22 -0700 Subject: [LLVMdev] Something wrong with my libpthread.so In-Reply-To: References: Message-ID: <4AED2FEA.8030205@mxc.ca> Mahadevan R wrote: > Hi, > > On Sat, Oct 31, 2009 at 11:42 AM, Nan Zhu wrote: >> Hi,all >> >> I tried to run the generated whole-program bitcode of BIND,but I got some >> information: >> >> 0 lli 0x0000000000feda16 >> 1 lli 0x0000000000fed88f >> 2 libpthread.so.0 0x0000003df340eee0 >> 3 libc.so.6 0x0000003df28332f5 gsignal + 53 >> 4 libc.so.6 0x0000003df2834b20 abort + 384 >> 5 libc.so.6 0x0000003df282c2fa __assert_fail + 234 >> 6 lli 0x000000000085ece9 >> llvm::SmallVectorImpl::operator[](unsigned int) + 77 >> 7 lli 0x0000000000850ce0 >> llvm::BitcodeReader::ParseMetadataAttachment() + 448 >> 8 lli 0x0000000000851043 > > Looks like a bug in the following piece of code, from > BitcodeReader::ParseMetadataAttachment(): > > 1601 case bitc::METADATA_ATTACHMENT: { > 1602 unsigned RecordLength = Record.size(); > 1603 if (Record.empty() || (RecordLength - 1) % 2 == 1) > 1604 return Error ("Invalid METADATA_ATTACHMENT reader!"); > 1605 Instruction *Inst = InstructionList[Record[0]]; > 1606 for (unsigned i = 1; i != RecordLength; i = i+2) { > 1607 unsigned Kind = Record[i]; > 1608 Value *Node = MDValueList.getValueFwdRef(Record[i+1]); > 1609 TheMetadata.addMD(Kind, cast(Node), Inst); > 1610 } > 1611 break; > 1612 } > > At line 1606, i never becomes equal to RecordLength. I strongly suspect this is llvm.org/PR5278 . Please add your comments there, thanks! Nick From jyasskin at google.com Sun Nov 1 01:09:14 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Sun, 1 Nov 2009 00:09:14 -0700 Subject: [LLVMdev] Should LLVM JIT default to lazy or non-lazy? In-Reply-To: References: <74c447500910281007t527c2e3cvbd6ff1335f290056@mail.gmail.com> <0A272AD2-24B8-4FF6-8F0C-3A291CE5DBBE@apple.com> Message-ID: A possible patch implementing this is at http://codereview.appspot.com/144074 (http://codereview.appspot.com/download/issue144074_1.diff). I do NOT think we should accept this patch: It changes a lot of APIs and makes users specify the choice in many places, while I think most users really just want one choice for their whole app. There's a good argument to be made that users may want to decide certain calls should be lazily-compiled, but those are boundaries _within_ a transitive call tree, not the whole-tree choice this change allows. I'd be happy with a forced choice when creating the JIT, or with an optional choice defaulted to the safer option, but this patch seems like the wrong thing to do. Evan, you wrote, "there are existing customers out there that are using previous llvm release who will not appreciate the API change." Who are they? Recall that after my original change they can get back to lazy compilation by adding jit->DisableLazyCompilation(false) to their code. They have no need for #ifdefs. I still think that having a default that's right in nearly all cases is the best option (the only concrete counter-example I've seen is lli), but I'm happy to write another patch with a global forced choice or commit this one if that's what you guys want. On Thu, Oct 29, 2009 at 11:46 AM, Jeffrey Yasskin wrote: > Cool, I'll start implementing it. > > Thanks all for the decision! > > On Thu, Oct 29, 2009 at 11:03 AM, Evan Cheng wrote: >> I have no objection to Chris' proposal. >> >> Evan >> >> On Oct 29, 2009, at 9:45 AM, Jeffrey Yasskin wrote: >> >>> Are you objecting to Chris's proposal? I was waiting to implement it >>> until you replied so I wouldn't have to implement two things. I >>> disagree with a lot of what you wrote below, but it's not worth >>> arguing about if there's a compromise we can both live with. >>> >>> On Thu, Oct 29, 2009 at 12:36 AM, Evan Cheng wrote: >>>> There is nothing here that prevents users from enabling or disabling lazy >>>> JIT. We're talk about flipping the default behavior. That does not make the >>>> API any better or worse. Nor does it fix the inherent thread safety issue. >>>> >>>> I can tell you there are no Apple clients that depend on the lazy JIT. >>>> Please do not imply I am being secretive. I am simply busy. My objection is >>>> simple. Changing API simply for the sake of flipping default behavior does >>>> not seem like a good trade off to me. You may not feel the pain, but there >>>> are existing customers out there that are using previous llvm release who >>>> will not appreciate the API change. >>>> >>>> To me, the decision is simple. People who have done the work in the past >>>> have made their choices. We better respect their choices unless we are >>>> replacing them with something better. Flipping the default isn't better. If >>>> someone wants to sign up to design a new API, that person(s) get to decide >>>> on the default behavior. It's simple as that. >>>> >>>> For behavior / API change like this, we better extend llvm-config (or some >>>> other means) to expose that information. So the existing clients can at >>>> least ifdef the code. >>>> >>>> Evan >>>> >>>> On Oct 28, 2009, at 1:31 PM, Jeffrey Yasskin wrote: >>>> >>>>> On Wed, Oct 28, 2009 at 12:21 PM, Evan Cheng wrote: >>>>>> >>>>>> On Oct 28, 2009, at 10:07 AM, Chandler Carruth wrote: >>>>>> >>>>>>> From where I sit, this boils down to a very simple question (modulo >>>>>>> Chris's point): Either choice will surprise some users. Which surprise >>>>>>> is worse? Personally, I'd always prefer correct but slow behavior by >>>>>>> default, and explicitly enabling dangerous (but in some cases fast) >>>>>>> behavior. >>>>>> >>>>>> The behavior is only dangerous because people are using it in new and >>>>>> different ways. >>>>> >>>>> I'd point out that reid thought he made the JIT thread-safe in r22404 >>>>> back in 2005. Calling it from multiple threads isn't new and >>>>> different, it's just subtly broken. I suggested changing the default >>>>> because most people who run into this problem don't think they're >>>>> doing anything unusual, and in fact their code works fine with the >>>>> eager JIT. People shouldn't stumble into broken behavior, and defaults >>>>> are good to prevent stumbling. >>>>> >>>>> To avoid misconceptions, Unladen Swallow added the line to turn off >>>>> the lazy jit months ago, and we'll keep that line whatever the >>>>> decision is here. We might take advantage of a thread-safe >>>>> code-patching facility eventually, but we've been designing assuming >>>>> nobody else will implement that for us. I favor changing the default >>>>> because it'll help newbies, not because we need it for anything. >>>>> >>>>>>> I would also point out that it seems that most of the people new to >>>>>>> the JIT are surprised by the current behavior, where as those who >>>>>>> would be surprised by needing to enable lazy JIT are those long >>>>>>> familiar with past behavior. In the OSS world, I always favor easing >>>>>>> adoption over maintaining the status quo. >>>>>> >>>>>> This argues for better documentation. I'd prefer for EE to abort if user >>>>>> is asking for a known dangerous configuration (multi-threaded and lazy). >>>>> >>>>> I think that'd be a decent fix for the thread-safety problem. It'd >>>>> require an extra check on each call to runJITOnFunctionUnlocked since >>>>> laziness is set by a call, not on construction. Or, we could use the >>>>> JIT lock to assert that it's never entered concurrently. On the other >>>>> hand, Nicolas Geoffray objected when I suggested that in the bug. >>>>> >>>>>> The biggest argument I have for staying with lazy is llvm JIT is not a >>>>>> light weight JIT. It's designed to do all the codegen optimizations a normal >>>>>> static compiler would do. Non-lazy JIT is too slow. >>>>> >>>>> ?scar used the cost of the JIT as an argument _against_ the lazy JIT. >>>>> Could you elaborate on why you think it's an argument in favor of lazy >>>>> JITting? >>>>> >>>>>> I'd prefer not to change the behavior. >>>>> >>>>> I'm guessing, based on your vagueness, that there are some internal >>>>> single-threaded Apple users who think that the lazy JIT is the best >>>>> performing option for them and who don't want to add a line to their >>>>> apps overriding the default. But it's hard for me or anyone else >>>>> outside Apple to judge whether they ought to drive the default without >>>>> a little more information about why the lazy JIT is good for them. >>>>> Could you describe any features of their use that make the lazy JIT a >>>>> good idea for them? >>>>> >>>>>> If we want to start using it in new and interesting ways, we should just >>>>>> design a new JIT. >>>>> >>>>>>> My meager 2 cents. >>>>>>> -Chandler >>>>>>> >>>>>>> On Wed, Oct 28, 2009 at 9:41 AM, Jeffrey Yasskin >>>>>>> wrote: >>>>>>>> >>>>>>>> In r85295, in response to the discussion at http://llvm.org/PR5184 >>>>>>>> (Lazy JIT ain't thread-safe), I changed the default JIT from lazy to >>>>>>>> non-lazy. It has since come to my attention that this may have been >>>>>>>> the wrong change, so I wanted to ask you guys. >>>>>>>> >>>>>>>> A couple reasons to make the default non-lazy compilation: >>>>>>>> * The lack of thread-safety surprises new users >>>>>>>> * Crashes due to this will be rare and so hard to track down >>>>>>>> * The current lazy scheme is almost never the right answer for >>>>>>>> performance >>>>>>>> * It's only one line of code to turn on lazy compilation when it is >>>>>>>> the right answer for you. >>>>>>>> >>>>>>>> And a couple to default to lazy compilation: >>>>>>>> * It's safe for single-threaded code. >>>>>>>> * There are existing users who have assumed this default. >>>>>>>> * PPC and ARM don't support non-lazy compilation yet (the tests >>>>>>>> currently run the lazy jit). >>>>>>>> * Gratuitous changes are bad. >>>>>>>> >>>>>>>> Thoughts? >>>>>>>> >>>>>>>> We can choose the default for lli separately from the JIT's default if >>>>>>>> we want. >>>>>>>> _______________________________________________ >>>>>>>> LLVM Developers mailing list >>>>>>>> LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >>>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> LLVM Developers mailing list >>>>>>> LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>>>>> >>>>>> >>>> >>>> >> >> > From mdevan.foobar at gmail.com Sun Nov 1 01:15:10 2009 From: mdevan.foobar at gmail.com (Mahadevan R) Date: Sun, 1 Nov 2009 12:45:10 +0530 Subject: [LLVMdev] Something wrong with my libpthread.so In-Reply-To: <4AED2FEA.8030205@mxc.ca> References: <4AED2FEA.8030205@mxc.ca> Message-ID: On Sun, Nov 1, 2009 at 12:21 PM, Nick Lewycky wrote: > Mahadevan R wrote: >> >> Hi, >> >> On Sat, Oct 31, 2009 at 11:42 AM, Nan Zhu wrote: >>> >>> Hi,all >>> >>> I tried to run the generated whole-program bitcode of BIND,but I got some >>> information: >>> >>> 0 ? lli ? ? ? ? ? ? 0x0000000000feda16 >>> 1 ? lli ? ? ? ? ? ? 0x0000000000fed88f >>> 2 ? libpthread.so.0 0x0000003df340eee0 >>> 3 ? libc.so.6 ? ? ? 0x0000003df28332f5 gsignal + 53 >>> 4 ? libc.so.6 ? ? ? 0x0000003df2834b20 abort + 384 >>> 5 ? libc.so.6 ? ? ? 0x0000003df282c2fa __assert_fail + 234 >>> 6 ? lli ? ? ? ? ? ? 0x000000000085ece9 >>> llvm::SmallVectorImpl::operator[](unsigned int) + 77 >>> 7 ? lli ? ? ? ? ? ? 0x0000000000850ce0 >>> llvm::BitcodeReader::ParseMetadataAttachment() + 448 >>> 8 ? lli ? ? ? ? ? ? 0x0000000000851043 >> >> Looks like a bug in the following piece of code, from >> BitcodeReader::ParseMetadataAttachment(): >> >> ?1601 ? ? ?case bitc::METADATA_ATTACHMENT: { >> ?1602 ? ? ? ?unsigned RecordLength = Record.size(); >> ?1603 ? ? ? ?if (Record.empty() || (RecordLength - 1) % 2 == 1) >> ?1604 ? ? ? ? ?return Error ("Invalid METADATA_ATTACHMENT reader!"); >> ?1605 ? ? ? ?Instruction *Inst = InstructionList[Record[0]]; >> ?1606 ? ? ? ?for (unsigned i = 1; i != RecordLength; i = i+2) { >> ?1607 ? ? ? ? ?unsigned Kind = Record[i]; >> ?1608 ? ? ? ? ?Value *Node = MDValueList.getValueFwdRef(Record[i+1]); >> ?1609 ? ? ? ? ?TheMetadata.addMD(Kind, cast(Node), Inst); >> ?1610 ? ? ? ?} >> ?1611 ? ? ? ?break; >> ?1612 ? ? ?} >> >> At line 1606, i never becomes equal to RecordLength. > > I strongly suspect this is llvm.org/PR5278 . Please add your comments there, > thanks! Done. Regards, -Mahadevan. > > Nick > From edwintorok at gmail.com Sun Nov 1 03:53:51 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Sun, 01 Nov 2009 11:53:51 +0200 Subject: [LLVMdev] Should LLVM JIT default to lazy or non-lazy? In-Reply-To: References: <0A272AD2-24B8-4FF6-8F0C-3A291CE5DBBE@apple.com> <4AEA0971.6020803@lip6.fr> <4AEAAECE.3040102@gmail.com> Message-ID: <4AED5AAF.9030202@gmail.com> On 2009-11-01 08:40, Jeffrey Yasskin wrote: > 2009/10/30 T?r?k Edwin : > >> On 2009-10-29 23:55, Jeffrey Yasskin wrote: >> >>> On Thu, Oct 29, 2009 at 2:30 PM, Nicolas Geoffray >>> wrote: >>> >>> >>>> Hi Jeffrey, >>>> >>>> Jeffrey Yasskin wrote: >>>> >>>> >>>>> Cool, I'll start implementing it. >>>>> >>>>> >>>>> >>>> Great! Thanks. >>>> >>>> Just to clarify things: on my end, it doesn't really matter what is the >>>> default behavior, as long as vmkit can continue to have the existing >>>> behavior of lazy compilation. With Chris' solution, I was wondering how you >>>> would implement the getPointerToFunction{Eager, Lazy} functions when the >>>> getPointerToFunction is called by the JIT, not the user. For example, when >>>> Function F calls Function G and the JIT needs an address for G (either a >>>> callback or the function address), how will it know if it must call >>>> getPointerToFunctionEager or getPointerToFunctionLazy? Do you plan on >>>> continuing having a flag that enables/disables lazy compilation and poll >>>> this flag on each function call? How is that different than the existing >>>> system? >>>> >>>> >>> Semantically, I'll thread the flag through all the calls that may >>> eventually need to recursively call getPointerToFunction. To implement >>> that without having to modify lots of calls, I'll probably replace the >>> current public default eager/lazy setting with a private flag with >>> values {Unknown, Lazy, Eager}, set it on entry and exit of >>> getPointerToFunction, and check it on each internal recursive call. >>> The difference with the current system is that the user is forced to >>> set the flag to their desired value whenever they call into the JIT, >>> rather than relying on a default. That choice then propagates through >>> the whole recursive tree of codegens, without affecting the next tree. >>> >>> Note that I'm using getPointerToFunction as an abbreviation for the >>> 3ish public functions that'll need to take this option. >>> >> The documentation should also be updated >> (http://llvm.org/docs/ProgrammersManual.html#threading) to reflect what >> one needs to do, >> to ensure thread-safe JITing. >> > > Thanks for that reminder. I've updated it in the patch I'm about to > mail, but I should apply the update regardless of whether the rest of > the patch goes in. > > >> Also does every JIT target support non-lazy JITing now? See PR4816, >> last time I checked (r83242) it only worked on X86, and failed on PPC; >> so I had to keep lazy JITing enabled even if its not what I want for >> many reasons. >> > > It's still the case that only X86 supports eager jitting. It doesn't > look that hard to add it to the rest of the targets though. > > Ok. >> Also perhaps the lazy compilation stub should spin waiting on a lock >> (implemented using atomics), and the compilation callback should >> execute while holding the lock just before patching the callsite, so it >> would look like this in pseudocode: >> > > Good idea. This increases the code size a bit, but it's clearly better > than the "load the target address" option I mentioned in the bug. > Would you add it to the bug so we don't lose it? > > I think we can put the entire "not yet patched" branch inside the > compilation callback to minimize the code size impact: > > callsite_patch_state = 0;// for each callsite one byte of memory > > callsite: > if (atomic_load(&callsite_patch_state) != 2) { > call CompilationCallback // Doesn't return until the patchsite is patched. > } > //fast- and slow-path: already compiled and patched > patchsite: > call // will be patched > > Yes, that sounds good (except that we'd want a jmp instead of a call I think), I'll post a patch to that bugreport tomorrow if time permits. Would this mean that lazy-JITing would be threadsafe and the default could stay lazy? Best regards, --Edwin From jyasskin at google.com Sun Nov 1 12:02:31 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Sun, 1 Nov 2009 11:02:31 -0700 Subject: [LLVMdev] Should LLVM JIT default to lazy or non-lazy? In-Reply-To: <4AED5AAF.9030202@gmail.com> References: <0A272AD2-24B8-4FF6-8F0C-3A291CE5DBBE@apple.com> <4AEA0971.6020803@lip6.fr> <4AEAAECE.3040102@gmail.com> <4AED5AAF.9030202@gmail.com> Message-ID: 2009/11/1 T?r?k Edwin : > On 2009-11-01 08:40, Jeffrey Yasskin wrote: >> 2009/10/30 T?r?k Edwin : >> >>> On 2009-10-29 23:55, Jeffrey Yasskin wrote: >>> >>>> On Thu, Oct 29, 2009 at 2:30 PM, Nicolas Geoffray >>>> wrote: >>>> >>>> >>>>> Hi Jeffrey, >>>>> >>>>> Jeffrey Yasskin wrote: >>>>> >>>>> >>>>>> Cool, I'll start implementing it. >>>>>> >>>>>> >>>>>> >>>>> Great! Thanks. >>>>> >>>>> Just to clarify things: on my end, it doesn't really matter what is the >>>>> default behavior, as long as vmkit can continue to have the existing >>>>> behavior of lazy compilation. With Chris' solution, I was wondering how you >>>>> would implement the getPointerToFunction{Eager, Lazy} functions when the >>>>> getPointerToFunction is called by the JIT, not the user. For example, when >>>>> Function F calls Function G and the JIT needs an address for G (either a >>>>> callback or the function address), how will it know if it must call >>>>> getPointerToFunctionEager or getPointerToFunctionLazy? Do you plan on >>>>> continuing having a flag that enables/disables lazy compilation and poll >>>>> this flag on each function call? How is that different than the existing >>>>> system? >>>>> >>>>> >>>> Semantically, I'll thread the flag through all the calls that may >>>> eventually need to recursively call getPointerToFunction. To implement >>>> that without having to modify lots of calls, I'll probably replace the >>>> current public default eager/lazy setting with a private flag with >>>> values {Unknown, Lazy, Eager}, set it on entry and exit of >>>> getPointerToFunction, and check it on each internal recursive call. >>>> The difference with the current system is that the user is forced to >>>> set the flag to their desired value whenever they call into the JIT, >>>> rather than relying on a default. That choice then propagates through >>>> the whole recursive tree of codegens, without affecting the next tree. >>>> >>>> Note that I'm using getPointerToFunction as an abbreviation for the >>>> 3ish public functions that'll need to take this option. >>>> >>> The documentation should also be updated >>> (http://llvm.org/docs/ProgrammersManual.html#threading) to reflect what >>> one needs to do, >>> to ensure thread-safe JITing. >>> >> >> Thanks for that reminder. I've updated it in the patch I'm about to >> mail, but I should apply the update regardless of whether the rest of >> the patch goes in. >> >> >>> Also does every JIT target support non-lazy JITing now? ?See PR4816, >>> last time I checked (r83242) it only worked on X86, and failed on PPC; >>> so I had to keep lazy JITing enabled even if its not what I want for >>> many reasons. >>> >> >> It's still the case that only X86 supports eager jitting. It doesn't >> look that hard to add it to the rest of the targets though. >> >> > > Ok. > >>> Also perhaps the lazy compilation stub should spin waiting on a lock >>> (implemented using atomics), and the compilation callback should >>> execute while holding the lock just before patching the callsite, so it >>> would look like this in pseudocode: >>> >> >> Good idea. This increases the code size a bit, but it's clearly better >> than the "load the target address" option I mentioned in the bug. >> Would you add it to the bug so we don't lose it? >> >> I think we can put the entire "not yet patched" branch inside the >> compilation callback to minimize the code size impact: >> >> callsite_patch_state = 0;// for each callsite one byte of memory >> >> callsite: >> if ?(atomic_load(&callsite_patch_state) != 2) { >> ? call CompilationCallback ?// Doesn't return until the patchsite is patched. >> } >> //fast- and slow-path: already compiled and patched >> patchsite: >> ? ? ? call // will be patched >> >> > > Yes, that sounds good (except that we'd want a jmp instead of a call I > think), I'll post a patch to that bugreport tomorrow if time permits. > > Would this mean that lazy-JITing would be threadsafe and the default > could stay lazy? If lazy jitting were threadsafe, I'd stop pushing to make eager jitting the default. Do you mean you're volunteering to implement thread-safe lazy jitting? If so, remember to fix the places that patch non-stub calls too. Thanks! From ngompa13 at gmail.com Sun Nov 1 15:10:00 2009 From: ngompa13 at gmail.com (King InuYasha) Date: Sun, 1 Nov 2009 15:10:00 -0600 Subject: [LLVMdev] Issue compiling LLVM 2.6 on Windows with MinGW Message-ID: <8278b1b0911011310j2d235d63iefd7e28585d9d49c@mail.gmail.com> Hello, I downloaded LLVM 2.6 and was attempting to compile it with TDM-GCC 4.4.1-tdm2-sjlj + cmake 2.6.4 and this happened: =============Console=================== C:\projects\game-editor\LLVM\build-root>mingw32-make [ 2%] Built target LLVMSystem [ 5%] Built target LLVMSupport [ 7%] Built target tblgen [ 7%] Built target intrinsics_gen [ 10%] Built target LLVMCore [ 12%] Built target LLVMTransformUtils [ 15%] Built target LLVMScalarOpts [ 22%] Built target LLVMCodeGen [ 26%] Built target LLVMAnalysis [ 26%] Built target LLVMAsmPrinter [ 29%] Built target LLVMSelectionDAG [ 30%] Built target LLVMBitReader [ 31%] Built target LLVMBitWriter [ 32%] Built target LLVMInstrumentation [ 36%] Built target LLVMipo [ 36%] Built target LLVMHello [ 36%] Built target LLVMLinker [ 36%] Built target LLVMipa [ 38%] Built target LLVMMC [ 38%] Built target FileCheck [ 40%] Built target ARMCodeGenTable_gen [ 44%] Built target LLVMARMCodeGen [ 45%] Built target LLVMARMInfo [ 45%] Built target LLVMARMAsmPrinter [ 45%] Built target LLVMCBackend [ 45%] Built target LLVMCBackendInfo [ 45%] Built target LLVMCppBackend [ 45%] Built target LLVMCppBackendInfo [ 47%] Built target MipsCodeGenTable_gen [ 50%] Built target LLVMMipsCodeGen [ 50%] Built target LLVMMipsInfo [ 50%] Built target LLVMMipsAsmPrinter [ 50%] Built target LLVMMSIL [ 50%] Built target LLVMMSILInfo [ 52%] Built target PowerPCCodeGenTable_gen [ 56%] Built target LLVMPowerPCCodeGen [ 56%] Built target LLVMPowerPCInfo [ 56%] Built target LLVMPowerPCAsmPrinter [ 58%] Built target X86CodeGenTable_gen [ 62%] Built target LLVMX86CodeGen [ 63%] Built target LLVMX86Info [ 63%] Built target LLVMX86AsmPrinter [ 63%] Built target LLVMX86AsmParser [ 63%] Built target LLVMExecutionEngine [ 64%] Built target LLVMInterpreter [ 64%] Built target LLVMJIT [ 67%] Built target LLVMTarget [ 67%] Built target LLVMAsmParser [ 68%] Built target LLVMDebugger [ 68%] Built target LLVMArchive Linking CXX executable ..\..\bin\opt.exe ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x25): undefined r eference to `_imp__pthread_rwlockattr_init' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x5f): undefined r eference to `_imp__pthread_rwlockattr_setpshared' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x76): undefined r eference to `_imp__pthread_rwlock_init' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0xa8): undefined r eference to `_imp__pthread_rwlockattr_destroy' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x103): undefined reference to `_imp__pthread_rwlockattr_init' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x13d): undefined reference to `_imp__pthread_rwlockattr_setpshared' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x154): undefined reference to `_imp__pthread_rwlock_init' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x186): undefined reference to `_imp__pthread_rwlockattr_destroy' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x1f3): undefined reference to `_imp__pthread_rwlock_destroy' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x23d): undefined reference to `_imp__pthread_rwlock_destroy' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x287): undefined reference to `_imp__pthread_rwlock_rdlock' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x2d1): undefined reference to `_imp__pthread_rwlock_unlock' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x31b): undefined reference to `_imp__pthread_rwlock_wrlock' ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x365): undefined reference to `_imp__pthread_rwlock_unlock' ..\..\lib\libLLVMSystem.a(ThreadLocal.cpp.obj):ThreadLocal.cpp:(.text+0x37): und efined reference to `_imp__pthread_key_create' ..\..\lib\libLLVMSystem.a(ThreadLocal.cpp.obj):ThreadLocal.cpp:(.text+0xa5): und efined reference to `_imp__pthread_key_create' ..\..\lib\libLLVMSystem.a(ThreadLocal.cpp.obj):ThreadLocal.cpp:(.text+0xfd): und efined reference to `_imp__pthread_key_delete' ..\..\lib\libLLVMSystem.a(ThreadLocal.cpp.obj):ThreadLocal.cpp:(.text+0x16b): un defined reference to `_imp__pthread_key_delete' ..\..\lib\libLLVMSystem.a(ThreadLocal.cpp.obj):ThreadLocal.cpp:(.text+0x1d9): un defined reference to `_imp__pthread_key_delete' ..\..\lib\libLLVMSystem.a(ThreadLocal.cpp.obj):ThreadLocal.cpp:(.text+0x245): un defined reference to `_imp__pthread_setspecific' ..\..\lib\libLLVMSystem.a(ThreadLocal.cpp.obj):ThreadLocal.cpp:(.text+0x28a): un defined reference to `_imp__pthread_getspecific' collect2: ld returned 1 exit status mingw32-make[2]: *** [bin/opt.exe] Error 1 mingw32-make[1]: *** [tools/opt/CMakeFiles/opt.dir/all] Error 2 mingw32-make: *** [all] Error 2 C:\projects\game-editor\LLVM\build-root> =======End console=========== The pthread libraries are there, so what's going on? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091101/db8c4f36/attachment.html From evan.cheng at apple.com Sun Nov 1 16:27:30 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 1 Nov 2009 14:27:30 -0800 Subject: [LLVMdev] Should LLVM JIT default to lazy or non-lazy? In-Reply-To: References: <74c447500910281007t527c2e3cvbd6ff1335f290056@mail.gmail.com> <0A272AD2-24B8-4FF6-8F0C-3A291CE5DBBE@apple.com> Message-ID: <12DE512F-09A9-4516-A23F-0543118A06C8@apple.com> On Nov 1, 2009, at 12:09 AM, Jeffrey Yasskin wrote: > A possible patch implementing this is at > http://codereview.appspot.com/144074 > (http://codereview.appspot.com/download/issue144074_1.diff). > > I do NOT think we should accept this patch: It changes a lot of APIs > and makes users specify the choice in many places, while I think most > users really just want one choice for their whole app. There's a good > argument to be made that users may want to decide certain calls should > be lazily-compiled, but those are boundaries _within_ a transitive > call tree, not the whole-tree choice this change allows. I'd be happy > with a forced choice when creating the JIT, or with an optional choice > defaulted to the safer option, but this patch seems like the wrong > thing to do. > > Evan, you wrote, "there are existing customers out there that are > using previous llvm release who will not appreciate the API change." > Who are they? Recall that after my original change they can get back > to lazy compilation by adding jit->DisableLazyCompilation(false) to > their code. They have no need for #ifdefs. I know of several that are not actively participating in these discussions. I don't have knowledge of how they are using LLVM JIT now nor do I think that's appropriate for me to say anything. There are probably other clients that we don't know about. I guess changing API is one way to encourage folks from participating in these discussions. I honestly don't know what the best solution is. I am leaving it to those of you who are actively hacking on the JIT to decide. Evan > > I still think that having a default that's right in nearly all cases > is the best option (the only concrete counter-example I've seen is > lli), but I'm happy to write another patch with a global forced choice > or commit this one if that's what you guys want. > > On Thu, Oct 29, 2009 at 11:46 AM, Jeffrey Yasskin > wrote: >> Cool, I'll start implementing it. >> >> Thanks all for the decision! >> >> On Thu, Oct 29, 2009 at 11:03 AM, Evan Cheng >> wrote: >>> I have no objection to Chris' proposal. >>> >>> Evan >>> >>> On Oct 29, 2009, at 9:45 AM, Jeffrey Yasskin wrote: >>> >>>> Are you objecting to Chris's proposal? I was waiting to implement >>>> it >>>> until you replied so I wouldn't have to implement two things. I >>>> disagree with a lot of what you wrote below, but it's not worth >>>> arguing about if there's a compromise we can both live with. >>>> >>>> On Thu, Oct 29, 2009 at 12:36 AM, Evan Cheng >>>> wrote: >>>>> There is nothing here that prevents users from enabling or >>>>> disabling lazy >>>>> JIT. We're talk about flipping the default behavior. That does >>>>> not make the >>>>> API any better or worse. Nor does it fix the inherent thread >>>>> safety issue. >>>>> >>>>> I can tell you there are no Apple clients that depend on the >>>>> lazy JIT. >>>>> Please do not imply I am being secretive. I am simply busy. My >>>>> objection is >>>>> simple. Changing API simply for the sake of flipping default >>>>> behavior does >>>>> not seem like a good trade off to me. You may not feel the pain, >>>>> but there >>>>> are existing customers out there that are using previous llvm >>>>> release who >>>>> will not appreciate the API change. >>>>> >>>>> To me, the decision is simple. People who have done the work in >>>>> the past >>>>> have made their choices. We better respect their choices unless >>>>> we are >>>>> replacing them with something better. Flipping the default isn't >>>>> better. If >>>>> someone wants to sign up to design a new API, that person(s) get >>>>> to decide >>>>> on the default behavior. It's simple as that. >>>>> >>>>> For behavior / API change like this, we better extend llvm- >>>>> config (or some >>>>> other means) to expose that information. So the existing clients >>>>> can at >>>>> least ifdef the code. >>>>> >>>>> Evan >>>>> >>>>> On Oct 28, 2009, at 1:31 PM, Jeffrey Yasskin wrote: >>>>> >>>>>> On Wed, Oct 28, 2009 at 12:21 PM, Evan Cheng >>>>> > wrote: >>>>>>> >>>>>>> On Oct 28, 2009, at 10:07 AM, Chandler Carruth wrote: >>>>>>> >>>>>>>> From where I sit, this boils down to a very simple question >>>>>>>> (modulo >>>>>>>> Chris's point): Either choice will surprise some users. Which >>>>>>>> surprise >>>>>>>> is worse? Personally, I'd always prefer correct but slow >>>>>>>> behavior by >>>>>>>> default, and explicitly enabling dangerous (but in some cases >>>>>>>> fast) >>>>>>>> behavior. >>>>>>> >>>>>>> The behavior is only dangerous because people are using it in >>>>>>> new and >>>>>>> different ways. >>>>>> >>>>>> I'd point out that reid thought he made the JIT thread-safe in >>>>>> r22404 >>>>>> back in 2005. Calling it from multiple threads isn't new and >>>>>> different, it's just subtly broken. I suggested changing the >>>>>> default >>>>>> because most people who run into this problem don't think they're >>>>>> doing anything unusual, and in fact their code works fine with >>>>>> the >>>>>> eager JIT. People shouldn't stumble into broken behavior, and >>>>>> defaults >>>>>> are good to prevent stumbling. >>>>>> >>>>>> To avoid misconceptions, Unladen Swallow added the line to turn >>>>>> off >>>>>> the lazy jit months ago, and we'll keep that line whatever the >>>>>> decision is here. We might take advantage of a thread-safe >>>>>> code-patching facility eventually, but we've been designing >>>>>> assuming >>>>>> nobody else will implement that for us. I favor changing the >>>>>> default >>>>>> because it'll help newbies, not because we need it for anything. >>>>>> >>>>>>>> I would also point out that it seems that most of the people >>>>>>>> new to >>>>>>>> the JIT are surprised by the current behavior, where as those >>>>>>>> who >>>>>>>> would be surprised by needing to enable lazy JIT are those long >>>>>>>> familiar with past behavior. In the OSS world, I always favor >>>>>>>> easing >>>>>>>> adoption over maintaining the status quo. >>>>>>> >>>>>>> This argues for better documentation. I'd prefer for EE to >>>>>>> abort if user >>>>>>> is asking for a known dangerous configuration (multi-threaded >>>>>>> and lazy). >>>>>> >>>>>> I think that'd be a decent fix for the thread-safety problem. >>>>>> It'd >>>>>> require an extra check on each call to runJITOnFunctionUnlocked >>>>>> since >>>>>> laziness is set by a call, not on construction. Or, we could >>>>>> use the >>>>>> JIT lock to assert that it's never entered concurrently. On the >>>>>> other >>>>>> hand, Nicolas Geoffray objected when I suggested that in the bug. >>>>>> >>>>>>> The biggest argument I have for staying with lazy is llvm JIT >>>>>>> is not a >>>>>>> light weight JIT. It's designed to do all the codegen >>>>>>> optimizations a normal >>>>>>> static compiler would do. Non-lazy JIT is too slow. >>>>>> >>>>>> ?scar used the cost of the JIT as an argument _against_ the >>>>>> lazy JIT. >>>>>> Could you elaborate on why you think it's an argument in favor >>>>>> of lazy >>>>>> JITting? >>>>>> >>>>>>> I'd prefer not to change the behavior. >>>>>> >>>>>> I'm guessing, based on your vagueness, that there are some >>>>>> internal >>>>>> single-threaded Apple users who think that the lazy JIT is the >>>>>> best >>>>>> performing option for them and who don't want to add a line to >>>>>> their >>>>>> apps overriding the default. But it's hard for me or anyone else >>>>>> outside Apple to judge whether they ought to drive the default >>>>>> without >>>>>> a little more information about why the lazy JIT is good for >>>>>> them. >>>>>> Could you describe any features of their use that make the lazy >>>>>> JIT a >>>>>> good idea for them? >>>>>> >>>>>>> If we want to start using it in new and interesting ways, we >>>>>>> should just >>>>>>> design a new JIT. >>>>>> >>>>>>>> My meager 2 cents. >>>>>>>> -Chandler >>>>>>>> >>>>>>>> On Wed, Oct 28, 2009 at 9:41 AM, Jeffrey Yasskin >>>>>>> > >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> In r85295, in response to the discussion at http://llvm.org/PR5184 >>>>>>>>> (Lazy JIT ain't thread-safe), I changed the default JIT from >>>>>>>>> lazy to >>>>>>>>> non-lazy. It has since come to my attention that this may >>>>>>>>> have been >>>>>>>>> the wrong change, so I wanted to ask you guys. >>>>>>>>> >>>>>>>>> A couple reasons to make the default non-lazy compilation: >>>>>>>>> * The lack of thread-safety surprises new users >>>>>>>>> * Crashes due to this will be rare and so hard to track down >>>>>>>>> * The current lazy scheme is almost never the right answer for >>>>>>>>> performance >>>>>>>>> * It's only one line of code to turn on lazy compilation >>>>>>>>> when it is >>>>>>>>> the right answer for you. >>>>>>>>> >>>>>>>>> And a couple to default to lazy compilation: >>>>>>>>> * It's safe for single-threaded code. >>>>>>>>> * There are existing users who have assumed this default. >>>>>>>>> * PPC and ARM don't support non-lazy compilation yet (the >>>>>>>>> tests >>>>>>>>> currently run the lazy jit). >>>>>>>>> * Gratuitous changes are bad. >>>>>>>>> >>>>>>>>> Thoughts? >>>>>>>>> >>>>>>>>> We can choose the default for lli separately from the JIT's >>>>>>>>> default if >>>>>>>>> we want. >>>>>>>>> _______________________________________________ >>>>>>>>> LLVM Developers mailing list >>>>>>>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> LLVM Developers mailing list >>>>>>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>>>>>> >>>>>>> >>>>> >>>>> >>> >>> >> From evan.cheng at apple.com Sun Nov 1 16:33:48 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 1 Nov 2009 14:33:48 -0800 Subject: [LLVMdev] JIT and security In-Reply-To: References: Message-ID: Check out professor Saman Amarasinghe's work. It was being commercialized by a company called Determina (which has since been acquired by VMWare). Evan On Oct 18, 2009, at 1:46 PM, Oleg Knut wrote: > Hello, > > I'm writing JIT compiler that will run a third party code. My goal is > to build it with security layer that will allow me to prevent some > basic operation that possibly can harm JIT application host computer. > > Maybe some of you can guide me on how to do following operations: > 1) prevent system calls > 2) memory allocation management (set some limits that can't be used > by JIT) > 3) CPU power limiting > > I have a guess on how to prevent system calls or some known function > calls by parsing IR and picking up functions calls that maybe > unwanted. Another way is to check list of functions in object model. > Maybe there is already implemented mechanism like that. So, anyone > could give me a clue. > > About RAM and CPU management I have no idea how to do that. > > Ideally my JIT compiler have to become a BlackBox, that hosting party > can configure to his needs. > > I hope I can find some help here. That would be great! > > Thank you for your time, > Oleg. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091101/bd131c26/attachment.html From ofv at wanadoo.es Sun Nov 1 19:04:44 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Mon, 02 Nov 2009 02:04:44 +0100 Subject: [LLVMdev] Issue compiling LLVM 2.6 on Windows with MinGW References: <8278b1b0911011310j2d235d63iefd7e28585d9d49c@mail.gmail.com> Message-ID: <87d441ag9f.fsf@telefonica.net> King InuYasha writes: > I downloaded LLVM 2.6 and was attempting to compile it with TDM-GCC > 4.4.1-tdm2-sjlj + cmake 2.6.4 and this happened: [snip] > Linking CXX executable ..\..\bin\opt.exe > ..\..\lib\libLLVMSystem.a(RWMutex.cpp.obj):RWMutex.cpp:(.text+0x25): > undefined reference to `_imp__pthread_rwlockattr_init' [snip] > The pthread libraries are there, so what's going on? For this issues, bug reports are more convenient than messages on the mailing list, so please file a bug report and put my e-mail on its CC list. Please execute mingw32-make VERBOSE=1 and show the link command for opt.exe -- ?scar From atomicdog.jwm at gmail.com Mon Nov 2 00:57:18 2009 From: atomicdog.jwm at gmail.com (John Myers) Date: Sun, 1 Nov 2009 22:57:18 -0800 Subject: [LLVMdev] llvm-mc build fails Message-ID: <91226b40911012257o5535f413o3094bb2cef34310b@mail.gmail.com> Hi, I'm looking for some pointers on how to troubleshoot this problem. I'm trying to write a backend for the AVR. There is an undefined reference at line 48 which is the line FrameInfo() is on. I've tried to use the MSP430 and other targets as references so I'm not sure what changes I did would cause a problem on this line? AVRTargetMachine::AVRTargetMachine(const Target &T, const std::string &TT, const std::string &FS) : LLVMTargetMachine(T, TT), Subtarget(TT, FS), DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"), InstrInfo(Subtarget), TLInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsDown, 1, 0) { } Linking CXX executable ../../bin/llvm-mc cd /home/john/src/llvm_build/tools/llvm-mc && /usr/bin/cmake -E cmake_link_script CMakeFiles/llvm-mc.dir/link.txt --verbose=1 /usr/bin/c++ -g -fPIC CMakeFiles/llvm-mc.dir/llvm-mc.cpp.o CMakeFiles/llvm-mc.dir/AsmExpr.cpp.o CMakeFiles/llvm-mc.dir/AsmLexer.cpp.o CMakeFiles/llvm-mc.dir/AsmParser.cpp.o -o ../../bin/llvm-mc -rdynamic ../../lib/libLLVMAVRCodeGen.a ../../lib/libLLVMAVRAsmPrinter.a ../../lib/libLLVMAVRInfo.a ../../lib/libLLVMMC.a ../../lib/libLLVMSupport.a ../../lib/libLLVMSystem.a -ldl ../../lib/libLLVMSelectionDAG.a ../../lib/libLLVMAnalysis.a ../../lib/libLLVMAsmPrinter.a ../../lib/libLLVMCodeGen.a ../../lib/libLLVMCore.a ../../lib/libLLVMScalarOpts.a ../../lib/libLLVMTransformUtils.a ../../lib/libLLVMSupport.a ../../lib/libLLVMSystem.a ../../lib/libLLVMAVRCodeGen.a(AVRTargetMachine.cpp.o): In function `AVRTargetMachine': /home/john/src/llvm2.6/lib/Target/AVR/AVRTargetMachine.cpp:48: undefined reference to `llvm::TargetData::~TargetData()' /home/john/src/llvm2.6/lib/Target/AVR/AVRTargetMachine.cpp:48: undefined reference to `llvm::TargetData::~TargetData()' ../../lib/libLLVMAVRCodeGen.a(AVRTargetMachine.cpp.o): In function `TargetFrameInfo': /home/john/src/llvm2.6/include/llvm/Target/TargetFrameInfo.h:40: undefined reference to `vtable for llvm::TargetFrameInfo' ../../lib/libLLVMAVRCodeGen.a(AVRTargetMachine.cpp.o): In function `~AVRGenRegisterInfo': /home/john/src/llvm_build/lib/Target/AVR/AVRGenRegisterInfo.h.inc:14: undefined reference to `llvm::TargetRegisterInfo::~TargetRegisterInfo()' ../../lib/libLLVMAVRCodeGen.a(AVRTargetMachine.cpp.o): In function `~TargetInstrInfoImpl': /home/john/src/llvm2.6/include/llvm/Target/TargetInstrInfo.h:474: undefined reference to `llvm::TargetInstrInfo::~TargetInstrInfo()' ../../lib/libLLVMAVRCodeGen.a(AVRTargetMachine.cpp.o): In function `~AVRSubtarget': /home/john/src/llvm2.6/lib/Target/AVR/AVRSubtarget.h:24: undefined reference to `llvm::TargetSubtarget::~TargetSubtarget()' /home/john/src/llvm2.6/lib/Target/AVR/AVRSubtarget.h:24: undefined reference to `llvm::TargetSubtarget::~TargetSubtarget()' ../../lib/libLLVMAVRCodeGen.a(AVRTargetMachine.cpp.o): In function `~LLVMTargetMachine': /home/john/src/llvm2.6/include/llvm/Target/TargetMachine.h:285: undefined reference to `llvm::TargetMachine::~TargetMachine()' ../../lib/libLLVMAVRCodeGen.a(AVRTargetMachine.cpp.o): In function `~AVRTargetMachine': /home/john/src/llvm2.6/lib/Target/AVR/AVRTargetMachine.h:31: undefined reference to `llvm::TargetFrameInfo::~TargetFrameInfo()' /home/john/src/llvm2.6/lib/Target/AVR/AVRTargetMachine.h:31: undefined reference to `llvm::TargetData::~TargetData()' /home/john/src/llvm2.6/lib/Target/AVR/AVRTargetMachine.h:31: undefined reference to `llvm::TargetData::~TargetData()' /home/john/src/llvm2.6/lib/Target/AVR/AVRTargetMachine.h:31: undefined reference to `llvm::TargetFrameInfo::~TargetFrameInfo()' /home/john/src/llvm2.6/lib/Target/AVR/AVRTargetMachine.h:31: undefined reference to `llvm::TargetData::~TargetData()' /home/john/src/llvm2.6/lib/Target/AVR/AVRTargetMachine.h:31: undefined reference to `llvm::TargetData::~TargetData()' -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091101/090a0b87/attachment.html From anton at korobeynikov.info Mon Nov 2 01:31:09 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 2 Nov 2009 10:31:09 +0300 Subject: [LLVMdev] llvm-mc build fails In-Reply-To: <91226b40911012257o5535f413o3094bb2cef34310b@mail.gmail.com> References: <91226b40911012257o5535f413o3094bb2cef34310b@mail.gmail.com> Message-ID: Hello, John > There is an undefined reference at line 48 which is the line FrameInfo() is > on. I've tried to use the MSP430 and other targets as references so I'm not > sure > what changes I did would cause a problem on this line? It doesn't seem you're linking libTarget in. Have you tried not to use cmake-generated makefiles? As for the cmake - it tracked the explicit list of dependencies somewhere, you might want to update it as well (and different target-specific places in CMakeList.txt files). -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From gjhe at novell.com Mon Nov 2 02:45:04 2009 From: gjhe at novell.com (Guan Jun He) Date: Mon, 02 Nov 2009 01:45:04 -0700 Subject: [LLVMdev] strace for whole-program bitcodes In-Reply-To: <4AEAF6B3020000160000DDD7@novprvlin0050.provo.novell.com> References: <14ECB8FC41FFF347BB6B26A9E828C2BD303D7CBC58@GVW0432EXB.americas.hpqcorp.net> <7618fe50910150610n7a8972b3o83024d330c5fc734@mail.gmail.com> <84tyy0922c.fsf@sauna.l.org> <6a8523d60910150817x20b10e68l1434baad2e868b28@mail.gmail.com> <4AD7EAD2.2000008@mxc.ca> <4DF371AB7D17410093F44939C39AEE5A@andreic6e7fe55> <9430ad070910292011l1dbe827bn78d479702e85585a@mail.gmail.com> <4AEAF6B3020000160000DDD7@novprvlin0050.provo.novell.com> Message-ID: <4AEF0C90020000160000E3CE@novprvlin0050.provo.novell.com> any news?thanks >>> "Guan Jun He" 10/30/2009 2:22 PM >>> --emit-llvm, if not conflict >>> Paul Davey 10/30/2009 11:11 AM >>> --emit-llvm?? On Fri, Oct 30, 2009 at 7:55 AM, Viktor Kutuzov wrote: Hello everyone, I'm working on passing parameters for gold/LTO plug-in and could add this one as well. Just need an option name. Could anybody suggest one? Viktor ----- Original Message ----- From: "Nick Lewycky" To: "Daniel Dunbar" Cc: "Kelly, Terence P (HP Labs Researcher)" ; Sent: Thursday, October 15, 2009 8:38 PM Subject: Re: [LLVMdev] strace for whole-program bitcodes Daniel Dunbar wrote: > On Thu, Oct 15, 2009 at 7:14 AM, Timo Juhani Lindfors > wrote: >> Tianwei writes: >>> someone suggested me to use gold-plugin, I know nothing about it yet, I will >>> have a try later. Does anyone have a good solution for this problem? >> Afaik gold does not help here. I tried it and managed to only generate >> native code. > > "Just" gold isn't quite good enough, because at the last final link > steps gold will still generate native code. However, it should be > possible to find a way to get gold to leave the merged bitcode around > somewhere, or perhaps do something like llvm-ld. Nicholas? It's easy. In gold-plugin.cpp all_symbols_read_hook() where lto_codegen_compile(cg, ...) is currently called, call lto_codegen_write_merged_modules(cg, "/path/to/output.bc") instead. If someone were to rig this up to a command-line flag (search for LDPT_OPTION in the same file) then I would like to commit that change. Nick > The advantage of this approach is that it will potentially work with > build systems that call ar/ld directly. > >> I'm currently investigating an alternative approach to produce >> whole-program bitcodes: >> >> 1) add /tmp/wrap to PATH >> 2) create /tmp/wrap/gcc with the following contents >> >> #!/bin/sh >> exec llvm-gcc -specs /tmp/wrap/gcc.specs "$@" >> >> 3) llvm-gcc -dumpspecs > /tmp/wrap/gcc.specs >> 4) modify /tmp/wrap/gcc.specs so that it always passes -emit-llvm to cc1 >> 5) modify /tmp/wrap/gcc.specs so that it calls llvm-ld* instead of real >> ld and does not pass any unknown flags to it. >> >> With this approach I was able to compile and run airstrike (a 2d >> dogfighting game) in bitcode form very transparently with: >> >> $ make-bitcode fakeroot apt-get --build source airstrike >> $ sudo dpkg -i airstrike*.deb >> $ airstrike > > Very clever though. :) > > - Daniel > >> If you are interested I can try to rework my scripts to a shape where >> they could be used by somebody else. >> >> (*) I am not actually calling llvm-ld directly. Instead I have an >> "llvm-ld-exe" wrapper that calls llvm-ld and then uses "anytoexe" to >> pack the resulting bitcode to a shell script that can execute itself with >> lli and use the correct -load options. >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091102/682aa890/attachment.html From ofv at wanadoo.es Mon Nov 2 04:28:03 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Mon, 02 Nov 2009 11:28:03 +0100 Subject: [LLVMdev] llvm-mc build fails References: <91226b40911012257o5535f413o3094bb2cef34310b@mail.gmail.com> Message-ID: <87639t9q6k.fsf@telefonica.net> John Myers writes: > I'm looking for some pointers on how to troubleshoot this problem. I'm > trying to write a backend for the AVR. > There is an undefined reference at line 48 which is the line FrameInfo() is > on. I've tried to use the MSP430 and other targets as references so I'm not > sure > what changes I did would cause a problem on this line? cmake tracks library dependencies on $LLVM_ROOT/cmake/modules/LLVMLibDeps.txt That file is automatically updated on Unix and Unix-like platforms when all LLVM targets are included on the build. This means that either you update the file manually or run the build with MSYS passing -DLLVM_TARGETS_TO_BUILD=all on the cmake command line. The manual update would consist on adding this lines to the above mentioned file: set(MSVC_LIB_DEPS_LLVMAVRAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMAVRInfo LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMAVRCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMAVRInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMAVRInfo LLVMSupport) which uses MSP430 as a template and supposses that your target is named `AVR' (case sensitive). In case you use the automatic update, the first run of the build will fail because the new dependencies are still not effective. Re-execute the build and it should work. -- ?scar From Juergen.Zimmermann at Sun.COM Mon Nov 2 07:00:04 2009 From: Juergen.Zimmermann at Sun.COM (Juergen Zimmermann - Sun Microsystems - Walldorf Germany) Date: Mon, 02 Nov 2009 14:00:04 +0100 Subject: [LLVMdev] llvm-gcc-4.2 RELEASE_26 bootstrap failure on Solaris/SPARC - unhandled REAL_TYPE during compilation of '__powitf2' In-Reply-To: References: <4AEAE189.6000900@Sun.COM> <4AEB05F0.3080506@Sun.COM> Message-ID: <4AEED7D4.7060504@Sun.COM> Anton, I went with the first alternative with some success. However, now I get some errors during the build of libgcc with 'multiply defined symbols'. One thing I noticed is the following fact: Definition in unwind-pe.h: static const unsigned char * read_sleb128 (const unsigned char *p, _Unwind_Sword *val) --- GCC 4.2.4 bootstrapped on Solaris/SPARC -bash-3.00$ nm unwind-dw2.o | grep read_sleb128 [9] | 1024| 84|FUNC |LOCL |0 |1 |read_sleb128 --- LLVM-gcc 4.2 on Solaris/SPARC with 64-bit long-double: -bash-3.00$ nm unwind-dw2.o | grep read_sleb128 [613] | 144| 0|FUNC |GLOB |0 |1 |read_sleb128 which means that LLVM generates this static function as global instead of local like the native GCC does. Any idea how this could be fixed? Regards, Juergen On 10/30/09 16:36, Anton Korobeynikov wrote: > Hello, Juergen > >> Ty->dump() prints "{double, double}" in the failing case (just before my >> introduced assert). > The answer is simple. The code in question contains extended IEEE FP > argument / return type (aka 'long double'). By default it's lowered > into struct {double, double} as you already saw and sparc currently > does not provide any argument layout hooks. > > There are two possible solutions for a moment: > 1. Temporary turn 128-bit fp into 64-bit fp (there should be some > define in config/sparc/*) > 2. Turn 128bit fp into normal first-class type (grep for TARGET_ZARCH > into llvm-types.cpp, where this mapping is done for s390x), but then > you will need to implement all codegen for 128-bit fp, since sparc > backend is currently really weak. > -- Sun Microsystems GmbH Juergen Zimmermann Altrottstrasse 31 ISV Engineering EMEA, Technical Lead for SAP 69190 Walldorf Phone: +49 (0)6227 356 256 Germany Fax: +49 (0)6227 356 222 mailto:Juergen.Zimmermann at Sun.COM Sun Microsystems GmbH Altrottstrasse 31, 69190 Walldorf Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten Amtsgericht Muenchen: HRB 161028 Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel Vorsitzender des Aufsichtsrates: Martin Haering From anton at korobeynikov.info Mon Nov 2 07:09:27 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 2 Nov 2009 16:09:27 +0300 Subject: [LLVMdev] llvm-gcc-4.2 RELEASE_26 bootstrap failure on Solaris/SPARC - unhandled REAL_TYPE during compilation of '__powitf2' In-Reply-To: <4AEED7D4.7060504@Sun.COM> References: <4AEAE189.6000900@Sun.COM> <4AEB05F0.3080506@Sun.COM> <4AEED7D4.7060504@Sun.COM> Message-ID: Hello, Juergen > which means that LLVM generates this static function as global instead > of local like the native GCC does. > Any idea how this could be fixed? sparc asmprinter is old and was not maintained for years. Recently there was some huge asmprinter infrastructure refactoring in the LLVM. This might be just fallout from it. Or, the asmprinting is just incomplete. You might want to look there and, if possible, fix it (the best way will be migration to MCInst). -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From kuba at gcc.gnu.org Mon Nov 2 13:39:46 2009 From: kuba at gcc.gnu.org (Jakub Staszak) Date: Mon, 2 Nov 2009 16:39:46 -0300 Subject: [LLVMdev] PR3707 In-Reply-To: References: Message-ID: <7F051257-06AA-4FAF-8F43-8302FA25F580@gcc.gnu.org> On Oct 12, 2009, at 2:27 AM, Chris Lattner wrote: > On Oct 10, 2009, at 7:48 AM, Jakub Staszak wrote: > >> This patch fixes pr3707. > > Can you explain a little more what this does? What is the intuition > behind disabling this optimization? Oh, this patch is crap :( Sorry for this. The problem is that we lack of optimization for case like: loopto: %timeout.0 = phi i32 [ 2000, %loopto ], [ %timeout.0.ph, %loopto.outer ] Then something like "%reg = MOV 2000" is inserted into loopto block and executed every time. I haven't found any optimization which can handle this and move instruction into some outer block. -- Jakub Staszak From kuba at gcc.gnu.org Mon Nov 2 13:40:24 2009 From: kuba at gcc.gnu.org (Jakub Staszak) Date: Mon, 2 Nov 2009 16:40:24 -0300 Subject: [LLVMdev] Non-local DSE optimization In-Reply-To: References: <830819AC-2A14-435D-86FE-CB09F73F31F6@gcc.gnu.org> <4A9F86F4.3070609@free.fr> <273A970E-E76D-4BC0-8EF0-64E9C391DA6F@gcc.gnu.org> <4AA36E3C.7070507@mxc.ca> Message-ID: Hello, I would like to remain my non-local dse patch. I made some small fixes for latest trunk. Can anyone look at this? -- Jakub Staszak -------------- next part -------------- A non-text attachment was scrubbed... Name: dse_ssu-3.patch Type: application/octet-stream Size: 17741 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091102/190f29aa/attachment.obj From dag at cray.com Mon Nov 2 13:48:17 2009 From: dag at cray.com (David Greene) Date: Mon, 2 Nov 2009 14:48:17 -0500 Subject: [LLVMdev] Moving AVX Upstream Message-ID: <200911021348.17474.dag@cray.com> Hey everyone, I'm at the point with our local AVX tree that I'm ready to move some stuff upstream. We've got most of the basic stuff implemented. The more esoteric stuff still has to be done. Because the more esoteric stuff might require some extensive changes to the existing AVX infrastructure, I suspect there might be quite a bit of church until we get things stabilized. Due to that, I'm proposing we create an "avx" branch so I can push changes upstream, get feedback, etc. without disturbing everyone else too much. I would make changes incrementally, substituting an AVX definition of existing SSE instructions and removing them from X86InstrSSE.td at the same time. That way we'll know when I've broken something. Then when it's ready we can move the whole bunch over at once. Does this sound reasonable, or do people prefer I merge to trunk? Merging to trunk will expose changes to more testing but could also cause a lot of pain for people. These are really EXTENSIVE changes to the x86 .td files and there could be more extensive changes in the future as I write some of the more complicated patterns. If a branch is preferable, can we get that created? Will commits to the branch go to the -commits list? It would be even better if -commits subject lines could be tagged with "[avx]" or something. What was the precedure for the use-diet branch? -Dave From lattner at apple.com Mon Nov 2 13:55:00 2009 From: lattner at apple.com (Tanya Lattner) Date: Mon, 2 Nov 2009 11:55:00 -0800 Subject: [LLVMdev] Moving AVX Upstream In-Reply-To: <200911021348.17474.dag@cray.com> References: <200911021348.17474.dag@cray.com> Message-ID: <49D0EC43-3C47-4322-A6C6-5F02CFC6DC2B@apple.com> On Nov 2, 2009, at 11:48 AM, David Greene wrote: > Hey everyone, > > I'm at the point with our local AVX tree that I'm ready to move some > stuff upstream. We've got most of the basic stuff implemented. The > more esoteric stuff still has to be done. > > Because the more esoteric stuff might require some extensive changes > to > the existing AVX infrastructure, I suspect there might be quite a bit > of church until we get things stabilized. > > Due to that, I'm proposing we create an "avx" branch so I can push > changes > upstream, get feedback, etc. without disturbing everyone else too > much. > I would make changes incrementally, substituting an AVX definition of > existing SSE instructions and removing them from X86InstrSSE.td at the > same time. That way we'll know when I've broken something. > > Then when it's ready we can move the whole bunch over at once. > > Does this sound reasonable, or do people prefer I merge to trunk? > Merging > to trunk will expose changes to more testing but could also cause a > lot of > pain for people. These are really EXTENSIVE changes to the x86 .td > files > and there could be more extensive changes in the future as I write > some of > the more complicated patterns. > You should do incremental development on trunk. If you create a branch, no one is going to look at those changes. > If a branch is preferable, can we get that created? Will commits to > the > branch go to the -commits list? It would be even better if -commits > subject lines could be tagged with "[avx]" or something. What was the > precedure for the use-diet branch? > Nope, it won't go to llvm-commits, it goes to a separate branch mailing list. -Tanya From dag at cray.com Mon Nov 2 14:51:41 2009 From: dag at cray.com (David Greene) Date: Mon, 2 Nov 2009 15:51:41 -0500 Subject: [LLVMdev] Moving AVX Upstream In-Reply-To: <49D0EC43-3C47-4322-A6C6-5F02CFC6DC2B@apple.com> References: <200911021348.17474.dag@cray.com> <49D0EC43-3C47-4322-A6C6-5F02CFC6DC2B@apple.com> Message-ID: <200911021451.41547.dag@cray.com> On Monday 02 November 2009 13:55, Tanya Lattner wrote: > You should do incremental development on trunk. If you create a > branch, no one is going to look at those changes. Ok. but I want to be very clear what that means. It means for each AVX instruction I rip out ALL of the existing SSE support for it. So when ADD gets implemented, ADD goes away from X86InstSSE.td. As things progress, we're almost certainly going to have to refactor or otherwise change things we've done in the past. That means extensive .td changes and some very large commits. If everyone's ok with this kind of churn on trunk, that's what I'll do. But SVN branches exist exactly for these kinds of disruptive changes. We used one for the use-diet so there's precedent. -Dave From clattner at apple.com Mon Nov 2 15:37:01 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 2 Nov 2009 13:37:01 -0800 Subject: [LLVMdev] Moving AVX Upstream In-Reply-To: <200911021451.41547.dag@cray.com> References: <200911021348.17474.dag@cray.com> <49D0EC43-3C47-4322-A6C6-5F02CFC6DC2B@apple.com> <200911021451.41547.dag@cray.com> Message-ID: <76BB2A37-5E97-417D-9409-C15499B12BC8@apple.com> On Nov 2, 2009, at 12:51 PM, David Greene wrote: > On Monday 02 November 2009 13:55, Tanya Lattner wrote: >> You should do incremental development on trunk. If you create a >> branch, no one is going to look at those changes. > > Ok. but I want to be very clear what that means. It means for each > AVX > instruction I rip out ALL of the existing SSE support for it. So when > ADD gets implemented, ADD goes away from X86InstSSE.td. > > As things progress, we're almost certainly going to have to refactor > or > otherwise change things we've done in the past. That means extensive > .td changes and some very large commits. Yep, that's the right thing to do. Just make sure that each patch is monotonic progress over the last one (doesn't introduce any known failures or bugs). Thanks David, -Chris From dag at cray.com Mon Nov 2 16:18:08 2009 From: dag at cray.com (David Greene) Date: Mon, 2 Nov 2009 17:18:08 -0500 Subject: [LLVMdev] Moving AVX Upstream In-Reply-To: <76BB2A37-5E97-417D-9409-C15499B12BC8@apple.com> References: <200911021348.17474.dag@cray.com> <200911021451.41547.dag@cray.com> <76BB2A37-5E97-417D-9409-C15499B12BC8@apple.com> Message-ID: <200911021618.08307.dag@cray.com> On Monday 02 November 2009 15:37, Chris Lattner wrote: > Yep, that's the right thing to do. Just make sure that each patch is > monotonic progress over the last one (doesn't introduce any known > failures or bugs). Thanks David, Ok. Cray is moving to St. Paul this week (yay!) so I'm not going to send anything until we're settled in next week. That way I'll see the feedback semi-immediately. -Dave From atomicdog.jwm at gmail.com Mon Nov 2 16:19:22 2009 From: atomicdog.jwm at gmail.com (John Myers) Date: Mon, 2 Nov 2009 14:19:22 -0800 Subject: [LLVMdev] llvm-mc build fails In-Reply-To: References: <91226b40911012257o5535f413o3094bb2cef34310b@mail.gmail.com> Message-ID: <91226b40911021419o7bae8858wcf8e7898bc1fab72@mail.gmail.com> Thanks Anton, that was the problem. I didn't know there was target specific dependencies in the CMake directory. --John On Sun, Nov 1, 2009 at 11:31 PM, Anton Korobeynikov wrote: > Hello, John > > > There is an undefined reference at line 48 which is the line FrameInfo() > is > > on. I've tried to use the MSP430 and other targets as references so I'm > not > > sure > > what changes I did would cause a problem on this line? > It doesn't seem you're linking libTarget in. Have you tried not to use > cmake-generated makefiles? As for the cmake - it tracked the explicit > list of dependencies somewhere, you might want to update it as well > (and different target-specific places in CMakeList.txt files). > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091102/be6cdcee/attachment.html From mclachlan at apple.com Mon Nov 2 17:30:31 2009 From: mclachlan at apple.com (Jon McLachlan) Date: Mon, 2 Nov 2009 15:30:31 -0800 Subject: [LLVMdev] array index type shuffling in GEPs Message-ID: <6598F919-1416-484C-8D29-6A8298C26CB2@apple.com> Hey folks, I am hoping that someone might be able to help me better understand this design decision: For a 64 bit target, index's into GEP's of arrays are zext up to 64 bit integers, even if the variable itself is an alloca of only i32. Similarly, on a 32 bit target, index's into GEP's are trunc'd down to 32 bits even if they ultimately reference an alloc'd variable of type i64. My guess is that in the latter, there is a 2^32 limit on the number of elements in an array for 32 bit systems. This doesn't make sense for the former, though, since we're casting up to 64 bits from the smaller 32. So, does anyone have any insight, comments, or thoughts on why we're zext up to 64 bit representation? Take Care, ~Jon From atomicdog.jwm at gmail.com Mon Nov 2 21:04:06 2009 From: atomicdog.jwm at gmail.com (John Myers) Date: Mon, 2 Nov 2009 19:04:06 -0800 Subject: [LLVMdev] llvm-mc build fails In-Reply-To: <87639t9q6k.fsf@telefonica.net> References: <91226b40911012257o5535f413o3094bb2cef34310b@mail.gmail.com> <87639t9q6k.fsf@telefonica.net> Message-ID: <91226b40911021904y16a223b8yc3914906f67eb13f@mail.gmail.com> Hi ?scar, Thanks for the explanation. I was able to use the automatic update method. FYI, for some reason the first run build completed without failure. --John On Mon, Nov 2, 2009 at 2:28 AM, ?scar Fuentes wrote: > The following message is a courtesy copy of an article > that has been posted to gmane.comp.compilers.llvm.devel as well. > > John Myers writes: > > > I'm looking for some pointers on how to troubleshoot this problem. I'm > > trying to write a backend for the AVR. > > There is an undefined reference at line 48 which is the line FrameInfo() > is > > on. I've tried to use the MSP430 and other targets as references so I'm > not > > sure > > what changes I did would cause a problem on this line? > > cmake tracks library dependencies on > $LLVM_ROOT/cmake/modules/LLVMLibDeps.txt > > That file is automatically updated on Unix and Unix-like platforms when > all LLVM targets are included on the build. This means that either you > update the file manually or run the build with MSYS passing > -DLLVM_TARGETS_TO_BUILD=all on the cmake command line. > > The manual update would consist on adding this lines to the above > mentioned file: > > set(MSVC_LIB_DEPS_LLVMAVRAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore > LLVMMC LLVMAVRInfo LLVMSupport LLVMSystem LLVMTarget) > set(MSVC_LIB_DEPS_LLVMAVRCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMAVRInfo > LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) > set(MSVC_LIB_DEPS_LLVMAVRInfo LLVMSupport) > > which uses MSP430 as a template and supposses that your target is named > `AVR' (case sensitive). > > In case you use the automatic update, the first run of the build will > fail because the new dependencies are still not effective. Re-execute > the build and it should work. > > -- > ?scar > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091102/a3e8201f/attachment.html From gohman at apple.com Mon Nov 2 21:17:21 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 2 Nov 2009 19:17:21 -0800 Subject: [LLVMdev] array index type shuffling in GEPs In-Reply-To: <6598F919-1416-484C-8D29-6A8298C26CB2@apple.com> References: <6598F919-1416-484C-8D29-6A8298C26CB2@apple.com> Message-ID: On Nov 2, 2009, at 3:30 PM, Jon McLachlan wrote: > Hey folks, > > I am hoping that someone might be able to help me better understand > this design decision: For a 64 bit target, index's into GEP's of > arrays are zext up to 64 bit integers, even if the variable itself is > an alloca of only i32. Similarly, on a 32 bit target, index's into > GEP's are trunc'd down to 32 bits even if they ultimately reference an > alloc'd variable of type i64. > > My guess is that in the latter, there is a 2^32 limit on the number > of elements in an array for 32 bit systems. This doesn't make sense > for the former, though, since we're casting up to 64 bits from the > smaller 32. So, does anyone have any insight, comments, or thoughts > on why we're zext up to 64 bit representation? GEP uses sext, not zext (though a sext can be replaced by a zext in some cases by a crafty optimizer). GEP indices are normalized to be pointer-sized integers. This is done to aid optimization, as GEPs are ultimately lowered to pointer-sized integer arithmetic on most targets, and exposing the casts to the optimizer earlier rather than later gives it more flexibility to fold them or rearrange the surrounding code. Dan From gohman at apple.com Mon Nov 2 23:06:31 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 02 Nov 2009 21:06:31 -0800 Subject: [LLVMdev] Indirect goto Message-ID: <9D0B9783-C759-4423-8F84-9BC6F02C0DCC@apple.com> Hello, There's been a flurry of activity around indrect goto recently. For anyone interested, here's a document explaining the curent design: http://nondot.org/sabre/LLVMNotes/IndirectGoto.txt Dan From victor.zverovich at googlemail.com Tue Nov 3 05:09:45 2009 From: victor.zverovich at googlemail.com (Victor Zverovich) Date: Tue, 3 Nov 2009 11:09:45 +0000 Subject: [LLVMdev] DenseMap iterator constness fix Message-ID: Dear all, The first of the proposed patches (DenseMapIterator.patch) forbids implicit conversion of DenseMap::const_iterator to DenseMap::iterator which was possible because DenseMapIterator inherited (publicly) from DenseMapConstIterator. Conversion the other way around is now allowed as one may expect. The template DenseMapConstIterator is removed and the template parameter IsConst which specifies whether the iterator is constant is added to DenseMapIterator. Actually IsConst parameter is not necessary since the constness can be determined from KeyT but this is not relevant to the fix and can be addressed later. The second patch (DenseMapIterator-clang.patch) corrects clang's usage of DenseMap iterators. Best regards, Victor -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091103/51699ffd/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: DenseMapIterator.patch Type: application/octet-stream Size: 13667 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091103/51699ffd/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: DenseMapIterator-clang.patch Type: application/octet-stream Size: 3322 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091103/51699ffd/attachment-0001.obj From rich at pennware.com Tue Nov 3 07:48:03 2009 From: rich at pennware.com (Richard Pennington) Date: Tue, 03 Nov 2009 07:48:03 -0600 Subject: [LLVMdev] Debug info Message-ID: <4AF03493.30706@pennware.com> Hi, I'm trying to use the new debug info and I seem to have broken something. The attached LLVM assembly is the result of compiling a simple main() function. If I generate x86 assembly language from this I get the attached assembly file. The debug info seems complete, except that the .Lfunc_begin symbol is referenced but not defined in the .s file. llvm-dis, llvm-as, and llc seem perfectly happy with this, but the assembler complains about the undefined symbol. Any clues? -Rich -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: main.o.ll Url: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091103/0f149e71/attachment-0002.pl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: main.o.s Url: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091103/0f149e71/attachment-0003.pl From jyasskin at google.com Tue Nov 3 10:15:00 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Tue, 3 Nov 2009 08:15:00 -0800 Subject: [LLVMdev] DenseMap iterator constness fix In-Reply-To: References: Message-ID: +template +struct If { typedef True Result; }; + +template +struct If { typedef False Result; }; These should probably go into include/llvm/Support/type_traits.h. In C++0x, this is named "conditional" (section 20.6.7), so I think you should use the same name, despite the standard committee's bad taste. + DenseMapIterator(const DenseMapIterator& I) This looks like it will make it impossible to copy const_iterators. I guess it doesn't because the copy-constructor is auto-generated, but please comment that and add tests for it and for the non-const->const conversion to unittests/ADT/DenseMapTest.cpp. Otherwise, the patches just change iterator to const_iterator, which looks fine. On Tue, Nov 3, 2009 at 3:09 AM, Victor Zverovich wrote: > Dear all, > The first of the proposed patches (DenseMapIterator.patch) forbids implicit > conversion of DenseMap::const_iterator to DenseMap::iterator which was > possible because DenseMapIterator inherited (publicly) from > DenseMapConstIterator. Conversion the other way around is now allowed as one > may expect. > The template DenseMapConstIterator is?removed and the template > parameter?IsConst which specifies whether the iterator is constant is?added > to?DenseMapIterator. > Actually IsConst parameter is not necessary since the constness can be > determined from KeyT but this is not relevant to the fix and can be > addressed later. > The second patch (DenseMapIterator-clang.patch) corrects clang's usage of > DenseMap iterators. > Best regards, > Victor > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > From mclachlan at apple.com Tue Nov 3 10:57:15 2009 From: mclachlan at apple.com (Jon McLachlan) Date: Tue, 3 Nov 2009 08:57:15 -0800 Subject: [LLVMdev] array index type shuffling in GEPs In-Reply-To: References: <6598F919-1416-484C-8D29-6A8298C26CB2@apple.com> Message-ID: <46EC69F8-C3E2-475E-A00C-96726DD76C25@apple.com> Ahh, many thx for the insight - it makes perfect sense :) On Nov 2, 2009, at 7:17 PM, Dan Gohman wrote: > > On Nov 2, 2009, at 3:30 PM, Jon McLachlan wrote: > >> Hey folks, >> >> I am hoping that someone might be able to help me better understand >> this design decision: For a 64 bit target, index's into GEP's of >> arrays are zext up to 64 bit integers, even if the variable itself is >> an alloca of only i32. Similarly, on a 32 bit target, index's into >> GEP's are trunc'd down to 32 bits even if they ultimately reference >> an >> alloc'd variable of type i64. >> >> My guess is that in the latter, there is a 2^32 limit on the number >> of elements in an array for 32 bit systems. This doesn't make sense >> for the former, though, since we're casting up to 64 bits from the >> smaller 32. So, does anyone have any insight, comments, or thoughts >> on why we're zext up to 64 bit representation? > > GEP uses sext, not zext (though a sext can be replaced by a zext > in some cases by a crafty optimizer). > > GEP indices are normalized to be pointer-sized integers. This > is done to aid optimization, as GEPs are ultimately lowered to > pointer-sized integer arithmetic on most targets, and exposing > the casts to the optimizer earlier rather than later gives it more > flexibility to fold them or rearrange the surrounding code. > > Dan > From Matthieu.Moy at grenoble-inp.fr Tue Nov 3 12:15:07 2009 From: Matthieu.Moy at grenoble-inp.fr (Matthieu Moy) Date: Tue, 03 Nov 2009 19:15:07 +0100 Subject: [LLVMdev] Broken link on http://llvm.org/docs/ReleaseNotes.html#brokengcc Message-ID: Hi, The link "Broken versions of GCC and other tools" on http://llvm.org/docs/ReleaseNotes.html points to #brokengcc, where it should point to http://llvm.org/docs/GettingStarted.html#brokengcc I guess. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ From j.prasanth.j at gmail.com Tue Nov 3 13:42:10 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Wed, 4 Nov 2009 01:12:10 +0530 Subject: [LLVMdev] Problem running lli on ARM Message-ID: Hi all, I am in the process of developing a installer utility for ARM target which can compile any source files to ARM native executable. This installer utility should be present on target itself (whether this is feasible or not?). For achieving this i compiled llvm with clang for target. I copied the binaries to target and when it tried to compile a sample c code i am getting the following error. *# ../bin/clang hello.c clang: warning: not using the clang compiler for the 'arm' architecture clang: error: unable to make temporary file: /tmp/cc: can't make unique filename: No such file or directory clang: error: unable to make temporary file: /tmp/cc: can't make unique filename: No such file or directory # * my target device doesnot hav /tmp and it doesnot have write permission for creating any directory on root "/". is there anyway to tell clang to create temporary files in some other location other than "/tmp" ? can anyone help me in resolving this issue? pls let me know in case if any more information is required. i also tried the following method. in this method i created the llvm bitcode in my host x86 machine and then copied it to target and from target if i try to run the bitcode using lli tool i am getting the following error. * * *# ../../llvm-2.6-arm/bin/lli nestedloop.bc lli: /home/prasanth/LLVM_ARM/llvm-**target/llvm-2.6/include/llvm/**ADT/ilist.h:197: typename bidirectional_iterator::reference llvm::ilist_iterator::**operator*() const [with NodeTy = llvm::RecyclerStruct]: Assertion `Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"' failed. 0 lli 0x007702b4 Stack dump: 0. Program arguments: ../../llvm-2.6-arm/bin/lli nestedloop.bc 1. Running pass 'ARM Instruction Selection' on function '@main' Aborted # * * *pls let me know how can i resolve these two issues. the target details are target arch : arm target cpu : arm1136jf-s Thanks and Regards, Prasanth J -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/20cc0cc2/attachment.html From nnmahaja at umail.iu.edu Tue Nov 3 15:29:44 2009 From: nnmahaja at umail.iu.edu (Nilesh Mahajan) Date: Tue, 3 Nov 2009 16:29:44 -0500 Subject: [LLVMdev] LLVM + FORTRAN 95 Message-ID: Hi all, I want to compile FORTRAN 95 code with LLVM. More specifically, I would like to get an AST dump of the program I compile, statically analyze the AST, make modifcations to the AST and then feed it back to LLVM. Do you have any hints as to how I should proceed about doing this. I noticed that clang has an ast-dump option but don't know whether it supports FORTRAN 95. I am a LLVM newbie and I am trying to install it on Linux. I followed the setup instructions carefully but I am still facing the following error when trying to compile a simple hello.c: llvm-gcc: error trying to exec 'cc1': execvp: No such file or directory Can anybody help me here? Also I am not sure if I should post these kind of questions to a different mailing list. Thanks, Nilesh. From dag at cray.com Tue Nov 3 15:46:51 2009 From: dag at cray.com (David Greene) Date: Tue, 3 Nov 2009 16:46:51 -0500 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: References: Message-ID: <200911031546.51655.dag@cray.com> On Tuesday 03 November 2009 15:29, Nilesh Mahajan wrote: > Hi all, > > I want to compile FORTRAN 95 code with LLVM. More specifically, I > would like to get an AST dump of the program I compile, statically > analyze the AST, make modifcations to the AST and then feed it back to > LLVM. Do you have any hints as to how I should proceed about doing > this. I noticed that clang has an ast-dump option but don't know > whether it supports FORTRAN 95. Your best bet is to use llvm-gfortran. I don't know what you mean by "AST." Do you really want an AST or something else (LLVM IR, something higher-level, etc.)? LLVM doesn't understand ASTs directly. Longer term, it sure would be nice to have flang. :) -Dave From clattner at apple.com Tue Nov 3 15:50:12 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 3 Nov 2009 13:50:12 -0800 Subject: [LLVMdev] Broken link on http://llvm.org/docs/ReleaseNotes.html#brokengcc In-Reply-To: References: Message-ID: <7D0ECA96-B0BB-4EFE-B5CA-544D201B414D@apple.com> fixed, thanks. On Nov 3, 2009, at 10:15 AM, Matthieu Moy wrote: > Hi, > > The link "Broken versions of GCC and other tools" on > http://llvm.org/docs/ReleaseNotes.html points to #brokengcc, where it > should point to http://llvm.org/docs/GettingStarted.html#brokengcc I > guess. > > -- > Matthieu Moy > http://www-verimag.imag.fr/~moy/ > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From rengolin at systemcall.org Tue Nov 3 16:11:07 2009 From: rengolin at systemcall.org (Renato Golin) Date: Tue, 3 Nov 2009 22:11:07 +0000 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: <200911031546.51655.dag@cray.com> References: <200911031546.51655.dag@cray.com> Message-ID: 2009/11/3 David Greene : > Your best bet is to use llvm-gfortran. ?I don't know what you mean by > "AST." ?Do you really want an AST or something else (LLVM IR, something > higher-level, etc.)? ?LLVM doesn't understand ASTs directly. Probably for high-level optimisations, or just to see if the parser is good, as I do in my compiler. But AST is language/compiler specific, I also recommend you to transform everything to LLVM IR and do your stuff there. The LLVM IR is more high level and extremely more expressive (types and everything) than GCC IR, so you probably get everything you want from there. > Longer term, it sure would be nice to have flang. ?:) That supports HPF!! Yeah! cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From nnmahaja at umail.iu.edu Tue Nov 3 17:24:57 2009 From: nnmahaja at umail.iu.edu (Nilesh Mahajan) Date: Tue, 3 Nov 2009 18:24:57 -0500 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: References: <200911031546.51655.dag@cray.com> Message-ID: Hi David/Renato, By AST I mean Abstract Syntax Tree. We are writing an optimization pass for some FORTRAN95 + MPI code that requires us to analyze the AST. We thought of 2 ways of doing this: 1. Compile the code using Clang/llvm-gfortran, get the textual AST dump (somehow), analyze the AST dump using Ruby, modify it and then feed back the modified AST to LLVM. 2. Do the analysis as an LLVM module. >From your comments, I get the feeling that 2nd option is the better option. Thanks for your responses! Nilesh. P.S. Does anybody have an idea about the 'llvm-gcc: error trying to exec 'cc1': execvp: No such file or directory' error? On Tue, Nov 3, 2009 at 5:11 PM, Renato Golin wrote: > 2009/11/3 David Greene : >> Your best bet is to use llvm-gfortran. ?I don't know what you mean by >> "AST." ?Do you really want an AST or something else (LLVM IR, something >> higher-level, etc.)? ?LLVM doesn't understand ASTs directly. > > Probably for high-level optimisations, or just to see if the parser is > good, as I do in my compiler. > > But AST is language/compiler specific, I also recommend you to > transform everything to LLVM IR and do your stuff there. The LLVM IR > is more high level and extremely more expressive (types and > everything) than GCC IR, so you probably get everything you want from > there. > > >> Longer term, it sure would be nice to have flang. ?:) > > That supports HPF!! Yeah! > > cheers, > --renato > > Reclaim your digital rights, eliminate DRM, learn more at > http://www.defectivebydesign.org/what_is_drm > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From dag at cray.com Tue Nov 3 17:47:50 2009 From: dag at cray.com (David Greene) Date: Tue, 3 Nov 2009 18:47:50 -0500 Subject: [LLVMdev] Pat<> & tlbgen Message-ID: <200911031747.51062.dag@cray.com> Can someone explain the magic behind the Pat<> construct and tblgen. >From X86InstrSSE.td: def : Pat<(v4f32 (vector_shuffle VR128:$src, (undef), MOVDDUP_shuffle_mask)), (MOVLHPSrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>; Where's the code in tblgen to emit the matching code for this? I'm trying to extend it so that Pat<> can be used as a general subclass for AVX: class Base : Pat ...; multiclass foo { def A : Base; def B : Base; } The idea is to let the user write ALL of the patterns for a mnemonic in one place: defm MOVLH : foo<(v4f32 (vector_shuffle VR128:$src, (undef), MOVDDUP_shuffle_mask)), (MOVLHPSrr VR128:$src, VR128:$src), some.other.params.for.generic.patterns>; Note that MOVLHPSrr would be something else. It's not valid here because it's not declared yet. I have other features for handling that. :) But I'm having trouble hacking tblgen to make this work. I'm not getting variable resolution to work correctly. I just want to know how Pat<> works right now. I can post a testcase later. -Dave From dag at cray.com Tue Nov 3 17:49:45 2009 From: dag at cray.com (David Greene) Date: Tue, 3 Nov 2009 18:49:45 -0500 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: References: Message-ID: <200911031749.45243.dag@cray.com> On Tuesday 03 November 2009 17:24, Nilesh Mahajan wrote: = > By AST I mean Abstract Syntax Tree. We are writing an optimization > pass for some FORTRAN95 + MPI code that requires us to analyze the > AST. We thought of 2 ways of doing this: > 1. Compile the code using Clang/llvm-gfortran, get the textual AST > dump (somehow), analyze the AST dump using Ruby, modify it and then > feed back the modified AST to LLVM. > 2. Do the analysis as an LLVM module. > From your comments, I get the feeling that 2nd option is the better option. It's the only option right now unless you want to hack the output of gfortran and somehow feed it back into gfortran. You REALLY don't want to try that. This is why we need flang. -Dave From rengolin at systemcall.org Tue Nov 3 18:01:31 2009 From: rengolin at systemcall.org (Renato Golin) Date: Wed, 4 Nov 2009 00:01:31 +0000 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: References: <200911031546.51655.dag@cray.com> Message-ID: 2009/11/3 Nilesh Mahajan : > 2. Do the analysis as an LLVM module. > From your comments, I get the feeling that 2nd option is the better option. And your analysis can be applied to other languages as well, maybe even C/C++ using MPI bindings? That'd be a great addition to LLVM! ;) cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From jon at ffconsultancy.com Tue Nov 3 18:39:21 2009 From: jon at ffconsultancy.com (Jon Harrop) Date: Wed, 4 Nov 2009 00:39:21 +0000 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: References: Message-ID: <200911040039.21117.jon@ffconsultancy.com> On Tuesday 03 November 2009 23:24:57 Nilesh Mahajan wrote: > Hi David/Renato, > > By AST I mean Abstract Syntax Tree. We are writing an optimization > pass for some FORTRAN95 + MPI code that requires us to analyze the > AST. We thought of 2 ways of doing this: > > 1. Compile the code using Clang/llvm-gfortran, get the textual AST > dump (somehow), analyze the AST dump using Ruby, modify it and then > feed back the modified AST to LLVM. > > 2. Do the analysis as an LLVM module. > > From your comments, I get the feeling that 2nd option is the better > option. I was doing something similar last year and tried writing my own Fortran lexer/parser and reusing some of the existing ones. I found it so hard that I ended up rewriting the 800kLOC of Fortran code in a more modern language by hand. Basically, the Fortran-related open source tools are so poorly written and unreliable that they are not worth using. AFAIK, the llvm-gfortran compiler is just an LLVM backend on GCC's Fortran front-end. GCC is awful so I would not recommend trying to get anything sensical out of it. One project I did have limited success with was g95-xml, which is a hacked version of GCC's g95 compiler that can output the nearest thing Fortran has to an AST as XML: http://g95-xml.sourceforge.net/ The "First attempts" version that I used was a Perl programmer's idea of a parse tree though. ;-) For example: The edges between nodes in the AST are represented by those hexadecimal values (!). IIRC, after a lot of effort writing OCaml code to decipher that "XML", I discovered that it did not, in fact, contain all of the information from the source code and could not be used to perform the automated transformation that I wanted. So my advice is certainly to compile your Fortran into LLVM IR because that is a far more sane and malleable format. -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e From zhu.heyu at gmail.com Wed Nov 4 02:01:50 2009 From: zhu.heyu at gmail.com (Heyu Zhu) Date: Wed, 4 Nov 2009 16:01:50 +0800 Subject: [LLVMdev] newbie qustion: how to generate machine code for target thumb? Message-ID: Hello everyone, I want to generate machine code for target thumb, so run with bit code test.bc llc -march thumb test.bc -filetype obj -o test.o It doesn't generate test.o but show a message: "target doesn't support generation of this file type!" What's wrong? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/f4a7cfde/attachment.html From victor.zverovich at googlemail.com Wed Nov 4 02:27:29 2009 From: victor.zverovich at googlemail.com (Victor Zverovich) Date: Wed, 4 Nov 2009 08:27:29 +0000 Subject: [LLVMdev] DenseMap iterator constness fix In-Reply-To: References: Message-ID: Hi Jeffrey, You are right that the generated copy constructor is used for const_iterator. I have added a comment clarifying this. Also I have added the tests you suggested and corrected the comparison operators. Please find attached the updated patches. Best regards, Victor 2009/11/3 Jeffrey Yasskin > +template > +struct If { typedef True Result; }; > + > +template > +struct If { typedef False Result; }; > > These should probably go into include/llvm/Support/type_traits.h. In > C++0x, this is named "conditional" (section 20.6.7), so I think you > should use the same name, despite the standard committee's bad taste. > > + DenseMapIterator(const DenseMapIterator + KeyInfoT, ValueInfoT, false>& I) > > This looks like it will make it impossible to copy const_iterators. I > guess it doesn't because the copy-constructor is auto-generated, but > please comment that and add tests for it and for the non-const->const > conversion to unittests/ADT/DenseMapTest.cpp. > > Otherwise, the patches just change iterator to const_iterator, which looks > fine. > > On Tue, Nov 3, 2009 at 3:09 AM, Victor Zverovich > wrote: > > Dear all, > > The first of the proposed patches (DenseMapIterator.patch) forbids > implicit > > conversion of DenseMap::const_iterator to DenseMap::iterator which was > > possible because DenseMapIterator inherited (publicly) from > > DenseMapConstIterator. Conversion the other way around is now allowed as > one > > may expect. > > The template DenseMapConstIterator is removed and the template > > parameter IsConst which specifies whether the iterator is constant > is added > > to DenseMapIterator. > > Actually IsConst parameter is not necessary since the constness can be > > determined from KeyT but this is not relevant to the fix and can be > > addressed later. > > The second patch (DenseMapIterator-clang.patch) corrects clang's usage of > > DenseMap iterators. > > Best regards, > > Victor > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/70d963e7/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: DenseMapIterator2.patch Type: text/x-patch Size: 15546 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/70d963e7/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: DenseMapIterator-clang2.patch Type: text/x-patch Size: 3292 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/70d963e7/attachment-0001.bin From jyasskin at google.com Wed Nov 4 02:55:07 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Wed, 4 Nov 2009 00:55:07 -0800 Subject: [LLVMdev] DenseMap iterator constness fix In-Reply-To: References: Message-ID: + // Otherwise this is a copy constructor for const_iterator. Do you mean "for iterator"? Otherwise, looks good to me. If you can commit this, please do. Otherwise, someone else should as I'm not going to be around tomorrow. On Wed, Nov 4, 2009 at 12:27 AM, Victor Zverovich wrote: > Hi Jeffrey, > You are right that the generated copy constructor is used for > const_iterator. I have added a comment clarifying this. Also I have added > the tests you suggested and corrected the comparison operators.?Please find > attached the updated patches. > Best regards, > Victor > 2009/11/3 Jeffrey Yasskin >> >> +template >> +struct If { typedef True Result; }; >> + >> +template >> +struct If { typedef False Result; }; >> >> These should probably go into include/llvm/Support/type_traits.h. In >> C++0x, this is named "conditional" (section 20.6.7), so I think you >> should use the same name, despite the standard committee's bad taste. >> >> + ?DenseMapIterator(const DenseMapIterator> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?KeyInfoT, ValueInfoT, false>& >> I) >> >> This looks like it will make it impossible to copy const_iterators. I >> guess it doesn't because the copy-constructor is auto-generated, but >> please comment that and add tests for it and for the non-const->const >> conversion to unittests/ADT/DenseMapTest.cpp. >> >> Otherwise, the patches just change iterator to const_iterator, which looks >> fine. >> >> On Tue, Nov 3, 2009 at 3:09 AM, Victor Zverovich >> wrote: >> > Dear all, >> > The first of the proposed patches (DenseMapIterator.patch) forbids >> > implicit >> > conversion of DenseMap::const_iterator to DenseMap::iterator which was >> > possible because DenseMapIterator inherited (publicly) from >> > DenseMapConstIterator. Conversion the other way around is now allowed as >> > one >> > may expect. >> > The template DenseMapConstIterator is?removed and the template >> > parameter?IsConst which specifies whether the iterator is constant >> > is?added >> > to?DenseMapIterator. >> > Actually IsConst parameter is not necessary since the constness can be >> > determined from KeyT but this is not relevant to the fix and can be >> > addressed later. >> > The second patch (DenseMapIterator-clang.patch) corrects clang's usage >> > of >> > DenseMap iterators. >> > Best regards, >> > Victor >> > _______________________________________________ >> > LLVM Developers mailing list >> > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > >> > > > From wendling at apple.com Wed Nov 4 02:59:15 2009 From: wendling at apple.com (Bill Wendling) Date: Wed, 4 Nov 2009 00:59:15 -0800 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: References: <200911031546.51655.dag@cray.com> Message-ID: <74EC19A8-474F-425C-95B4-EC299958B049@apple.com> On Nov 3, 2009, at 2:11 PM, Renato Golin wrote: >> Longer term, it sure would be nice to have flang. :) > > That supports HPF!! Yeah! > You realize that LLVM doesn't have data dependence analysis, so supporting HPF (with any Fortran front-end) won't be out-of-the-box. :-) -bw From wendling at apple.com Wed Nov 4 03:01:56 2009 From: wendling at apple.com (Bill Wendling) Date: Wed, 4 Nov 2009 01:01:56 -0800 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: References: <200911031546.51655.dag@cray.com> Message-ID: <5AF40068-C47E-4005-B439-D66E81B726FF@apple.com> On Nov 3, 2009, at 3:24 PM, Nilesh Mahajan wrote: > > P.S. Does anybody have an idea about the 'llvm-gcc: error trying to > exec 'cc1': execvp: No such file or directory' error? > The llvm-gcc executable is a driver-driver for the compiler. It "execs" the cc1 program. It's apparently not finding it. My first guess is that it's not in the place it expects it to be. On my system (Mac OS X), here's what I get from the `find' command: ./libexec/gcc/i386-apple-darwin10.0.0/4.2.1/cc1 ./libexec/gcc/i386-apple-darwin9.2.2/4.2.1/cc1 ./libexec/gcc/i386-apple-darwin9.4.0/4.2.1/cc1 ./libexec/gcc/i386-apple-darwin9.5.0/4.2.1/cc1 ./libexec/gcc/i386-apple-darwin9.6.0/4.2.1/cc1 ./libexec/gcc/x86_64-apple-darwin10.0.0/4.2.1/cc1 -bw From hans at hanshq.net Wed Nov 4 03:51:23 2009 From: hans at hanshq.net (Hans Wennborg) Date: Wed, 04 Nov 2009 10:51:23 +0100 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything Message-ID: <4AF14E9B.9060209@hanshq.net> This is the first patch I've sent to this project. Please be gentle :) LLVM fails to remove the dead load in the following code when running $./llvm-as -o - test.ll | ./opt -O3 -o - | ./llvm-dis -o - %t = type { i32 } declare void @foo(i8*) define void @f(%t* noalias nocapture %stuff ) { %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 %before = load i32* %p call void @foo(i8* null) %after = load i32* %p ; <--- This should be removed! %sum = add i32 %before, %after; store i32 %sum, i32* %p ret void } The reason is that it is unsure whether the null pointer which is passed in the call to @foo may alias with %t. Obviously, a null pointer doesn't alias with anything, because it's not legal to read or write through it (right?). The attached patch adds this check to BasicAliasAnalysis, and makes the dead load go away in my test. Does this seem reasonable, and is my patch doing it the right way? / Hans -------------- next part -------------- A non-text attachment was scrubbed... Name: patch.patch Type: text/x-patch Size: 766 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/8298ee32/attachment.bin From rengolin at systemcall.org Wed Nov 4 03:53:38 2009 From: rengolin at systemcall.org (Renato Golin) Date: Wed, 4 Nov 2009 09:53:38 +0000 Subject: [LLVMdev] LLVM + FORTRAN 95 In-Reply-To: <74EC19A8-474F-425C-95B4-EC299958B049@apple.com> References: <200911031546.51655.dag@cray.com> <74EC19A8-474F-425C-95B4-EC299958B049@apple.com> Message-ID: 2009/11/4 Bill Wendling : > You realize that LLVM doesn't have data dependence analysis, so supporting > HPF (with any Fortran front-end) won't be out-of-the-box. :-) I was just pushing a bit further, there might be someone listening that would like to do it... ;) But it is my opinion that any software written today that does not contemplate intrinsic parallelism (any type, but preferable most types) is a waste of time. The era of one processing unit per box was abandoned decades ago and yet, we seem to keep thinking serially, even when programming for multiple processors... Though, that's a long discussion for a completely different mailing list... ;) cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From baldrick at free.fr Wed Nov 4 04:19:47 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 04 Nov 2009 11:19:47 +0100 Subject: [LLVMdev] newbie qustion: how to generate machine code for target thumb? In-Reply-To: References: Message-ID: <4AF15543.1030103@free.fr> Hi Heyu Zhu, > I want to generate machine code for target thumb, so run > with bit code test.bc > > llc -march thumb test.bc -filetype obj -o test.o > > It doesn't generate test.o but show a message: > > "target doesn't support generation of this file type!" writing object code directly is not supported yet (though it is being worked on), so for the moment you should not use "-filetype obj". Without this option llc will generate assembler, which you will need to assemble using an appropriate assembler. Best wishes, Duncan. From victor.zverovich at googlemail.com Wed Nov 4 05:00:35 2009 From: victor.zverovich at googlemail.com (Victor Zverovich) Date: Wed, 4 Nov 2009 11:00:35 +0000 Subject: [LLVMdev] DenseMap iterator constness fix In-Reply-To: References: Message-ID: Good catch! I meant "for iterator" of course. Attached is a corrected patch together with an old patch for clang just to keep them together. Could someone commit these, please? Thanks, Victor 2009/11/4 Jeffrey Yasskin > + // Otherwise this is a copy constructor for const_iterator. > > Do you mean "for iterator"? > > Otherwise, looks good to me. If you can commit this, please do. > Otherwise, someone else should as I'm not going to be around tomorrow. > > On Wed, Nov 4, 2009 at 12:27 AM, Victor Zverovich > wrote: > > Hi Jeffrey, > > You are right that the generated copy constructor is used for > > const_iterator. I have added a comment clarifying this. Also I have added > > the tests you suggested and corrected the comparison operators. Please > find > > attached the updated patches. > > Best regards, > > Victor > > 2009/11/3 Jeffrey Yasskin > >> > >> +template > >> +struct If { typedef True Result; }; > >> + > >> +template > >> +struct If { typedef False Result; }; > >> > >> These should probably go into include/llvm/Support/type_traits.h. In > >> C++0x, this is named "conditional" (section 20.6.7), so I think you > >> should use the same name, despite the standard committee's bad taste. > >> > >> + DenseMapIterator(const DenseMapIterator >> + KeyInfoT, ValueInfoT, false>& > >> I) > >> > >> This looks like it will make it impossible to copy const_iterators. I > >> guess it doesn't because the copy-constructor is auto-generated, but > >> please comment that and add tests for it and for the non-const->const > >> conversion to unittests/ADT/DenseMapTest.cpp. > >> > >> Otherwise, the patches just change iterator to const_iterator, which > looks > >> fine. > >> > >> On Tue, Nov 3, 2009 at 3:09 AM, Victor Zverovich > >> wrote: > >> > Dear all, > >> > The first of the proposed patches (DenseMapIterator.patch) forbids > >> > implicit > >> > conversion of DenseMap::const_iterator to DenseMap::iterator which was > >> > possible because DenseMapIterator inherited (publicly) from > >> > DenseMapConstIterator. Conversion the other way around is now allowed > as > >> > one > >> > may expect. > >> > The template DenseMapConstIterator is removed and the template > >> > parameter IsConst which specifies whether the iterator is constant > >> > is added > >> > to DenseMapIterator. > >> > Actually IsConst parameter is not necessary since the constness can be > >> > determined from KeyT but this is not relevant to the fix and can be > >> > addressed later. > >> > The second patch (DenseMapIterator-clang.patch) corrects clang's usage > >> > of > >> > DenseMap iterators. > >> > Best regards, > >> > Victor > >> > _______________________________________________ > >> > LLVM Developers mailing list > >> > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >> > > >> > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/f08e98c7/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: DenseMapIterator2.patch Type: text/x-patch Size: 15540 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/f08e98c7/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: DenseMapIterator-clang2.patch Type: text/x-patch Size: 3292 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/f08e98c7/attachment-0001.bin From astifter-llvm at gmx.at Wed Nov 4 08:20:51 2009 From: astifter-llvm at gmx.at (Andreas Neustifter) Date: Wed, 04 Nov 2009 15:20:51 +0100 Subject: [LLVMdev] Determine branch coverage information In-Reply-To: <26141617.post@talk.nabble.com> References: <26141617.post@talk.nabble.com> Message-ID: <4AF18DC3.9090703@gmx.at> Hi Ahmed! Adventure wrote: > Hello everybody, I am a beginner in LLVM and need to know how to use > LLVM to instrument a C program and execute this instrumented program > with different test cases to determine the branch coverage information > for each test case. Any suggestion or help is more than welcomed. Thanks > in advance. Ahmed Raafat. (In the following instructions you have to insert your own values for the <...> stuff.) To instrument the C Program you have to compile it into a single bytecode file, I do this by translating each C file to bytecode $> llvm-gcc -emit-llvm -c -o .bc and then link them all together $> llvm-ld -stats -time-passes -link-as-library -disable-opt *.bc -o .1.bc This gives you an unoptimised bytecode file which is preferable in this case since it retains a somewhat 1:1 relation to your code so you can figure out the results afterwards. Now its time to instrument the code, I do this by running $> opt -stats -time-passes -insert-optimal-edge-profiling .1.bc -o .2.bc and add the profiling runtime support $> llvm-ld -stats -time-passes -link-as-library -disable-opt /lib/libprofile_rt.bca .2.bc -o .3.bc You can then create a native executable by $> llc .3.bc .s $> gcc -g .s -o When you run this executable (with your parameters) it creates a file called llvmprof.out which contains an edge profiling of your code. With $> llvm-prof -print-all-code .1.bc you can dump a bytecode file which is annotated with the recorded profiling information. If you do several runs of your executable all runs are combined in the single llvmprof.out and the results are accumulated and you can check if every codepath was executed during your tests. There is a tool in /utils/profile.pl which takes a single bytecode file and parameters and does all the work of instrumenting, running and executing llvm-prof in one go, but its a little outdated, I attached a newer version, but I guess its easier to write a script that does exactly the steps you need. YMMV. Andi -------------- next part -------------- A non-text attachment was scrubbed... Name: profile.pl Type: application/x-perl Size: 2862 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/ea0970e9/attachment.bin From hans at hanshq.net Wed Nov 4 08:33:19 2009 From: hans at hanshq.net (Hans Wennborg) Date: Wed, 04 Nov 2009 15:33:19 +0100 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData Message-ID: <4AF190AF.6070900@hanshq.net> The attached patch makes DeadStoreElimination able to remove stores in store-store dependencies when the operand types are equal, even if there is no TargetData available. / Hans -------------- next part -------------- A non-text attachment was scrubbed... Name: DeadStoreElimination.patch Type: text/x-patch Size: 812 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/2056b524/attachment.bin From hans at hanshq.net Wed Nov 4 08:43:18 2009 From: hans at hanshq.net (Hans Wennborg) Date: Wed, 04 Nov 2009 15:43:18 +0100 Subject: [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter Message-ID: <4AF19306.20803@hanshq.net> Here is another change I'd like to suggest to the BasicAliasAnalysis. LLVM fails to remove the dead store in the following code: %t = type { i32 } define void @f(%t* noalias nocapture %stuff ) { %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 store i32 1, i32* %p; <-- This store is dead %x = load i32* inttoptr (i32 12345 to i32*) store i32 %x, i32* %p ret void } when run through ./llvm-as -o - test2.ll | ./opt -O3 -o - | ./llvm-dis -o - The problem is that the alias analysis is unsure about whether %p and 12345 may alias. But since %p is derived from %stuff, which has the noalias attribute, and 12345 is a constant and therefore cannot be derived from %stuff, they cannot alias. I'm attaching a patch which implements this. Please comment on whether this is sane, and if my code is the right way of doing it. / Hans -------------- next part -------------- A non-text attachment was scrubbed... Name: BasicAliasAnalysis.patch Type: text/x-patch Size: 1151 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/33e67b8a/attachment.bin From dberlin at dberlin.org Wed Nov 4 09:19:29 2009 From: dberlin at dberlin.org (Daniel Berlin) Date: Wed, 4 Nov 2009 10:19:29 -0500 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything In-Reply-To: <4AF14E9B.9060209@hanshq.net> References: <4AF14E9B.9060209@hanshq.net> Message-ID: <4aca3dc20911040719sbf950fbp266ffa5a6488aecb@mail.gmail.com> On Wed, Nov 4, 2009 at 4:51 AM, Hans Wennborg wrote: > > > The reason is that it is unsure whether the null pointer which is passed in > the call to @foo may alias with %t. Obviously, a null pointer doesn't alias > with anything, because it's not legal to read or write through it (right?). I don't remember whether LLVM's language spec says anything different, but whether null may alias anything is generally platform dependent. On some platforms, null may actually point to things and be dereferenced legally. (This is often used to speculatively executive conditionals involving pointer-derefs) From hans at hanshq.net Wed Nov 4 09:21:34 2009 From: hans at hanshq.net (Hans Wennborg) Date: Wed, 04 Nov 2009 16:21:34 +0100 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData In-Reply-To: <4AF190AF.6070900@hanshq.net> References: <4AF190AF.6070900@hanshq.net> Message-ID: <4AF19BFE.4040509@hanshq.net> Re-posting with better-looking code. Hans Wennborg wrote: > The attached patch makes DeadStoreElimination able to remove stores in > store-store dependencies when the operand types are equal, even if there > is no TargetData available. > > / Hans > > > ------------------------------------------------------------------------ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- A non-text attachment was scrubbed... Name: DeadStoreElimination2.patch Type: text/x-patch Size: 1303 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/51fa87bf/attachment.bin From victor.zverovich at googlemail.com Wed Nov 4 09:32:48 2009 From: victor.zverovich at googlemail.com (Victor Zverovich) Date: Wed, 4 Nov 2009 15:32:48 +0000 Subject: [LLVMdev] just-in-time debugging of assertion failures with MSVC Message-ID: Dear all, I am writing a compiler backend using LLVM with MSVC and have noticed that in LLVM version 2.6 it is no longer possible to use Just-In-Time Debugger at the point of assertion failure. The call stack is printed instead and the debugger stops at some strange location with the call stack like the following: > msvcr80d.dll!_NMSG_WRITE(int rterrnum=5111881) Line 198 C msvcr80d.dll!_close_nolock(int fh=7209065) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=5111881) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=7209065) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=6619238) Line 93 + 0x67 bytes C libmmd.dll!0069006e() [Frames below may be incorrect and/or missing, no symbols loaded for libmmd.dll] msvcr80d.dll!_close_nolock(int fh=7209065) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=6619238) Line 93 + 0x67 bytes C libmmd.dll!0069006e() msvcr80d.dll!_close_nolock(int fh=7209065) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=6619238) Line 93 + 0x67 bytes C libmmd.dll!0069006e() msvcr80d.dll!_close_nolock(int fh=7209065) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=6619238) Line 93 + 0x67 bytes C libmmd.dll!0069006e() msvcr80d.dll!_close_nolock(int fh=5111881) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=5111881) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=5111881) Line 93 + 0x67 bytes C msvcr80d.dll!_close_nolock(int fh=5177412) Line 93 + 0x67 bytes C Is there a way to get the old behaviour of handling (or indeed "not handling") the assertion failures? Best regards, Victor -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091104/630a3a81/attachment.html From clattner at apple.com Wed Nov 4 10:32:40 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 4 Nov 2009 08:32:40 -0800 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData In-Reply-To: <4AF19BFE.4040509@hanshq.net> References: <4AF190AF.6070900@hanshq.net> <4AF19BFE.4040509@hanshq.net> Message-ID: <01BA49E3-4D06-4CDF-BEE5-E8CC8C91E99D@apple.com> On Nov 4, 2009, at 7:21 AM, Hans Wennborg wrote: > Re-posting with better-looking code. Thanks, do you have a testcase showing what this does? -Chris > > Hans Wennborg wrote: >> The attached patch makes DeadStoreElimination able to remove stores >> in store-store dependencies when the operand types are equal, even >> if there is no TargetData available. >> / Hans >> ------------------------------------------------------------------------ >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > Index: lib/Transforms/Scalar/DeadStoreElimination.cpp > =================================================================== > --- lib/Transforms/Scalar/DeadStoreElimination.cpp (revision 86023) > +++ lib/Transforms/Scalar/DeadStoreElimination.cpp (working copy) > @@ -117,10 +117,12 @@ > > // If this is a store-store dependence, then the previous store > is dead so > // long as this store is at least as big as it. > - if (StoreInst *DepStore = dyn_cast(InstDep.getInst())) > - if (TD && > - TD->getTypeStoreSize(DepStore->getOperand(0)->getType()) <= > - TD->getTypeStoreSize(SI->getOperand(0)->getType())) { > + if (StoreInst *DepStore = dyn_cast(InstDep.getInst > ())) { > + const Type *DepType = DepStore->getOperand(0)->getType(); > + const Type *SIType = SI->getOperand(0)->getType(); > + if (DepType == SIType || > + (TD && > + TD->getTypeStoreSize(DepType) <= TD->getTypeStoreSize > (SIType))) { > // Delete the store and now-dead instructions that feed it. > DeleteDeadInstruction(DepStore); > NumFastStores++; > @@ -133,6 +135,7 @@ > --BBI; > continue; > } > + } > > // If we're storing the same value back to a pointer that we just > // loaded from, then the store can be removed. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From clattner at apple.com Wed Nov 4 10:33:54 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 4 Nov 2009 08:33:54 -0800 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything In-Reply-To: <4aca3dc20911040719sbf950fbp266ffa5a6488aecb@mail.gmail.com> References: <4AF14E9B.9060209@hanshq.net> <4aca3dc20911040719sbf950fbp266ffa5a6488aecb@mail.gmail.com> Message-ID: <8C21C61F-E2F1-45FE-9710-6E290F6A750C@apple.com> On Nov 4, 2009, at 7:19 AM, Daniel Berlin wrote: > On Wed, Nov 4, 2009 at 4:51 AM, Hans Wennborg wrote: > >> >> >> The reason is that it is unsure whether the null pointer which is >> passed in >> the call to @foo may alias with %t. Obviously, a null pointer >> doesn't alias >> with anything, because it's not legal to read or write through it >> (right?). > > I don't remember whether LLVM's language spec says anything different, > but whether null may alias anything is generally platform dependent. > > On some platforms, null may actually point to things and be > dereferenced legally. > > (This is often used to speculatively executive conditionals involving > pointer-derefs) Our current policy is to disallow dereferences of the null pointer, unless they are in the non-default address space. -Chris From hans at hanshq.net Wed Nov 4 12:13:30 2009 From: hans at hanshq.net (Hans Wennborg) Date: Wed, 04 Nov 2009 19:13:30 +0100 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData In-Reply-To: <01BA49E3-4D06-4CDF-BEE5-E8CC8C91E99D@apple.com> References: <4AF190AF.6070900@hanshq.net> <4AF19BFE.4040509@hanshq.net> <01BA49E3-4D06-4CDF-BEE5-E8CC8C91E99D@apple.com> Message-ID: <4AF1C44A.1050801@hanshq.net> Sorry, I admit my e-mail was a bit unclear. Here is an example: declare void @foo() define void @f(i32* noalias %p) { store i32 1, i32* %p; <-- This is dead call void @foo() store i32 2, i32 *%p ret void } When run through ./llvm-as test.ll -o - | ./opt -O3 -S the dead store is not removed by the DSE pass. (The call to @foo is there to prevent InstCombine from folding the store instructions into one.) This is because DSE relies on TargetData to find out about pointer sizes. Apparently, there was some default value for this before, but when running with top of the tree today, it turned out that TD=NULL in the DSE code. We discussed this in the IRC channel, and someone pointed out that the more the pass can do without having info about the target, the better -- hence the patch. With the patch, DSE will at least see if the data types are equal, even though it doesn't have information about their sizes. This is enough for handling the example above, and probably many others as well. / Hans Chris Lattner wrote: > > On Nov 4, 2009, at 7:21 AM, Hans Wennborg wrote: > >> Re-posting with better-looking code. > > Thanks, do you have a testcase showing what this does? > > -Chris > >> >> Hans Wennborg wrote: >>> The attached patch makes DeadStoreElimination able to remove stores >>> in store-store dependencies when the operand types are equal, even if >>> there is no TargetData available. >>> / Hans >>> ------------------------------------------------------------------------ >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> Index: lib/Transforms/Scalar/DeadStoreElimination.cpp >> =================================================================== >> --- lib/Transforms/Scalar/DeadStoreElimination.cpp (revision 86023) >> +++ lib/Transforms/Scalar/DeadStoreElimination.cpp (working copy) >> @@ -117,10 +117,12 @@ >> >> // If this is a store-store dependence, then the previous store is >> dead so >> // long as this store is at least as big as it. >> - if (StoreInst *DepStore = dyn_cast(InstDep.getInst())) >> - if (TD && >> - TD->getTypeStoreSize(DepStore->getOperand(0)->getType()) <= >> - TD->getTypeStoreSize(SI->getOperand(0)->getType())) { >> + if (StoreInst *DepStore = dyn_cast(InstDep.getInst())) { >> + const Type *DepType = DepStore->getOperand(0)->getType(); >> + const Type *SIType = SI->getOperand(0)->getType(); >> + if (DepType == SIType || >> + (TD && >> + TD->getTypeStoreSize(DepType) <= >> TD->getTypeStoreSize(SIType))) { >> // Delete the store and now-dead instructions that feed it. >> DeleteDeadInstruction(DepStore); >> NumFastStores++; >> @@ -133,6 +135,7 @@ >> --BBI; >> continue; >> } >> + } >> >> // If we're storing the same value back to a pointer that we just >> // loaded from, then the store can be removed. >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From devang.patel at gmail.com Wed Nov 4 12:56:07 2009 From: devang.patel at gmail.com (Devang Patel) Date: Wed, 4 Nov 2009 10:56:07 -0800 Subject: [LLVMdev] Debug info In-Reply-To: <4AF03493.30706@pennware.com> References: <4AF03493.30706@pennware.com> Message-ID: <352a1fb20911041056r7d5b98cew5d91d738e8daf263@mail.gmail.com> Hi Richard, How do you produce this LLVM assembly? In newest form, llvm.dbg.func_start intrinsic is not used. - Devang On Tue, Nov 3, 2009 at 5:48 AM, Richard Pennington wrote: > Hi, > > I'm trying to use the new debug info and I seem to have broken something. > The attached LLVM assembly is the result of compiling a simple main() > function. If I generate x86 assembly language from this I get the attached > assembly file. > The debug info seems complete, except that the .Lfunc_begin symbol is > referenced but not defined in the .s file. > > llvm-dis, llvm-as, and llc seem perfectly happy with this, but the assembler > complains about the undefined symbol. Any clues? > > -Rich > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > -- - Devang From rich at pennware.com Wed Nov 4 13:03:27 2009 From: rich at pennware.com (Richard Pennington) Date: Wed, 04 Nov 2009 13:03:27 -0600 Subject: [LLVMdev] Debug info In-Reply-To: <352a1fb20911041056r7d5b98cew5d91d738e8daf263@mail.gmail.com> References: <4AF03493.30706@pennware.com> <352a1fb20911041056r7d5b98cew5d91d738e8daf263@mail.gmail.com> Message-ID: <4AF1CFFF.2020800@pennware.com> Devang Patel wrote: > Hi Richard, > > How do you produce this LLVM assembly? In newest form, > llvm.dbg.func_start intrinsic is not used. > - > Devang > Hi Devang, The assembly is disassembled from bitcode that I create. I must be using obsolete remnants of the API. I'm calling EmitFunctionStart(), EmitStopPoint(), etc. What should I be using? -Rich From rich at pennware.com Wed Nov 4 13:13:28 2009 From: rich at pennware.com (Richard Pennington) Date: Wed, 04 Nov 2009 13:13:28 -0600 Subject: [LLVMdev] Debug info In-Reply-To: <4AF1CFFF.2020800@pennware.com> References: <4AF03493.30706@pennware.com> <352a1fb20911041056r7d5b98cew5d91d738e8daf263@mail.gmail.com> <4AF1CFFF.2020800@pennware.com> Message-ID: <4AF1D258.6070101@pennware.com> Richard Pennington wrote: > Devang Patel wrote: >> Hi Richard, >> >> How do you produce this LLVM assembly? In newest form, >> llvm.dbg.func_start intrinsic is not used. >> - >> Devang >> > Hi Devang, > > The assembly is disassembled from bitcode that I create. > > I must be using obsolete remnants of the API. I'm calling > EmitFunctionStart(), EmitStopPoint(), etc. What should I be using? > > -Rich I realize my question makes no sense. I was using code borrowed from clang. I'll check out what clang is doing now. -Rich From kennethuil at gmail.com Wed Nov 4 13:36:03 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Wed, 4 Nov 2009 13:36:03 -0600 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData In-Reply-To: <4AF1C44A.1050801@hanshq.net> References: <4AF190AF.6070900@hanshq.net> <4AF19BFE.4040509@hanshq.net> <01BA49E3-4D06-4CDF-BEE5-E8CC8C91E99D@apple.com> <4AF1C44A.1050801@hanshq.net> Message-ID: <400d33ea0911041136j6cb8cd62l9e9e615f64eac46e@mail.gmail.com> On Wed, Nov 4, 2009 at 12:13 PM, Hans Wennborg wrote: > Sorry, I admit my e-mail was a bit unclear. > Here is an example: > > declare void @foo() > > define void @f(i32* noalias %p) { > ? ? ? ? store i32 1, i32* %p; <-- This is dead > ? ? ? ? call void @foo() > ? ? ? ? store i32 2, i32 *%p > ? ? ? ? ret void > } > > When run through ./llvm-as test.ll -o - | ./opt -O3 -S > the dead store is not removed by the DSE pass. > (The call to @foo is there to prevent InstCombine from folding the store > instructions into one.) > > This is because DSE relies on TargetData to find out about pointer > sizes. Apparently, there was some default value for this before, but > when running with top of the tree today, it turned out that TD=NULL in > the DSE code. Yes, there was a default value before - a single default value for all targets. On most targets, it was wrong, and led to the optimizer breaking code unless the module had the host's target data string packaged up inside of it. > > We discussed this in the IRC channel, and someone pointed out that the > more the pass can do without having info about the target, the better -- > ?hence the patch. My feeling exactly. > > With the patch, DSE will at least see if the data types are equal, even > though it doesn't have information about their sizes. This is enough for > handling the example above, and probably many others as well. Thanks. From regehr at cs.utah.edu Wed Nov 4 13:59:31 2009 From: regehr at cs.utah.edu (John Regehr) Date: Wed, 04 Nov 2009 11:59:31 -0800 Subject: [LLVMdev] idempotence Message-ID: <4AF1DD23.1010200@cs.utah.edu> The LLVM projects page says this: "We need some way to reason about errno. Consider a loop like this: for () x += sqrt(loopinvariant);" and: "The hard part of this project is figuring out how to describe errno in the optimizer" The important property here is the idempotence of sqrt(): it is potentially side-effecting, but that side effect is independent of the number of times it is called (with the same argument). Thus the solution to the errno problem seems to be an idempotence analysis pass, an idempotent function attribute, and a handful of passes (LICM, maybe more) that exploit this attribute. Putting on my volatile testing hat for a second, I feel compelled to mention that no function that potentially touches a volatile object is idempotent :). John Regehr From criswell at uiuc.edu Wed Nov 4 14:04:04 2009 From: criswell at uiuc.edu (John Criswell) Date: Wed, 4 Nov 2009 14:04:04 -0600 Subject: [LLVMdev] Debug Information for LLVM 2.6 and TOT Message-ID: <4AF1DE34.6020306@uiuc.edu> Dear All, 1) I recall reading somewhere that a few optimizations in LLVM 2.6 strip away debug information when such information interferes with optimization. Is this correct, and if so, does anyone know off-hand which optimizations do this? 2) I believe a new debug annotation design is being implemented in mainline LLVM for the 2.7 release. What is the current status of this work? Does it already yield more accurate debug information than LLVM 2.6? Thanks in advance for any answers. -- John T. From clattner at apple.com Wed Nov 4 17:13:23 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 4 Nov 2009 15:13:23 -0800 Subject: [LLVMdev] Pat<> & tlbgen In-Reply-To: <200911031747.51062.dag@cray.com> References: <200911031747.51062.dag@cray.com> Message-ID: <40046DD2-15BA-4C86-BD57-C327C2A273C1@apple.com> On Nov 3, 2009, at 3:47 PM, David Greene wrote: > Can someone explain the magic behind the Pat<> construct and tblgen. > >> From X86InstrSSE.td: > > def : Pat<(v4f32 (vector_shuffle VR128:$src, (undef), > MOVDDUP_shuffle_mask)), > (MOVLHPSrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>; > > Where's the code in tblgen to emit the matching code for this? I'm > trying to > extend it so that Pat<> can be used as a general subclass for AVX: Hi David, The secret here is that the 'pattern in instruction' syntax is just shorthand for a pat pattern, and tblgen internally converts all instructions into Pat pattern form. The only code to match patters handles the Pat syntax. > class Base : Pat ...; > > multiclass foo { > def A : Base; > def B : Base; > } I think this would just work if you end up with something like this: > multiclass foo { > def A : Pat; > def B : Pat; > } If the defs end up deriving from Pat, they should be automatically picked up by the existing code. -Chris From clattner at apple.com Wed Nov 4 17:21:20 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 4 Nov 2009 15:21:20 -0800 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData In-Reply-To: <4AF1C44A.1050801@hanshq.net> References: <4AF190AF.6070900@hanshq.net> <4AF19BFE.4040509@hanshq.net> <01BA49E3-4D06-4CDF-BEE5-E8CC8C91E99D@apple.com> <4AF1C44A.1050801@hanshq.net> Message-ID: <02E2DF32-F0F1-4CA5-92C7-5414D3DF3D2B@apple.com> On Nov 4, 2009, at 10:13 AM, Hans Wennborg wrote: > Sorry, I admit my e-mail was a bit unclear. > Here is an example: > > declare void @foo() > > define void @f(i32* noalias %p) { > store i32 1, i32* %p; <-- This is dead > call void @foo() > store i32 2, i32 *%p > ret void > } > > When run through ./llvm-as test.ll -o - | ./opt -O3 -S > the dead store is not removed by the DSE pass. > (The call to @foo is there to prevent InstCombine from folding the > store instructions into one.) > > This is because DSE relies on TargetData to find out about pointer > sizes. Apparently, there was some default value for this before, but > when running with top of the tree today, it turned out that TD=NULL > in the DSE code. > > We discussed this in the IRC channel, and someone pointed out that > the more the pass can do without having info about the target, the > better -- hence the patch. > > With the patch, DSE will at least see if the data types are equal, > even though it doesn't have information about their sizes. This is > enough for handling the example above, and probably many others as > well. Thanks, applied here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091102/090396.html I'd appreciate it if you could resend your other patches in patch format like this, attached to the email with the testcase using filecheck. This commit should be a good example. Thanks for helping improve this area! -Chris From devang.patel at gmail.com Wed Nov 4 17:40:52 2009 From: devang.patel at gmail.com (Devang Patel) Date: Wed, 4 Nov 2009 15:40:52 -0800 Subject: [LLVMdev] Debug info In-Reply-To: <4AF1CFFF.2020800@pennware.com> References: <4AF03493.30706@pennware.com> <352a1fb20911041056r7d5b98cew5d91d738e8daf263@mail.gmail.com> <4AF1CFFF.2020800@pennware.com> Message-ID: <352a1fb20911041540s382b4f63o627a9f369be5665b@mail.gmail.com> Hi Richard, On Wed, Nov 4, 2009 at 11:03 AM, Richard Pennington wrote: > Devang Patel wrote: >> Hi Richard, >> >> How do you produce this LLVM assembly? In newest form, >> llvm.dbg.func_start intrinsic is not used. >> - >> Devang >> > Hi Devang, > > The assembly is disassembled from bitcode that I create. > > I must be using obsolete remnants of the API. I'm calling > EmitFunctionStart(), EmitStopPoint(), etc. What should I be using? Instead of calling EmitFunctionStart(), you keep track of lexical scopes in a stack. And instead of calling EmitStopPoint(), you update current location info and attach updated location info with subsequent instructions. See CGDebugInfo::EmitStopPoint() and CGDebugInfo::EmitFunctionStart() in CGDebugInfo.cpp from clang. http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?view=markup Here, - ATTACH_DEBUG_INFO_TO_AN_INSN is now defined. - IRBuilder is used to build IR. IRBuilder now provides APIs to keep track of current location info to encode debugging information. So whenever new instruction is created, the IRBuilder automatically attach current location info with the new instruction. Eventually, I'll document this and remove support for llvm.dbg.stoppoint and related intrinsics' support. - Devang From devang.patel at gmail.com Wed Nov 4 17:45:14 2009 From: devang.patel at gmail.com (Devang Patel) Date: Wed, 4 Nov 2009 15:45:14 -0800 Subject: [LLVMdev] Debug Information for LLVM 2.6 and TOT In-Reply-To: <4AF1DE34.6020306@uiuc.edu> References: <4AF1DE34.6020306@uiuc.edu> Message-ID: <352a1fb20911041545x16bf6292i65f84a6c13ded82e@mail.gmail.com> Hi John, On Wed, Nov 4, 2009 at 12:04 PM, John Criswell wrote: > Dear All, > > 1) I recall reading somewhere that a few optimizations in LLVM 2.6 strip > away debug information when such information interferes with > optimization. ?Is this correct, Yes. > and if so, does anyone know off-hand > which optimizations do this? The optimizer does not emit any statistics here. You can search various transformation passes' code to see whether they are handling DbgInfoIntrinsics or not. Or may be I misunderstood your question ? > 2) I believe a new debug annotation design is being implemented in > mainline LLVM for the 2.7 release. ?What is the current status of this > work? ?Does it already yield more accurate debug information than LLVM 2.6? It is still a work in progress. However, now it yields better scoping information when clang FE is used to generate debug info. - Devang From gohman at apple.com Wed Nov 4 18:54:23 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 4 Nov 2009 16:54:23 -0800 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything In-Reply-To: <4AF14E9B.9060209@hanshq.net> References: <4AF14E9B.9060209@hanshq.net> Message-ID: Hello, On Nov 4, 2009, at 1:51 AM, Hans Wennborg wrote: > > > / Hans > Index: lib/Analysis/BasicAliasAnalysis.cpp > =================================================================== > --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) > +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) > @@ -633,6 +633,15 @@ > AliasAnalysis::AliasResult > BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, > const Value *V2, unsigned V2Size) { > + // Null pointers do not alias with anything > + if (const Constant *C = dyn_cast(V1)) > + if (C->isNullValue()) > + return NoAlias; > + > + if (const Constant *C = dyn_cast(V2)) > + if (C->isNullValue()) > + return NoAlias; > + As Chris mentioned, for consistency with what the rest of LLVM is doing, this should check whether the pointers are in the default address space (0). Also, this could be generalized by checking the results from getUnderlyingObject, since it's not valid to do arithmetic from null to reach an LLVM identified object either. Dan From gohman at apple.com Wed Nov 4 18:54:46 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 4 Nov 2009 16:54:46 -0800 Subject: [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter In-Reply-To: <4AF19306.20803@hanshq.net> References: <4AF19306.20803@hanshq.net> Message-ID: <4D39951A-5792-4BBC-9BEF-92540CE91349@apple.com> On Nov 4, 2009, at 6:43 AM, Hans Wennborg wrote: > Here is another change I'd like to suggest to the BasicAliasAnalysis. > > LLVM fails to remove the dead store in the following code: > > %t = type { i32 } > > define void @f(%t* noalias nocapture %stuff ) { > %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 > > store i32 1, i32* %p; <-- This store is dead > > %x = load i32* inttoptr (i32 12345 to i32*) > store i32 %x, i32* %p > ret void > } > > > when run through > ./llvm-as -o - test2.ll | ./opt -O3 -o - | ./llvm-dis -o - > > > The problem is that the alias analysis is unsure about whether %p and 12345 may alias. But since %p is derived from %stuff, which has the noalias attribute, and 12345 is a constant and therefore cannot be derived from %stuff, they cannot alias. This sounds right. And actually, it's not limited to noalias; isIdentifiedObject objects don't alias inttoptr-casted integer literals either. I have a few comments on the patch below. > > I'm attaching a patch which implements this. Please comment on whether this is sane, and if my code is the right way of doing it. > > > / Hans > Index: lib/Analysis/BasicAliasAnalysis.cpp > =================================================================== > --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) > +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) > @@ -643,6 +643,23 @@ > if (!isa(V1->getType()) || !isa(V2->getType())) > return NoAlias; // Scalars cannot alias each other > > + // Constant ptr cannot alias with a noalias attribute > + if (isa(V1) && isa(V2->getType())) { > + while (const GEPOperator *g = dyn_cast(V2)) > + V2 = g->getOperand(0); > + > + if (const Argument *A = dyn_cast(V2)) > + if (A->hasNoAliasAttr()) > + return NoAlias; > + } else if (isa(V2) && isa(V1->getType())) { > + while (const GEPOperator *g = dyn_cast(V1)) > + V1 = g->getOperand(0); > + > + if (const Argument *A = dyn_cast(V1)) > + if (A->hasNoAliasAttr()) > + return NoAlias; > + } The GEP logic here is effectively doing (a subset of) what getUnderlyingObject does. It would be better to move these checks below the getUnderlyingObject calls just below so that they can use the results from those calls instead. And instead of checking for a no-alias argument, this code could use isIdentifiedObject instead, following my comment above. Dan > // Figure out what objects these things are pointing to if we can. > const Value *O1 = V1->getUnderlyingObject(); > const Value *O2 = V2->getUnderlyingObject(); > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From zhu.heyu at gmail.com Wed Nov 4 19:07:57 2009 From: zhu.heyu at gmail.com (Heyu Zhu) Date: Thu, 5 Nov 2009 09:07:57 +0800 Subject: [LLVMdev] newbie qustion: how to generate machine code for target thumb? In-Reply-To: <4AF15543.1030103@free.fr> References: <4AF15543.1030103@free.fr> Message-ID: Hi Duncan, Is it to say llvm-2.5 has no assembler and linker for target thumb and llvm-2.5 can only generate assembler file for the time being? Thanks 2009/11/4, Duncan Sands : > > Hi Heyu Zhu, > > I want to generate machine code for target thumb, so run >> with bit code test.bc >> llc -march thumb test.bc -filetype obj -o test.o >> It doesn't generate test.o but show a message: >> "target doesn't support generation of this file type!" >> > > writing object code directly is not supported yet (though it is being > worked > on), so for the moment you should not use "-filetype obj". Without this > option > llc will generate assembler, which you will need to assemble using an > appropriate assembler. > > Best wishes, > > Duncan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091105/dc5e18f9/attachment.html From pratnali at umail.iu.edu Thu Nov 5 01:51:48 2009 From: pratnali at umail.iu.edu (Pushkar Ratnalikar) Date: Thu, 5 Nov 2009 02:51:48 -0500 Subject: [LLVMdev] Clang and AST Generation Message-ID: <4ebaab310911042351s7304b88fuc089030aa7bf8e37@mail.gmail.com> Hello, I am trying to use Clang to generate AST for C code in a different format. This format is specific to the term rewriting system that we use for source-to-source transformations. Studying the ast generated by Clang using the "-ast-print" option to the clang-cc, I see that the pre-processor expands the code(expected). Is there a way to get around and not print all the information all the information and also keep the AST as close to the source as possible( avoiding constant folding). Thanks, Pushkar -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091105/53ee97eb/attachment.html From baldrick at free.fr Thu Nov 5 02:01:41 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 05 Nov 2009 09:01:41 +0100 Subject: [LLVMdev] newbie qustion: how to generate machine code for target thumb? In-Reply-To: References: <4AF15543.1030103@free.fr> Message-ID: <4AF28665.5030009@free.fr> Hi Heyu Zhu, > Is it to say llvm-2.5 has no assembler and linker for target thumb and > llvm-2.5 can only generate assembler file for the time being? that's right - you have to use the system assembler and linker. Best wishes, Duncan. From rjmccall at apple.com Thu Nov 5 02:22:14 2009 From: rjmccall at apple.com (John McCall) Date: Thu, 05 Nov 2009 00:22:14 -0800 Subject: [LLVMdev] Clang and AST Generation In-Reply-To: <4ebaab310911042351s7304b88fuc089030aa7bf8e37@mail.gmail.com> References: <4ebaab310911042351s7304b88fuc089030aa7bf8e37@mail.gmail.com> Message-ID: <4AF28B36.8060300@apple.com> Pushkar Ratnalikar wrote: > Hello, This is more appropriate for cfe-dev, not llvmdev. I'm forward this there; please follow-up only to that list. > I am trying to use Clang to generate AST for C code in a different > format. This format is specific to the term rewriting system that we > use for source-to-source transformations. > > Studying the ast generated by Clang using the "-ast-print" option to > the clang-cc, I see that the pre-processor expands the code(expected). > Is there a way to get around and not print all the information all the > information and also keep the AST as close to the source as possible( > avoiding constant folding). Could you clarify what you mean by not printing all the information? We have several different textual AST dumping mechanisms in various states of decay, but I didn't realize any of them did constant folding. John. From nicholas at mxc.ca Thu Nov 5 02:34:59 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 05 Nov 2009 00:34:59 -0800 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything In-Reply-To: References: <4AF14E9B.9060209@hanshq.net> Message-ID: <4AF28E33.8010700@mxc.ca> Dan Gohman wrote: > Hello, > > On Nov 4, 2009, at 1:51 AM, Hans Wennborg wrote: >> >> / Hans >> Index: lib/Analysis/BasicAliasAnalysis.cpp >> =================================================================== >> --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) >> +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) >> @@ -633,6 +633,15 @@ >> AliasAnalysis::AliasResult >> BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, >> const Value *V2, unsigned V2Size) { >> + // Null pointers do not alias with anything >> + if (const Constant *C = dyn_cast(V1)) >> + if (C->isNullValue()) >> + return NoAlias; >> + >> + if (const Constant *C = dyn_cast(V2)) >> + if (C->isNullValue()) >> + return NoAlias; >> + > > As Chris mentioned, for consistency with what the rest of LLVM is doing, > this should check whether the pointers are in the default address space > (0). > > Also, this could be generalized by checking the results from > getUnderlyingObject, since it's not valid to do arithmetic from null to > reach an LLVM identified object either. Also, you can just test for "isa(V1)" directly instead of casting to Constant then asking isNullValue (assuming the types of V1 and V2 are going to be PointerTy which I believe they always will be, without looking at the code). Nick From nicholas at mxc.ca Thu Nov 5 02:44:36 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 05 Nov 2009 00:44:36 -0800 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData In-Reply-To: <4AF1C44A.1050801@hanshq.net> References: <4AF190AF.6070900@hanshq.net> <4AF19BFE.4040509@hanshq.net> <01BA49E3-4D06-4CDF-BEE5-E8CC8C91E99D@apple.com> <4AF1C44A.1050801@hanshq.net> Message-ID: <4AF29074.8080107@mxc.ca> Hans Wennborg wrote: > Sorry, I admit my e-mail was a bit unclear. > Here is an example: > > declare void @foo() > > define void @f(i32* noalias %p) { > store i32 1, i32* %p; <-- This is dead > call void @foo() > store i32 2, i32 *%p > ret void > } Hold up. Is this correct? "noalias: This indicates that the pointer does not alias any global or any other parameter. The caller is responsible for ensuring that this is the case." - LangRef I've been interpreting this to mean that an arbitrary function may modify %p in this example, so long as it isn't *directly* held by a global or another argument. However, the global could contain a pointer to an object, indirectly pointing to %p. This would allow us to get more 'noalias' results from within @foo itself, but we not this optimization around it. I believe it's compatible with the definition of 'restrict' in C which noalias is modelled on. According to my interpretation, if the TD was the only issue blocking this transform then DSE was already buggy. Chris, could you please confirm your intention here? Nick From Arnaud.AllardDeGrandMaison at dibcom.com Thu Nov 5 02:41:33 2009 From: Arnaud.AllardDeGrandMaison at dibcom.com (Arnaud Allard de Grandmaison) Date: Thu, 5 Nov 2009 09:41:33 +0100 Subject: [LLVMdev] [cmake] : dotty handling Message-ID: <57C38DA176A0A34A9B9F3CCCE33D3C4A0104618D4689@FRPAR1CL009.coe.adi.dibcom.com> Hi, Here is a little patch to have cmake detect dotty, and if this was the case, update the HAVE_DOTTY and LLVM_PATH_DOTTY defines in include/llvm/Config/config.h. This should apply cleanly on TOT. Best regards, -- Arnaud de Grandmaison -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091105/edc399be/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: cmake-dotty.patch Type: application/octet-stream Size: 1260 bytes Desc: cmake-dotty.patch Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091105/edc399be/attachment.obj From oleg77 at gmail.com Thu Nov 5 04:30:49 2009 From: oleg77 at gmail.com (Oleg Knut) Date: Thu, 5 Nov 2009 12:30:49 +0200 Subject: [LLVMdev] create dummy function Message-ID: <278bcd900911050230m2fedefbcu1edc9739e0da0de6@mail.gmail.com> Hello, I have a simple question. How to create "dummy" function which will have no functionality behind (return nothing and do nothing)? Currently I'm trying to do this: llvm::Constant* c = Module.getOrInsertFunction("dummy", FunctionThatNeedsToBeReplaced.getFunctionType()); llvm::Function* dummy = llvm::cast(c); This way I create new function that do nothing.Then next step is: FunctionThatNeedsToBeReplaced.replaceAllUsesWith(dummy); This code is doing what I want to do, but it ends up with exception: ERROR: Program used external function 'dummy' which could not be resolved! I think I'm doing something wrong or there is a different way to create such functions. Thank you in advance, Oleg. From rengolin at systemcall.org Thu Nov 5 05:20:38 2009 From: rengolin at systemcall.org (Renato Golin) Date: Thu, 5 Nov 2009 11:20:38 +0000 Subject: [LLVMdev] create dummy function In-Reply-To: <278bcd900911050230m2fedefbcu1edc9739e0da0de6@mail.gmail.com> References: <278bcd900911050230m2fedefbcu1edc9739e0da0de6@mail.gmail.com> Message-ID: 2009/11/5 Oleg Knut : > Hello, > I have a simple question. How to create "dummy" function which will > have no functionality behind (return nothing and do nothing)? > Currently I'm trying to do this: > > llvm::Constant* c = Module.getOrInsertFunction("dummy", > FunctionThatNeedsToBeReplaced.getFunctionType()); > llvm::Function* dummy = llvm::cast(c); Hi Oleg, Every function needs a BasicBlock, even if the basic block just contains a return. The only reason to create a function without a basic block is when the function is extern'd and imported via JIT, but I guess it's not what you're attempting. Try this presentation and let me know if it's helpful: http://www.systemcall.org/rengolin/stuff/compiler/download/LLVM-pet-project.pdf cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From tianshuo_1 at 163.com Thu Nov 5 05:44:34 2009 From: tianshuo_1 at 163.com (tianshuo_1) Date: Thu, 5 Nov 2009 19:44:34 +0800 (CST) Subject: [LLVMdev] llvm-gcc-4.2-2.6 build failed, Message-ID: <26955286.540831257421474353.JavaMail.coremail@app179.163.com> I try to build llvm-gcc-4.2-2.6.source before build and install llvm-2.6, the configure is shown bellow ../llvm-gcc-4.2/configure --prefix=/home/ts/program/ --program-prefix=llvm- --enable-llvm=/home/ts/llvm/llvm-2.6 --enable-languages=c,c++ where, it is the path where llvm-2.6 source is stored, -enable-llvm=/home/ts/llvm/llvm-2.6 the "make" gave error message as bellow: ======================================================= In file included from ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:23: ../../llvm-gcc-4.2/gcc/llvm-internal.h:40:35: error: llvm/System/DataTypes.h: No such file or directory ../../llvm-gcc-4.2/gcc/llvm-internal.h:44:41: error: llvm/Support/raw_os_ostream.h: No such file or directory ../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ??void createPerFunctionOptimizationPasses()??: ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:671: error: ??Less?? is not a member of ??llvm::CodeGenOpt?? ../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ??void llvm_asm_file_end()??: ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:874: error: ??getInt8PtrTy?? is not a member of ??llvm::Type?? ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:893: error: ??getInt8PtrTy?? is not a member of ??llvm::Type?? ../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ??void AddAnnotateAttrsToGlobal(llvm::GlobalValue*, tree_node*)??: ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1171: error: ??getInt8PtrTy?? is not a member of ??llvm::Type?? ../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ??void make_decl_llvm(tree_node*)??: ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1635: error: ??const class llvm::Type?? has no member named ??isVoidTy?? make[3]: *** [llvm-backend.o] Error 1 make[3]: Leaving directory `/home/ts/llvm/llvm-gcc-4.2-obj/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory `/home/ts/llvm/llvm-gcc-4.2-obj' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/home/ts/llvm/llvm-gcc-4.2-obj' make: *** [all] Error 2 ============================================================ and , I found no file ,System/DataTypes.h, exist in the directory llvm-2.6/include/llvm/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091105/b0381b5d/attachment.html From anton at korobeynikov.info Thu Nov 5 06:19:36 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Thu, 5 Nov 2009 15:19:36 +0300 Subject: [LLVMdev] llvm-gcc-4.2-2.6 build failed, In-Reply-To: <26955286.540831257421474353.JavaMail.coremail@app179.163.com> References: <26955286.540831257421474353.JavaMail.coremail@app179.163.com> Message-ID: Hello > I try to build llvm-gcc-4.2-2.6.source before build and install llvm-2.6, > the configure is shown bellow > ../llvm-gcc-4.2/configure --prefix=/home/ts/program/ --program-prefix=llvm- > --enable-llvm=/home/ts/llvm/llvm-2.6 --enable-languages=c,c++ > where, it is the path where llvm-2.6 source is stored, > -enable-llvm=/home/ts/llvm/llvm-2.6 You need to build llvm itself first. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Thu Nov 5 06:48:50 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 05 Nov 2009 13:48:50 +0100 Subject: [LLVMdev] llvm-gcc-4.2-2.6 build failed, In-Reply-To: <26955286.540831257421474353.JavaMail.coremail@app179.163.com> References: <26955286.540831257421474353.JavaMail.coremail@app179.163.com> Message-ID: <4AF2C9B2.9010100@free.fr> tianshuo_1 wrote: > I try to build llvm-gcc-4.2-2.6.source before build and install > llvm-2.6, the configure is shown bellow You need to build llvm first. --enable-llvm (and not -enable-llvm) should point to the directory in which you built llvm (this may be the same as the llvm source directory if you built llvm in place). Best wishes, Duncan. From oleg77 at gmail.com Thu Nov 5 07:10:40 2009 From: oleg77 at gmail.com (Oleg Knut) Date: Thu, 5 Nov 2009 15:10:40 +0200 Subject: [LLVMdev] create dummy function In-Reply-To: References: <278bcd900911050230m2fedefbcu1edc9739e0da0de6@mail.gmail.com> Message-ID: <278bcd900911050510n4584500eh269d4728a4907cf3@mail.gmail.com> Thank you very much for you help, Renato! I read through paper you referred and also this document - http://llvm.org/docs/tutorial/JITTutorial1.html Following these instructions to create successful function I run into some problems: 1) llvm::getGlobalContext() does not exists anymore? "llvm/LLVMContext.h" too? 2) creating instance of IRBuilder don't require template (from tutorial paper - IRBuilder<> builder(block)) So, I believe this is just outdated information? I think it just need some quick attention with getting materials up to date. In the end I got following code, that satisfy my needs: llvm::Constant* c = M.getOrInsertFunction(dummyFunctionName, F.getFunctionType()); llvm::Function* dummy = llvm::cast(c); dummy->setLinkage(llvm::Function::ExternalLinkage); dummy->setCallingConv(llvm::CallingConv::C); llvm::BasicBlock* block = llvm::BasicBlock::Create("entry", dummy); // no context needed llvm::IRBuilder builder(block); // no need in <> builder.CreateRetVoid(); Cheers, Oleg. 2009/11/5 Renato Golin : > 2009/11/5 Oleg Knut : >> Hello, >> I have a simple question. How to create "dummy" function which will >> have no functionality behind (return nothing and do nothing)? >> Currently I'm trying to do this: >> >> llvm::Constant* c = Module.getOrInsertFunction("dummy", >> FunctionThatNeedsToBeReplaced.getFunctionType()); >> llvm::Function* dummy = llvm::cast(c); > > Hi Oleg, > > Every function needs a BasicBlock, even if the basic block just > contains a return. > > The only reason to create a function without a basic block is when the > function is extern'd and imported via JIT, but I guess it's not what > you're attempting. > > Try this presentation and let me know if it's helpful: > > http://www.systemcall.org/rengolin/stuff/compiler/download/LLVM-pet-project.pdf > > cheers, > --renato > > Reclaim your digital rights, eliminate DRM, learn more at > http://www.defectivebydesign.org/what_is_drm > From rengolin at systemcall.org Thu Nov 5 07:17:17 2009 From: rengolin at systemcall.org (Renato Golin) Date: Thu, 5 Nov 2009 13:17:17 +0000 Subject: [LLVMdev] create dummy function In-Reply-To: <278bcd900911050510n4584500eh269d4728a4907cf3@mail.gmail.com> References: <278bcd900911050230m2fedefbcu1edc9739e0da0de6@mail.gmail.com> <278bcd900911050510n4584500eh269d4728a4907cf3@mail.gmail.com> Message-ID: 2009/11/5 Oleg Knut : > So, I believe this is just outdated information? I think it just need > some quick attention with getting materials up to date. Yup, outdated information. If you see the same example on the svn tree (examples/Kaleidoscope) the code is right and up-to-date. > In the end I got following code, that satisfy my needs: Return void an a dummy basic block, all you needed. ;) Glad to help. cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From stephan.reiter at gmail.com Thu Nov 5 07:32:01 2009 From: stephan.reiter at gmail.com (Stephan) Date: Thu, 5 Nov 2009 05:32:01 -0800 (PST) Subject: [LLVMdev] Functions: sret and readnone In-Reply-To: <5612891e-3fbf-4ff9-96da-56abc7d44086@o36g2000vbl.googlegroups.com> References: <135ebb010910050721t68118e75na082443e41c01d53@mail.gmail.com> <7A62B2C6-4FF3-4BF6-80F7-57ABB25BE0BA@apple.com> <5612891e-3fbf-4ff9-96da-56abc7d44086@o36g2000vbl.googlegroups.com> Message-ID: <1f6a2bb9-d009-4aaa-9a3c-b51c193e4d36@r24g2000yqd.googlegroups.com> It's been a while and I finally had the time to look into this. What I did was to build a custom AliasAnalysis pass, as Chris suggested, that returns AliasAnalysis::Mod for values passed to the sample function in the sret spot, and NoModRef for all other values. I'm also returning AliasAnalysis::AccessesArguments in the pass' getModRefBehavior methods. However, I haven't been successful with this approach and hope that someone has an idea on how to fix this. Here's a step by step illustration of the problem: 1. The following source code is compiled ... intrinsic float4 sample(int tex, float2 tc); float4 main(int tex, float2 tc) { float4 x = sample(tex, tc); return 0.0; } 2. ... into the following LLVM code (after a bunch of optimizations have run): define void @"main$int$float2"([4 x float]* noalias nocapture sret, i32, [2 x float]) nounwind { %5 = alloca [4 x float], align 4 ; <[4 x float]*> [#uses=1] call void @"sample$int$float2"([4 x float]* %5, i32 %1, [2 x float] %2) store [4 x float] zeroinitializer, [4 x float]* %0 ret void } declare void @"sample$int$float2"([4 x float]* noalias nocapture sret, i32, [2 x float]) nounwind As you can see, the call to the sample function is still present, although the actual value it is supposed to return via its sret parameter is never used. Using the AAEvalPass I found out that the alias analysis pass I implemented seems to work alright (it reports mod for %5): ===== Alias Analysis Evaluator Report ===== 3 Total Alias Queries Performed 3 no alias responses (100.0%) 0 may alias responses (0.0%) 0 must alias responses (0.0%) Alias Analysis Evaluator Pointer Alias Summary: 100%/0%/0% 3 Total ModRef Queries Performed 2 no mod/ref responses (66.6%) 1 mod responses (33.3%) 0 ref responses (0.0%) 0 mod & ref responses (0.0%) Alias Analysis Evaluator Mod/Ref Summary: 66%/33%/0%/0% Yet, DCE, DSE and GVN fail to remove the function call. (I'm not so sure which optimization pass to use, so I picked these three as they seemed to make sense.) Any ideas? Help would be very much appreciated! Thank you, Stephan On 6 Okt., 08:00, Stephan wrote: > On 5 Okt., 23:33, Dan Gohman wrote: > > > > > Is there a reason it needs to be an array? A vector of four floats > > wouldn't have this problem, if that's an option. > > Unfortunately that's not an option. At the moment I'm restricting > myself to the use of scalar code only, in order to be able to > vectorize the code easily later (e.g., float4 as it is now will then > become an array of four vectors for parallel processing of n (probably > 4, SSE) pixels). But thanks for coming up with this idea! > > Chris, I'll take a look at the AliasAnalysis functionality. Depending > on how much effort it is to implement a solution I might follow this > approach. If not, there's still Kenneth's new code generator to look > forward to. :) > > Thanks, > Stephan > _______________________________________________ > LLVM Developers mailing list > LLVM... at cs.uiuc.edu ? ? ? ?http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From kavenchuk at gmail.com Thu Nov 5 07:39:02 2009 From: kavenchuk at gmail.com (Yaroslav Kavenchuk) Date: Thu, 05 Nov 2009 15:39:02 +0200 Subject: [LLVMdev] Strange error for libLLVMCore.a Message-ID: <4AF2D576.5050601@gmail.com> mingw, llvm 2.6 (buid with llvm-gcc) Example source code: http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html I change LLVMCreateJITCompiler(&engine, provider, &error); to LLVMCreateJITCompiler(&engine, provider, 3, &error); $ llvm-gcc `llvm-config --cflags` -c fac.c $ g++ `llvm-config --libs --cflags --ldflags core analysis executionengine jit interpreter native backend engine` fac.o -o fac fac.o: In function `main': c:\Work\llvm//fac.c:20: undefined reference to `LLVMModuleCreateWithName' c:\Work\llvm//fac.c:21: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:22: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:22: undefined reference to `LLVMFunctionType' c:\Work\llvm//fac.c:22: undefined reference to `LLVMAddFunction' c:\Work\llvm//fac.c:23: undefined reference to `LLVMSetFunctionCallConv' c:\Work\llvm//fac.c:24: undefined reference to `LLVMGetParam' c:\Work\llvm//fac.c:26: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:27: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:28: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:29: undefined reference to `LLVMAppendBasicBlock' c:\Work\llvm//fac.c:30: undefined reference to `LLVMCreateBuilder' c:\Work\llvm//fac.c:32: undefined reference to `LLVMPositionBuilderAtEnd' c:\Work\llvm//fac.c:33: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:33: undefined reference to `LLVMConstInt' c:\Work\llvm//fac.c:33: undefined reference to `LLVMBuildICmp' c:\Work\llvm//fac.c:34: undefined reference to `LLVMBuildCondBr' c:\Work\llvm//fac.c:36: undefined reference to `LLVMPositionBuilderAtEnd' c:\Work\llvm//fac.c:37: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:37: undefined reference to `LLVMConstInt' c:\Work\llvm//fac.c:38: undefined reference to `LLVMBuildBr' c:\Work\llvm//fac.c:40: undefined reference to `LLVMPositionBuilderAtEnd' c:\Work\llvm//fac.c:41: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:41: undefined reference to `LLVMConstInt' c:\Work\llvm//fac.c:41: undefined reference to `LLVMBuildSub' c:\Work\llvm//fac.c:43: undefined reference to `LLVMBuildCall' c:\Work\llvm//fac.c:44: undefined reference to `LLVMBuildMul' c:\Work\llvm//fac.c:45: undefined reference to `LLVMBuildBr' c:\Work\llvm//fac.c:47: undefined reference to `LLVMPositionBuilderAtEnd' c:\Work\llvm//fac.c:48: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:48: undefined reference to `LLVMBuildPhi' c:\Work\llvm//fac.c:51: undefined reference to `LLVMAddIncoming' c:\Work\llvm//fac.c:52: undefined reference to `LLVMBuildRet' c:\Work\llvm//fac.c:54: undefined reference to `LLVMVerifyModule' c:\Work\llvm//fac.c:55: undefined reference to `LLVMDisposeMessage' c:\Work\llvm//fac.c:59: undefined reference to `LLVMCreateModuleProviderForExistingModule' c:\Work\llvm//fac.c:61: undefined reference to `LLVMCreateJITCompiler' c:\Work\llvm//fac.c:64: undefined reference to `LLVMDisposeMessage' c:\Work\llvm//fac.c:68: undefined reference to `LLVMCreatePassManager' c:\Work\llvm//fac.c:69: undefined reference to `LLVMGetExecutionEngineTargetData' c:\Work\llvm//fac.c:69: undefined reference to `LLVMAddTargetData' c:\Work\llvm//fac.c:70: undefined reference to `LLVMAddConstantPropagationPass' c:\Work\llvm//fac.c:71: undefined reference to `LLVMAddInstructionCombiningPass' c:\Work\llvm//fac.c:72: undefined reference to `LLVMAddPromoteMemoryToRegisterPass' c:\Work\llvm//fac.c:74: undefined reference to `LLVMAddGVNPass' c:\Work\llvm//fac.c:75: undefined reference to `LLVMAddCFGSimplificationPass' c:\Work\llvm//fac.c:76: undefined reference to `LLVMRunPassManager' c:\Work\llvm//fac.c:77: undefined reference to `LLVMDumpModule' c:\Work\llvm//fac.c:79: undefined reference to `LLVMInt32Type' c:\Work\llvm//fac.c:79: undefined reference to `LLVMCreateGenericValueOfInt' c:\Work\llvm//fac.c:80: undefined reference to `LLVMRunFunction' c:\Work\llvm//fac.c:83: undefined reference to `LLVMGenericValueToInt' c:\Work\llvm//fac.c:85: undefined reference to `LLVMDisposePassManager' c:\Work\llvm//fac.c:86: undefined reference to `LLVMDisposeBuilder' c:\Work\llvm//fac.c:87: undefined reference to `LLVMDisposeExecutionEngine' collect2: ld returned 1 exit status $ llvm-config --libs --cflags --ldflags core analysis executionengine jit interpreter native backend engine -I/mingw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2 -fomit-frame-pointer -L/mingw/lib -lffi -lpsapi -limagehlp -lm -lLLVMX86AsmParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Info -lLLVMInterpreter -lLLVMJIT -lLLVMCodeGen -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMipa -lLLVMExecutionEngine -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport -lLLVMSystem What is wrong? All undefined names from libLLVMCore.a -- WBR, Yaroslav Kavenchuk From criswell at uiuc.edu Thu Nov 5 10:43:11 2009 From: criswell at uiuc.edu (John Criswell) Date: Thu, 5 Nov 2009 10:43:11 -0600 Subject: [LLVMdev] Debug Information for LLVM 2.6 and TOT In-Reply-To: <352a1fb20911041545x16bf6292i65f84a6c13ded82e@mail.gmail.com> References: <4AF1DE34.6020306@uiuc.edu> <352a1fb20911041545x16bf6292i65f84a6c13ded82e@mail.gmail.com> Message-ID: <4AF3009F.9050708@uiuc.edu> Devang Patel wrote: > Hi John, > > On Wed, Nov 4, 2009 at 12:04 PM, John Criswell wrote: > >> Dear All, >> >> 1) I recall reading somewhere that a few optimizations in LLVM 2.6 strip >> away debug information when such information interferes with >> optimization. Is this correct, >> > > Yes. > > >> and if so, does anyone know off-hand >> which optimizations do this? >> > > The optimizer does not emit any statistics here. You can search > various transformation passes' code to see whether they are handling > DbgInfoIntrinsics or not. Or may be I misunderstood your question ? > Thanks for the information. You've understood me correctly. I was just hoping that somebody could save me the trouble of looking at all the optimizations to see which ones zap debug information. >> 2) I believe a new debug annotation design is being implemented in >> mainline LLVM for the 2.7 release. What is the current status of this >> work? Does it already yield more accurate debug information than LLVM 2.6? >> > > It is still a work in progress. However, now it yields better scoping > information when clang FE is used to generate debug info. > Does the debug facilities in LLVM TOT, at present, maintain information better than LLVM 2.6 (i.e., if a front-end puts the debug information in, will the optimizations not take it out)? Does the information that the llvm-gcc front-end adds comparable to what llvm-gcc in LLVM 2.6 does? The problem that I'm having is that the SAFECode debug tool uses LLVM debug information to print out nice error messages saying, "Your buffer overflow is at line in source file ." Before transforms started removing debug information, my tool would print out source line/file info that was acceptably accurate. After the change, it started printing out horribly wrong information (e.g., giving the source and line number of some inlined function called by the function that actually generated the memory error). I'm not so concerned with debug information being more accurate (although I like that, too). I'm more concerned with how well existing debug information is retained during optimizations. -- John T. > - > Devang > From clattner at apple.com Thu Nov 5 11:48:10 2009 From: clattner at apple.com (Chris Lattner) Date: Thu, 5 Nov 2009 09:48:10 -0800 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData In-Reply-To: <4AF29074.8080107@mxc.ca> References: <4AF190AF.6070900@hanshq.net> <4AF19BFE.4040509@hanshq.net> <01BA49E3-4D06-4CDF-BEE5-E8CC8C91E99D@apple.com> <4AF1C44A.1050801@hanshq.net> <4AF29074.8080107@mxc.ca> Message-ID: <88E812A7-0A35-410F-9681-C2F570C1AEE2@apple.com> On Nov 5, 2009, at 12:44 AM, Nick Lewycky wrote: > > According to my interpretation, if the TD was the only issue > blocking this transform then DSE was already buggy. > > Chris, could you please confirm your intention here? I haven't thought about this, but this patch doesn't regress prior functionality it only makes it work when no TD is available. -Chris From devang.patel at gmail.com Thu Nov 5 12:12:49 2009 From: devang.patel at gmail.com (Devang Patel) Date: Thu, 5 Nov 2009 10:12:49 -0800 Subject: [LLVMdev] Debug Information for LLVM 2.6 and TOT In-Reply-To: <4AF3009F.9050708@uiuc.edu> References: <4AF1DE34.6020306@uiuc.edu> <352a1fb20911041545x16bf6292i65f84a6c13ded82e@mail.gmail.com> <4AF3009F.9050708@uiuc.edu> Message-ID: <352a1fb20911051012k53b22dcax4cef1bedf095a811@mail.gmail.com> Hi John, On Thu, Nov 5, 2009 at 8:43 AM, John Criswell wrote: > Does the debug facilities in LLVM TOT, at present, maintain information > better than LLVM 2.6 (i.e., if a front-end puts the debug information in, > will the optimizations not take it out)? ?Does the information that the > llvm-gcc front-end adds comparable to what llvm-gcc in LLVM 2.6 does? The FE has not changed significantly, other than bug fixes to improve debug info. > The problem that I'm having is that the SAFECode debug tool uses LLVM debug > information to print out nice error messages saying, "Your buffer overflow > is at line in source file ." ?Before transforms started removing > debug information, my tool would print out source line/file info that was > acceptably accurate. ?After the change, it started printing out horribly > wrong information (e.g., giving the source and line number of some inlined > function called by the function that actually generated the memory error). This is because, while cloning function body during inlining, the location information is also cloned, as expected. However, the inliner should update location information to indicate that this instruction is inlined at this location. I have local patch in my tree that is waiting finishing touch in codegen before I commit. I pasted it below for your reference. Now, each instruction can have location information attached with it. The location info (DILocation) include - unsigned - line number - unsigned - col number - DIScope - lexical scope - DILocation - inlined at location When an instruction is inlined, the first three fields will stay unchanged. But the inlined instruction will have non null "inlined at location" indicating where this instruction was inlined. - Devang Index: Utils/CloneFunction.cpp =================================================================== --- Utils/CloneFunction.cpp (revision 86036) +++ Utils/CloneFunction.cpp (working copy) @@ -20,6 +20,7 @@ #include "llvm/IntrinsicInst.h" #include "llvm/GlobalVariable.h" #include "llvm/Function.h" +#include "llvm/LLVMContext.h" #include "llvm/Support/CFG.h" #include "llvm/Transforms/Utils/ValueMapper.h" #include "llvm/Analysis/ConstantFolding.h" @@ -349,6 +350,27 @@ Ops.size(), Context, TD); } +static MDNode *UpdateInlinedAtInfo(MDNode *InsnMD, MDNode *TheCallMD, + LLVMContext &Context) { + DILocation ILoc(InsnMD); + if (ILoc.isNull()) return InsnMD; + + DILocation CallLoc(TheCallMD); + if (CallLoc.isNull()) return InsnMD; + + DILocation OrigLocation = ILoc.getOrigLocation(); + MDNode *NewLoc = TheCallMD; + if (!OrigLocation.isNull()) + NewLoc = UpdateInlinedAtInfo(OrigLocation.getNode(), TheCallMD, Context); + + SmallVector MDVs; + MDVs.push_back(InsnMD->getElement(0)); // Line + MDVs.push_back(InsnMD->getElement(1)); // Col + MDVs.push_back(InsnMD->getElement(2)); // Scope + MDVs.push_back(NewLoc); + return MDNode::get(Context, MDVs.data(), MDVs.size()); +} + /// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto, /// except that it does some simple constant prop and DCE on the fly. The /// effect of this is to copy significantly less code in cases where (for @@ -361,7 +383,8 @@ SmallVectorImpl &Returns, const char *NameSuffix, ClonedCodeInfo *CodeInfo, - const TargetData *TD) { + const TargetData *TD, + Instruction *TheCall) { assert(NameSuffix && "NameSuffix cannot be null!"); #ifndef NDEBUG @@ -411,8 +434,22 @@ } // Otherwise, remap the rest of the instructions normally. - for (; I != NewBB->end(); ++I) + unsigned DbgKind = 0; + MDNode *TheCallMD = NULL; + SmallVector MDVs; + LLVMContext &Context = OldFunc->getContext(); + if (TheCall && TheCall->hasMetadata()) { + DbgKind = Context.getMetadata().getMDKind("dbg"); + TheCallMD = Context.getMetadata().getMD(DbgKind, TheCall); + } + for (; I != NewBB->end(); ++I) { + if (TheCallMD && I->hasMetadata()) + if (MDNode *IMD = Context.getMetadata().getMD(DbgKind, I)) { + MDNode *NewMD = UpdateInlinedAtInfo(IMD, TheCallMD, Context); + Context.getMetadata().addMD(DbgKind, NewMD, I); + } RemapInstruction(I, ValueMap); + } } // Defer PHI resolution until rest of function is resolved, PHI resolution Index: Utils/InlineFunction.cpp =================================================================== --- Utils/InlineFunction.cpp (revision 86036) +++ Utils/InlineFunction.cpp (working copy) @@ -386,7 +386,7 @@ // (which can happen, e.g., because an argument was constant), but we'll be // happy with whatever the cloner can do. CloneAndPruneFunctionInto(Caller, CalledFunc, ValueMap, Returns, ".i", - &InlinedFunctionInfo, TD); + &InlinedFunctionInfo, TD, TheCall); // Remember the first block that is newly cloned over. FirstNewBlock = LastBlock; ++FirstNewBlock; From ofv at wanadoo.es Thu Nov 5 13:04:19 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Thu, 05 Nov 2009 20:04:19 +0100 Subject: [LLVMdev] [cmake] : dotty handling References: <57C38DA176A0A34A9B9F3CCCE33D3C4A0104618D4689@FRPAR1CL009.coe.adi.dibcom.com> Message-ID: <87k4y494jw.fsf@telefonica.net> Arnaud Allard de Grandmaison writes: > Here is a little patch to have cmake detect dotty, and if this was the > case, update the HAVE_DOTTY and LLVM_PATH_DOTTY defines in > include/llvm/Config/config.h. > > This should apply cleanly on TOT. Applied. Thanks! -- ?scar From rich at pennware.com Thu Nov 5 13:39:05 2009 From: rich at pennware.com (Richard Pennington) Date: Thu, 05 Nov 2009 13:39:05 -0600 Subject: [LLVMdev] Debug Information for LLVM 2.6 and TOT In-Reply-To: <352a1fb20911051012k53b22dcax4cef1bedf095a811@mail.gmail.com> References: <4AF1DE34.6020306@uiuc.edu> <352a1fb20911041545x16bf6292i65f84a6c13ded82e@mail.gmail.com> <4AF3009F.9050708@uiuc.edu> <352a1fb20911051012k53b22dcax4cef1bedf095a811@mail.gmail.com> Message-ID: <4AF329D9.8030400@pennware.com> Devang Patel wrote: > This is because, while cloning function body during inlining, the > location information is also cloned, as expected. However, the inliner > should update location information to indicate that this instruction > is inlined at this location. I have local patch in my tree that is > waiting finishing touch in codegen before I commit. I pasted it below > for your reference. > > Now, each instruction can have location information attached with it. > The location info (DILocation) include > - unsigned - line number > - unsigned - col number > - DIScope - lexical scope > - DILocation - inlined at location > > When an instruction is inlined, the first three fields will stay > unchanged. But the inlined instruction will have non null "inlined at > location" indicating where this instruction was inlined. Devang, Could this approach be used for macros? I can single step through macro bodies, but I can't set a breakpoint at the point of the macro invocation. It sounds like this will allow it. http://ellcc.org/images/ssmacros.png -Rich From plmdvy at gmail.com Thu Nov 5 15:35:59 2009 From: plmdvy at gmail.com (Paul Davey) Date: Fri, 6 Nov 2009 10:35:59 +1300 Subject: [LLVMdev] Strange error for libLLVMCore.a In-Reply-To: <4AF2D576.5050601@gmail.com> References: <4AF2D576.5050601@gmail.com> Message-ID: <9430ad070911051335j64109365k7d6326740c375ae@mail.gmail.com> you want to use the execution engine and JIT but do not put them in the llvm-config line?? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091106/d26a0a02/attachment.html From kavenchuk at gmail.com Fri Nov 6 00:35:11 2009 From: kavenchuk at gmail.com (Yaroslav Kavenchuk) Date: Fri, 06 Nov 2009 08:35:11 +0200 Subject: [LLVMdev] Strange error for libLLVMCore.a In-Reply-To: <9430ad070911051335j64109365k7d6326740c375ae@mail.gmail.com> References: <4AF2D576.5050601@gmail.com> <9430ad070911051335j64109365k7d6326740c375ae@mail.gmail.com> Message-ID: <4AF3C39F.3080905@gmail.com> Paul Davey wrote: > you want to use the execution engine and JIT but do not put them in the > llvm-config line?? It's present: $ g++ `llvm-config --libs --cflags --ldflags core analysis executionengine jit interpreter native backend engine` fac.o -o fac Ok, I add `all` to llvm-config: $ llvm-gcc `llvm-config --cflags all` -c fac.c $ g++ `llvm-config --libs --cflags --ldflags all` fac.o -o fac fac.o:fake:(.text+0x1d): undefined reference to `LLVMModuleCreateWithName' fac.o:fake:(.text+0x25): undefined reference to `LLVMInt32Type' fac.o:fake:(.text+0x2d): undefined reference to `LLVMInt32Type' fac.o:fake:(.text+0x4c): undefined reference to `LLVMFunctionType' fac.o:fake:(.text+0x63): undefined reference to `LLVMAddFunction' ... -- WBR, Yaroslav Kavenchuk From baldrick at free.fr Fri Nov 6 05:12:49 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 06 Nov 2009 12:12:49 +0100 Subject: [LLVMdev] Functions: sret and readnone In-Reply-To: <1f6a2bb9-d009-4aaa-9a3c-b51c193e4d36@r24g2000yqd.googlegroups.com> References: <135ebb010910050721t68118e75na082443e41c01d53@mail.gmail.com> <7A62B2C6-4FF3-4BF6-80F7-57ABB25BE0BA@apple.com> <5612891e-3fbf-4ff9-96da-56abc7d44086@o36g2000vbl.googlegroups.com> <1f6a2bb9-d009-4aaa-9a3c-b51c193e4d36@r24g2000yqd.googlegroups.com> Message-ID: <4AF404B1.2020506@free.fr> Hi Stephan, > intrinsic float4 sample(int tex, float2 tc); > > float4 main(int tex, float2 tc) > { > float4 x = sample(tex, tc); > return 0.0; > } without additional information it would be wrong to remove the call to sample because it might write to a global variable. > As you can see, the call to the sample function is still present, > although the actual value it is supposed to return via its sret > parameter is never used. Quite right too, see above. > Using the AAEvalPass I found out that the alias analysis pass I > implemented seems to work alright (it reports mod for %5): > > ===== Alias Analysis Evaluator Report ===== > 3 Total Alias Queries Performed > 3 no alias responses (100.0%) > 0 may alias responses (0.0%) > 0 must alias responses (0.0%) > Alias Analysis Evaluator Pointer Alias Summary: 100%/0%/0% > 3 Total ModRef Queries Performed > 2 no mod/ref responses (66.6%) > 1 mod responses (33.3%) > 0 ref responses (0.0%) > 0 mod & ref responses (0.0%) > Alias Analysis Evaluator Mod/Ref Summary: 66%/33%/0%/0% > > Yet, DCE, DSE and GVN fail to remove the function call. (I'm not so > sure which optimization pass to use, so I picked these three as they > seemed to make sense.) In order to perform this transform the optimizers would have to work out that sample does not modify any global state. This cannot be done without knowing the definition of sample, but you only provide a declaration. If you provided a body too then the GlobalsModRef analysis might be able to work it out. Ciao, Duncan. From tianshuo_1 at 163.com Fri Nov 6 05:41:29 2009 From: tianshuo_1 at 163.com (tianshuo_1) Date: Fri, 6 Nov 2009 19:41:29 +0800 (CST) Subject: [LLVMdev] llvm-gcc-4.2-2.6 build failed, In-Reply-To: <4AF2D07D.70408@free.fr> References: <4AF2D07D.70408@free.fr> <26955286.540831257421474353.JavaMail.coremail@app179.163.com>, <4AF2C9B2.9010100@free.fr> <200911052113161711730@163.com> Message-ID: <19972946.777131257507689109.JavaMail.coremail@bj163app46.163.com> Thank you for reply, I have tried building llvm-2.6 first in place, and configure llvm-gcc-4.2 with --enable-llvm=/path\to\llvm-2.6/, but, still the same problerm, and there's no files missed reported in the error message, such as "lvm/System/DataTypes.h", in the file system including /usr/include and ~/llvm/llvm-2.6/include/. May these files should be generated during llvm-2.6 building? I have compiled llvm-2.6 successfully and installed it in another directory, what's the reason for the problem? ??2009-11-05??"Duncan Sands" ?????? >Please do not reply to me personally: reply to the list. That way >others can comment, and the discussion is archived (which benefits >people who have the same problem at some later time). > >> ok, I have tried building llvm-2.6 first, in the same directory as >> source, and installed it in another directory.....but, the same problerm > >Did you change -enable-llvm to --enable-llvm? > >Best wishes, > >Duncan. ===================================================== try to build llvm-gcc-4.2-2.6.source before build and install llvm-2.6, the configure is shown bellow ../llvm-gcc-4.2/configure --prefix=/home/ts/program/ --program-prefix=llvm- --enable-llvm=/home/ts/llvm/llvm-2.6 --enable-languages=c,c++ where, it is the path where llvm-2.6 source is stored, -enable-llvm=/home/ts/llvm/llvm-2.6 the "make" gave error message as bellow: ======================================================= In file included from ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:23: ../../llvm-gcc-4.2/gcc/llvm-internal.h:40:35: error: llvm/System/DataTypes.h: No such file or directory ../../llvm-gcc-4.2/gcc/llvm-internal.h:44:41: error: llvm/Support/raw_os_ostream.h: No such file or directory ../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ??void createPerFunctionOptimizationPasses()??: ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:671: error: ??Less?? is not a member of ??llvm::CodeGenOpt?? ../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ??void llvm_asm_file_end()??: ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:874: error: ??getInt8PtrTy?? is not a member of ??llvm::Type?? ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:893: error: ??getInt8PtrTy?? is not a member of ??llvm::Type?? ../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ??void AddAnnotateAttrsToGlobal(llvm::GlobalValue*, tree_node*)??: ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1171: error: ??getInt8PtrTy?? is not a member of ??llvm::Type?? ../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ??void make_decl_llvm(tree_node*)??: ../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1635: error: ??const class llvm::Type?? has no member named ??isVoidTy?? make[3]: *** [llvm-backend.o] Error 1 make[3]: Leaving directory `/home/ts/llvm/llvm-gcc-4.2-obj/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory `/home/ts/llvm/llvm-gcc-4.2-obj' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/home/ts/llvm/llvm-gcc-4.2-obj' make: *** [all] Error 2 ============================================================ and , I found no file ,System/DataTypes.h, exist in the directory llvm-2.6/include/llvm/ ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091106/505afadc/attachment.html From baldrick at free.fr Fri Nov 6 06:13:38 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 06 Nov 2009 13:13:38 +0100 Subject: [LLVMdev] llvm-gcc-4.2-2.6 build failed, In-Reply-To: <19972946.777131257507689109.JavaMail.coremail@bj163app46.163.com> References: <4AF2D07D.70408@free.fr> <26955286.540831257421474353.JavaMail.coremail@app179.163.com>, <4AF2C9B2.9010100@free.fr> <200911052113161711730@163.com> <19972946.777131257507689109.JavaMail.coremail@bj163app46.163.com> Message-ID: <4AF412F2.4000009@free.fr> > and , I found no file ,System/DataTypes.h, exist in the directory llvm-2.6/include/llvm/ Are you sure you are building llvm-gcc-4.2-2.6 against llvm-2.6 and not against a version of llvm checked out from subversion? Ciao, Duncan. From stephan.reiter at gmail.com Fri Nov 6 06:19:20 2009 From: stephan.reiter at gmail.com (Stephan) Date: Fri, 6 Nov 2009 04:19:20 -0800 (PST) Subject: [LLVMdev] Functions: sret and readnone In-Reply-To: <4AF404B1.2020506@free.fr> References: <135ebb010910050721t68118e75na082443e41c01d53@mail.gmail.com> <7A62B2C6-4FF3-4BF6-80F7-57ABB25BE0BA@apple.com> <5612891e-3fbf-4ff9-96da-56abc7d44086@o36g2000vbl.googlegroups.com> <1f6a2bb9-d009-4aaa-9a3c-b51c193e4d36@r24g2000yqd.googlegroups.com> <4AF404B1.2020506@free.fr> Message-ID: <730d3f3e-31d7-48fd-909f-864bb7a96180@k4g2000yqb.googlegroups.com> Duncan, thanks for your answer! > In order to perform this transform the optimizers would have to work out > that sample does not modify any global state. ?This cannot be done without > knowing the definition of sample, but you only provide a declaration. Which is why I am trying to supply this additional information in a custom alias analysis pass, but it doesn't seem to work. (The AAEvalPass stats are precisely for this custom pass.) Could you take a look at the code, please? Am I missing something here? class VISIBILITY_HIDDEN MySretAliasAnalysis : public FunctionPass, public AliasAnalysis { std::map _srets; public: static char ID; MySretAliasAnalysis() : FunctionPass(&ID) { _srets["sample$int$float2"] = true; _srets["sample$int$float3"] = true; } void getAnalysisUsage(llvm::AnalysisUsage &usage) const { AliasAnalysis::getAnalysisUsage(usage); usage.setPreservesAll(); } bool runOnFunction(Function &F) { AliasAnalysis::InitializeAliasAnalysis(this); return false; } ModRefBehavior getModRefBehavior(CallSite CS, std::vector *Info = 0) { if(_srets.find(CS.getCalledFunction()->getName()) != _srets.end()) return AliasAnalysis::AccessesArguments; // only accesses args, no globals return AliasAnalysis::getModRefBehavior(CS, Info); } ModRefBehavior getModRefBehavior(Function *F, std::vector *Info = 0) { if(_srets.find(F->getName()) != _srets.end()) return AliasAnalysis::AccessesArguments; // only accesses args, no globals return AliasAnalysis::getModRefBehavior(F, Info); } ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size) { std::string functionName = CS.getCalledFunction()->getNameStr(); if(_srets.find(functionName) != _srets.end()) { if(CS.hasArgument(P)) { if(CS.getArgument(0) == P) return AliasAnalysis::Mod; // modify value pointed to by sret param else return AliasAnalysis::NoModRef; // there aren't any other pointer args } } return AliasAnalysis::getModRefInfo(CS, P, Size); } bool hasNoModRefInfoForCalls() const { return false; } }; > If you provided a body too then the GlobalsModRef analysis might be able to > work it out. That's not an option because I want the sample function to be resolved as an external function by the jitter. Thanks for your time, Stephan From tianshuo_1 at 163.com Fri Nov 6 06:24:22 2009 From: tianshuo_1 at 163.com (tianshuo_1) Date: Fri, 6 Nov 2009 20:24:22 +0800 (CST) Subject: [LLVMdev] llvm-gcc-4.2-2.6 build failed, In-Reply-To: <4AF412F2.4000009@free.fr> References: <4AF412F2.4000009@free.fr> <4AF2D07D.70408@free.fr> <26955286.540831257421474353.JavaMail.coremail@app179.163.com>, <4AF2C9B2.9010100@free.fr> <200911052113161711730@163.com> <19972946.777131257507689109.JavaMail.coremail@bj163app46.163.com> Message-ID: <17800835.783551257510262211.JavaMail.coremail@bj163app67.163.com> oooo. I check out llvm form svn by "svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm", but not "svn co https://user at llvm.org/svn/llvm-project/llvm/trunk llvm",,,, ??2009-11-06??"Duncan Sands" ?????? >> and , I found no file ,System/DataTypes.h, exist in the directory llvm-2.6/include/llvm/ > >Are you sure you are building llvm-gcc-4.2-2.6 against llvm-2.6 and not against >a version of llvm checked out from subversion? > >Ciao, > >Duncan. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091106/c0a91ca9/attachment.html From baldrick at free.fr Fri Nov 6 07:02:39 2009 From: baldrick at free.fr (Duncan Sands) Date: Fri, 06 Nov 2009 14:02:39 +0100 Subject: [LLVMdev] Functions: sret and readnone In-Reply-To: <730d3f3e-31d7-48fd-909f-864bb7a96180@k4g2000yqb.googlegroups.com> References: <135ebb010910050721t68118e75na082443e41c01d53@mail.gmail.com> <7A62B2C6-4FF3-4BF6-80F7-57ABB25BE0BA@apple.com> <5612891e-3fbf-4ff9-96da-56abc7d44086@o36g2000vbl.googlegroups.com> <1f6a2bb9-d009-4aaa-9a3c-b51c193e4d36@r24g2000yqd.googlegroups.com> <4AF404B1.2020506@free.fr> <730d3f3e-31d7-48fd-909f-864bb7a96180@k4g2000yqb.googlegroups.com> Message-ID: <4AF41E6F.9090004@free.fr> Hi Stephan, >> In order to perform this transform the optimizers would have to work out >> that sample does not modify any global state. This cannot be done without >> knowing the definition of sample, but you only provide a declaration. > > Which is why I am trying to supply this additional information in a > custom alias analysis pass, but it doesn't seem to work. (The > AAEvalPass stats are precisely for this custom pass.) > > Could you take a look at the code, please? Am I missing something > here? I think this cannot possibly work. Imagine that I am a pass trying to determine if the function call modifies global state. What would I have to do? I would have to consider all global variables, and query alias analysis to find out if any of them are modified. But how can I know all global variables? There is no way to know about global variables that are not declared in the module, so I can't query about those. And even if I could know about all global variables, checking all of them every time I want to consider deleting a function call would be very expensive and not worthwhile in general. GlobalsModRef only considers global variables with internal linkage IIRC (I may be wrong about this). That said, maybe there is some special AA query method that I don't know about that asks "do you write any global state". Ciao, Duncan. From stephan.reiter at gmail.com Fri Nov 6 07:22:36 2009 From: stephan.reiter at gmail.com (Stephan) Date: Fri, 6 Nov 2009 05:22:36 -0800 (PST) Subject: [LLVMdev] Functions: sret and readnone In-Reply-To: <4AF41E6F.9090004@free.fr> References: <135ebb010910050721t68118e75na082443e41c01d53@mail.gmail.com> <7A62B2C6-4FF3-4BF6-80F7-57ABB25BE0BA@apple.com> <5612891e-3fbf-4ff9-96da-56abc7d44086@o36g2000vbl.googlegroups.com> <1f6a2bb9-d009-4aaa-9a3c-b51c193e4d36@r24g2000yqd.googlegroups.com> <4AF404B1.2020506@free.fr> <730d3f3e-31d7-48fd-909f-864bb7a96180@k4g2000yqb.googlegroups.com> <4AF41E6F.9090004@free.fr> Message-ID: Hey Duncan, > That said, maybe there > is some special AA query method that I don't know about that asks "do you > write any global state". >From my limited understanding of the analysis framework, this method could be "getModRefBehavior". It returns a value of the ModRefBehavior enumeration type, which contains members such as DoesNotAccessMemory or OnlyReadsMemory. In my case AccessesArguments is the correct one, I guess. Directly from the header: // AccessesArguments - This function accesses function arguments in well // known (possibly volatile) ways, but does not access any other memory. So, there should be a way for optimization passes to know that the only memory such a function touches is memory, which is accessible via the pointers that are passed to it as arguments. In the particular case of my sample function: a pointer to a value on the stack. Best, Stephan From hans at hanshq.net Fri Nov 6 09:49:34 2009 From: hans at hanshq.net (Hans Wennborg) Date: Fri, 06 Nov 2009 16:49:34 +0100 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything In-Reply-To: References: <4AF14E9B.9060209@hanshq.net> Message-ID: <4AF4458E.1050504@hanshq.net> Dan Gohman wrote: > Hello, > > On Nov 4, 2009, at 1:51 AM, Hans Wennborg wrote: >> >> / Hans >> Index: lib/Analysis/BasicAliasAnalysis.cpp >> =================================================================== >> --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) >> +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) >> @@ -633,6 +633,15 @@ >> AliasAnalysis::AliasResult >> BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, >> const Value *V2, unsigned V2Size) { >> + // Null pointers do not alias with anything >> + if (const Constant *C = dyn_cast(V1)) >> + if (C->isNullValue()) >> + return NoAlias; >> + >> + if (const Constant *C = dyn_cast(V2)) >> + if (C->isNullValue()) >> + return NoAlias; >> + > > As Chris mentioned, for consistency with what the rest of LLVM is doing, > this should check whether the pointers are in the default address space > (0). > > Also, this could be generalized by checking the results from > getUnderlyingObject, since it's not valid to do arithmetic from null to > reach an LLVM identified object either. I'm not sure what you mean by generalizing. Do you mean I should do the check on O1 and O2, which are the results of calls to getUnderlyingObject? Something like: if (const ConstantPointerNull *CPN = dyn_cast(O1)) if (CPN->getType()->getAddressSpace() == 0) return NoAlias; and the same for O2 (maybe extract it into a function?) / Hans > > Dan > From ofv at wanadoo.es Fri Nov 6 11:10:35 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Fri, 06 Nov 2009 18:10:35 +0100 Subject: [LLVMdev] Any objections to removing 'win32/...' subtree from LLVM? References: <74c447500910251644o5207c1fcr4beb029ba1597488@mail.gmail.com> <74c447500910281935k49d4ed83p4a6b917adcb12fc@mail.gmail.com> Message-ID: <87eiob8tpw.fsf@telefonica.net> Chandler Carruth writes: > FYI, I'll plan on removing this subtree on Monday of next week if no > one else chimes in requesting a reprieve... The Visual C++ project files are still there. Anyone objected by private e-mail? Can we know the reasons just in case we can enhance the cmake build on accordance? In the past, the only reason for not removing win32/ was that the cmake-generated project files are not relocatable. As the win32/ project files seem out of date for months now, I reckon that the user who had that requirement switched to cmake. The mere existence of the win32/ subtree is a source of confussion for newcomers. Maybe the same applies to Xcode/ -- ?scar From clattner at apple.com Fri Nov 6 11:32:36 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 6 Nov 2009 09:32:36 -0800 Subject: [LLVMdev] DeadStoreElimination: do better without TargetData In-Reply-To: <4AF34AA9.8060003@hanshq.net> References: <4AF190AF.6070900@hanshq.net> <4AF19BFE.4040509@hanshq.net> <01BA49E3-4D06-4CDF-BEE5-E8CC8C91E99D@apple.com> <4AF1C44A.1050801@hanshq.net> <02E2DF32-F0F1-4CA5-92C7-5414D3DF3D2B@apple.com> <4AF34AA9.8060003@hanshq.net> Message-ID: On Nov 5, 2009, at 1:59 PM, Hans Wennborg wrote: > My apologies for not replying sooner; I've been away from keyboard all > day today. > >> Thanks, applied here: >> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091102/090396.html >> >> >> I'd appreciate it if you could resend your other patches in patch >> format >> like this, attached to the email with the testcase using filecheck. >> This commit should be a good example. Thanks for helping improve >> this >> area! >> > > I'm not sure I follow you completely here. You want me to resend to > llvmdev, right -- not llvm-commits? Sure, either way works. > > What is the difference between the patch format i used and the one you > refer to, except for the testcase? > Is this filecheck thing documented somwhere? Specifically, please send it as an attachment instead of inline: http://llvm.org/docs/DeveloperPolicy.html#patches This makes it easier to apply. FileCheck is documented here: http://llvm.org/docs/TestingGuide.html#FileCheck Thanks! -Chris From kennethuil at gmail.com Fri Nov 6 13:22:50 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Fri, 6 Nov 2009 13:22:50 -0600 Subject: [LLVMdev] llvm.global_ctors Message-ID: <400d33ea0911061122o2de2d56ap5f938f6a182262da@mail.gmail.com> When you link two modules each of which contains a global_ctors array, is there a guarantee as to what order they'll run in? From anton at korobeynikov.info Fri Nov 6 14:03:13 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Fri, 6 Nov 2009 23:03:13 +0300 Subject: [LLVMdev] llvm.global_ctors In-Reply-To: <400d33ea0911061122o2de2d56ap5f938f6a182262da@mail.gmail.com> References: <400d33ea0911061122o2de2d56ap5f938f6a182262da@mail.gmail.com> Message-ID: Hello, Kenneth > When you link two modules each of which contains a global_ctors array, > is there a guarantee as to what order they'll run in? No, the order to static ctors is undefined. There is special "priority" attribute though. I don't remember whether we honor it or not... -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From peterke at gmail.com Fri Nov 6 14:28:05 2009 From: peterke at gmail.com (=?ISO-8859-1?Q?P=E9ter_Szil=E1gyi?=) Date: Fri, 6 Nov 2009 20:28:05 +0000 Subject: [LLVMdev] Sandboxing code Message-ID: <1d492d70911061228j1fc6d050v319812bbd2920017@mail.gmail.com> Hello, I'm absolutely 101% new to LLVM so please bare with me :). I'm trying to explore what LLVM can and cannot be used for. One thing I was wondering, whether it would be possible to execute an LLVM code in a completely sandboxed environment? By sandboxed I mean that the executed code should not have direct access to any system resources (i.e. hard drive, networking, devices), only through some specific API that I would provide. The idea is to be able to execute a random LLVM code from the internet in a completely safe way (provided that the specific code adheres to my libs in the first place... otherwise it shouldn't even compile). Thanks, Peter From criswell at uiuc.edu Fri Nov 6 14:48:30 2009 From: criswell at uiuc.edu (John Criswell) Date: Fri, 6 Nov 2009 14:48:30 -0600 Subject: [LLVMdev] Sandboxing code In-Reply-To: <1d492d70911061228j1fc6d050v319812bbd2920017@mail.gmail.com> References: <1d492d70911061228j1fc6d050v319812bbd2920017@mail.gmail.com> Message-ID: <4AF48B9E.70202@uiuc.edu> P?ter Szil?gyi wrote: > Hello, > > I'm absolutely 101% new to LLVM so please bare with me :). > > I'm trying to explore what LLVM can and cannot be used for. One > thing I was wondering, whether it would be possible to execute an LLVM > code in a completely sandboxed environment? By sandboxed I mean that > the executed code should not have direct access to any system > resources (i.e. hard drive, networking, devices), only through some > specific API that I would provide. The idea is to be able to execute a > random LLVM code from the internet in a completely safe way (provided > that the specific code adheres to my libs in the first place... > otherwise it shouldn't even compile). > The short answer is that you could build a system like this using LLVM, you could build it more quickly using the SAFECode compiler (which is built on LLVM and will be released as soon as we can get the legal paperwork done). However, you will need to add functionality to the LLVM/SAFECode system in order to be able to do the sandboxing. LLVM does not provide this functionality at present. The long answer: 1) You can build the program analysis and transformation passes needed to do this as a set of LLVM passes. 2) SAFECode provides control-flow integrity as one of its memory safety properties. It ensures that the return address of a function won't be overwritten, and it instruments indirect function calls with run-time checks to ensure that they call valid functions. 3) You could enhance the instrumentation on indirect function calls to ensure that they don't call system calls or other functions which you consider "dangerous." 4) You can combine this with operating system techniques (e.g., chroot jails, private name spaces (Linux/Plan 9 only), SELinux, etc.) to limit access to operating system resources. Depending on how you want to sandbox the code, using OS isolation techniques and/or virtual machines (e.g., VMWare, Xen) may be more straightforward and easier to implement. -- John T. > Thanks, > Peter > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From sumesh.uk at gmail.com Fri Nov 6 19:43:11 2009 From: sumesh.uk at gmail.com (Sumesh Udayakumaran) Date: Fri, 6 Nov 2009 17:43:11 -0800 Subject: [LLVMdev] MachineFunction::get Message-ID: <54a19460911061743g5ec8ce79o460c641eec992c62@mail.gmail.com> Hi I have a ModulePass in LLC that runs after most of codegen completes, right before OBJ emission. I want the ModulePass to iterate over all MachineFunctions, emulating them. I used to do this by iterating over all Module Function's, and using MachineFunction::get() to get the MachineFunction associated with said Function. In LLVM 2.6, MachineFunction::get() is gone. What is the new way of doing what I need? thanks Sumesh From gohman at apple.com Fri Nov 6 19:48:16 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 6 Nov 2009 17:48:16 -0800 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything In-Reply-To: <4AF4458E.1050504@hanshq.net> References: <4AF14E9B.9060209@hanshq.net> <4AF4458E.1050504@hanshq.net> Message-ID: <3CCEAD4B-9147-40FC-86F6-44B091204F4B@apple.com> On Nov 6, 2009, at 7:49 AM, Hans Wennborg wrote: > > I'm not sure what you mean by generalizing. > Do you mean I should do the check on O1 and O2, which are the results of calls to getUnderlyingObject? > > Something like: > > if (const ConstantPointerNull *CPN = dyn_cast(O1)) > if (CPN->getType()->getAddressSpace() == 0) > return NoAlias; > > and the same for O2 (maybe extract it into a function?) Yes, thanks. Dan From zhunansjtu at gmail.com Fri Nov 6 21:35:35 2009 From: zhunansjtu at gmail.com (Nan Zhu) Date: Sat, 7 Nov 2009 11:35:35 +0800 Subject: [LLVMdev] linking share libraries when building whole-program bitcode file Message-ID: Hi,all I'm working on how to build a whole-program bitcode file for big projects with a general solution,and I met a problem I simplify it as this: llvm-gcc -c -emit-llvm test.c llvm-ld test.o -lpthread //here llvm-ld tells me that "Cannot find library pthread" then I do this: llvm-ld test.o lli -load=/usr/lib/libpthread.so a.out.bc //lli tells me the /usr/lib/libpthread.so has a invalid ELF header What's the problem,my platform is Fedora 11 Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091107/e590e2a9/attachment.html From jyasskin at google.com Fri Nov 6 21:51:19 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Fri, 6 Nov 2009 19:51:19 -0800 Subject: [LLVMdev] MachineFunction::get In-Reply-To: <54a19460911061743g5ec8ce79o460c641eec992c62@mail.gmail.com> References: <54a19460911061743g5ec8ce79o460c641eec992c62@mail.gmail.com> Message-ID: The proper incantation appears to be: MachineFunction &MF = getAnalysis().getMF(); I found that in lib/CodeGen/MachineFunctionPass.cpp. On the other hand, that means it probably doesn't exist in a ModulePass, since the MachineFunctionAnalysis is itself a FunctionPass, so any particular Function's MachineFunction will only exist while that function is being emitted. On Fri, Nov 6, 2009 at 5:43 PM, Sumesh Udayakumaran wrote: > Hi > I have a ModulePass in LLC that runs after most of codegen completes, > right before OBJ emission. ?I want the ModulePass to iterate over all > MachineFunctions, emulating them. ?I used to do this by iterating over > all Module Function's, and using MachineFunction::get() to get the > MachineFunction associated with said Function. > > In LLVM 2.6, MachineFunction::get() is gone. ?What is the ?new way ?of > doing what I need? > > thanks > Sumesh > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From clattner at apple.com Fri Nov 6 22:40:32 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 6 Nov 2009 20:40:32 -0800 Subject: [LLVMdev] interesting preso Message-ID: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> I enjoyed this presentation: http://www.linux-kongress.org/2009/slides/compiler_survey_felix_von_leitner.pdf Among other things it lists small code sequences when compiled with a small collection of compilers, including llvm 2.6. It looks like there are several fairly obvious things we could do better... -Chris From clattner at apple.com Sat Nov 7 02:32:20 2009 From: clattner at apple.com (Chris Lattner) Date: Sat, 7 Nov 2009 00:32:20 -0800 Subject: [LLVMdev] Any objections to removing 'win32/...' subtree from LLVM? In-Reply-To: <87eiob8tpw.fsf@telefonica.net> References: <74c447500910251644o5207c1fcr4beb029ba1597488@mail.gmail.com> <74c447500910281935k49d4ed83p4a6b917adcb12fc@mail.gmail.com> <87eiob8tpw.fsf@telefonica.net> Message-ID: On Nov 6, 2009, at 9:10 AM, ?scar Fuentes wrote: > Chandler Carruth writes: > >> FYI, I'll plan on removing this subtree on Monday of next week if no >> one else chimes in requesting a reprieve... > > The Visual C++ project files are still there. > > Anyone objected by private e-mail? Can we know the reasons just in > case > we can enhance the cmake build on accordance? In the past, the only > reason for not removing win32/ was that the cmake-generated project > files are not relocatable. As the win32/ project files seem out of > date > for months now, I reckon that the user who had that requirement > switched > to cmake. Removed in r86358. I don't know what happened to Chandler. -Chris From hans at hanshq.net Sat Nov 7 03:44:26 2009 From: hans at hanshq.net (Hans Wennborg) Date: Sat, 07 Nov 2009 10:44:26 +0100 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything In-Reply-To: <3CCEAD4B-9147-40FC-86F6-44B091204F4B@apple.com> References: <4AF14E9B.9060209@hanshq.net> <4AF4458E.1050504@hanshq.net> <3CCEAD4B-9147-40FC-86F6-44B091204F4B@apple.com> Message-ID: <4AF5417A.9030600@hanshq.net> Dan Gohman wrote: > On Nov 6, 2009, at 7:49 AM, Hans Wennborg wrote: >> I'm not sure what you mean by generalizing. >> Do you mean I should do the check on O1 and O2, which are the results of calls to getUnderlyingObject? >> >> Something like: >> >> if (const ConstantPointerNull *CPN = dyn_cast(O1)) >> if (CPN->getType()->getAddressSpace() == 0) >> return NoAlias; >> >> and the same for O2 (maybe extract it into a function?) > > Yes, thanks. Ok, patch with test case attached. / Hans > > Dan > -------------- next part -------------- A non-text attachment was scrubbed... Name: BasicAliasAnalysis.diff Type: text/x-patch Size: 1508 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091107/4b1e737b/attachment.bin From chandlerc at google.com Sat Nov 7 04:06:39 2009 From: chandlerc at google.com (Chandler Carruth) Date: Sat, 7 Nov 2009 02:06:39 -0800 Subject: [LLVMdev] Any objections to removing 'win32/...' subtree from LLVM? In-Reply-To: References: <74c447500910251644o5207c1fcr4beb029ba1597488@mail.gmail.com> <74c447500910281935k49d4ed83p4a6b917adcb12fc@mail.gmail.com> <87eiob8tpw.fsf@telefonica.net> Message-ID: <74c447500911070206n1bddca0el51b25ab6d6d7c2b7@mail.gmail.com> On Sat, Nov 7, 2009 at 12:32 AM, Chris Lattner wrote: > > On Nov 6, 2009, at 9:10 AM, ?scar Fuentes wrote: > >> Chandler Carruth writes: >> >>> FYI, I'll plan on removing this subtree on Monday of next week if no >>> one else chimes in requesting a reprieve... >> >> The Visual C++ project files are still there. >> >> Anyone objected by private e-mail? Can we know the reasons just in >> case >> we can enhance the cmake build on accordance? In the past, the only >> reason for not removing win32/ was that the cmake-generated project >> files are not relocatable. As the win32/ project files seem out of >> date >> for months now, I reckon that the user who had that requirement >> switched >> to cmake. > > Removed in r86358. ?I don't know what happened to Chandler. Sorry, fires broke out this week. Was going to do it this weekend, but you got there first. > > -Chris > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From etherzhhb at gmail.com Sat Nov 7 06:38:18 2009 From: etherzhhb at gmail.com (ether zhhb) Date: Sat, 7 Nov 2009 20:38:18 +0800 Subject: [LLVMdev] llvm targeting EPIC architecture like IA-64 Message-ID: <5f72161f0911070438n6e5fb006p5d3391f3e912253d@mail.gmail.com> hi, everyone! i am going to writing a backend for architecture like IA-64. could i use the instruction selector to help me generate some instruction like bundles (long instruction words consisting of several microoperations)? or i have to handle it by my own machine code pass? thank you :) From rengolin at systemcall.org Sat Nov 7 18:15:53 2009 From: rengolin at systemcall.org (Renato Golin) Date: Sun, 8 Nov 2009 00:15:53 +0000 Subject: [LLVMdev] interesting preso In-Reply-To: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> References: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> Message-ID: 2009/11/7 Chris Lattner : > I enjoyed this presentation: > http://www.linux-kongress.org/2009/slides/compiler_survey_felix_von_leitner.pdf Wow, very comprehensive! Is there anyone working on vectorization? This is something that interests me, I might give it a try, just need some pointers. cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From clattner at apple.com Sat Nov 7 20:07:29 2009 From: clattner at apple.com (Chris Lattner) Date: Sat, 7 Nov 2009 18:07:29 -0800 Subject: [LLVMdev] interesting preso In-Reply-To: References: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> Message-ID: <063E1190-D1AF-4CB9-9401-034A55BCBAAD@apple.com> On Nov 7, 2009, at 4:15 PM, Renato Golin wrote: > 2009/11/7 Chris Lattner : >> I enjoyed this presentation: >> http://www.linux-kongress.org/2009/slides/compiler_survey_felix_von_leitner.pdf > > Wow, very comprehensive! > > Is there anyone working on vectorization? This is something that > interests me, I might give it a try, just need some pointers. The first step is loop dependence analysis. This is required to determine loop reuse information and is the basis for a lot of vectorization and parallelization loop transformations. There is work in this area in mainline llvm, but I don't know the status of it. -Chris From rengolin at systemcall.org Sun Nov 8 05:59:25 2009 From: rengolin at systemcall.org (Renato Golin) Date: Sun, 8 Nov 2009 11:59:25 +0000 Subject: [LLVMdev] interesting preso In-Reply-To: <063E1190-D1AF-4CB9-9401-034A55BCBAAD@apple.com> References: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> <063E1190-D1AF-4CB9-9401-034A55BCBAAD@apple.com> Message-ID: 2009/11/8 Chris Lattner : > The first step is loop dependence analysis. ?This is required to determine > loop reuse information and is the basis for a lot of vectorization and > parallelization loop transformations. I suppose all dependencies can be determined with function passes and module-wide analysis. LLVM does unroll small loops, but once the number of iterations is too big, it does not even attempts to unroll a multiple of the iterations. for(i=0;i<4;++i) unrolls to four flat calls but for(i=0;i<400;++i) doesn't unroll to 100 iterations of four flat calls... Is there any IR vectorial instruction? Or does it need to go as metadata for the codegen routines? So, instead of unrolling at the IR level, we could have some MISD/SIMD instructions with the whole range and let the codegen define what low-level instructions to use in each case. So, a processor without VFP would unroll the loop, while one with could use the VFP instructions instead of unrolling. Collapsing memset-like loop: multistore i32 %value, [ 400 x i32 ]* %array Collapsing memcpy-like loop: multicopy [ 400 x i32 ]* %orig, [ 400 x i32 ]* %dest Like the MSVC, we could also detect pointer copy loops and revert to a memcpy call. If a loop is called more than a few times, might be better (if space optimisations are not on) to create a region in memory to copy from with memcpy. This is particularly useful in repetitive calls to reset an array for the next iteration in a specific parallel computation. In that case, instead of creating new instructions, we could use those functions, inline them as often as possible and optimise them to VFP instructions later. cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From pekka.jaaskelainen at tut.fi Sun Nov 8 06:59:12 2009 From: pekka.jaaskelainen at tut.fi (=?ISO-8859-1?Q?Pekka_J=E4=E4skel=E4inen?=) Date: Sun, 08 Nov 2009 13:59:12 +0100 Subject: [LLVMdev] interesting preso In-Reply-To: References: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> <063E1190-D1AF-4CB9-9401-034A55BCBAAD@apple.com> Message-ID: <4AF6C0A0.3090407@tut.fi> Renato Golin wrote: > LLVM does unroll small loops, but once the number of iterations is too > big, it does not even attempts to unroll a multiple of the iterations. Partial unrolling is supported by the unroller when using the additional -unroll-allow-partial switch (false by default). Works for me with LLVM 2.5. -- Pekka J??skel?inen From rengolin at systemcall.org Sun Nov 8 07:58:19 2009 From: rengolin at systemcall.org (Renato Golin) Date: Sun, 8 Nov 2009 13:58:19 +0000 Subject: [LLVMdev] interesting preso In-Reply-To: <4AF6C0A0.3090407@tut.fi> References: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> <063E1190-D1AF-4CB9-9401-034A55BCBAAD@apple.com> <4AF6C0A0.3090407@tut.fi> Message-ID: 2009/11/8 Pekka J??skel?inen : > Partial unrolling is supported by the unroller when using the > additional -unroll-allow-partial switch (false by default). > Works for me with LLVM 2.5. I see, pardon my ignorance. Why isn't that part of -O3? cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From baldrick at free.fr Sun Nov 8 10:49:50 2009 From: baldrick at free.fr (Duncan Sands) Date: Sun, 08 Nov 2009 17:49:50 +0100 Subject: [LLVMdev] llvm.global_ctors In-Reply-To: References: <400d33ea0911061122o2de2d56ap5f938f6a182262da@mail.gmail.com> Message-ID: <4AF6F6AE.6060103@free.fr> > No, the order to static ctors is undefined. There is special > "priority" attribute though. I don't remember whether we honor it or > not... http://llvm.org/bugs/show_bug.cgi?id=5329 From jyasskin at google.com Sun Nov 8 17:17:30 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Sun, 8 Nov 2009 15:17:30 -0800 Subject: [LLVMdev] Could you add tests for dlsym stubs? Message-ID: Hi Nate. I've noticed that when I hardcode ExecutionEngine::areDlsymStubsEnabled() to always return false, check-lit still passes. I'm working on fixing a couple bugs in the JIT that involve changing how stubs are handled. I'm being careful around dlsym stubs, but I'm not perfect and may make a mistake. I'd really appreciate if you could add some tests for the code you added that would prevent me from accidentally breaking it. Thanks, Jeffrey From wendling at apple.com Sun Nov 8 18:20:43 2009 From: wendling at apple.com (Bill Wendling) Date: Sun, 8 Nov 2009 16:20:43 -0800 Subject: [LLVMdev] interesting preso In-Reply-To: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> References: <911B2C1C-9E37-4985-A8F1-B115446A1A48@apple.com> Message-ID: On Nov 6, 2009, at 8:40 PM, Chris Lattner wrote: > I enjoyed this presentation: > http://www.linux-kongress.org/2009/slides/compiler_survey_felix_von_leitner.pdf > > Among other things it lists small code sequences when compiled with a > small collection of compilers, including llvm 2.6. It looks like > there are several fairly obvious things we could do better... > The person should be lauded for saying that inline assembly isn't all it's cracked up to be, and should be avoided when possible. :-) -bw From victor.zverovich at googlemail.com Mon Nov 9 03:58:17 2009 From: victor.zverovich at googlemail.com (Victor Zverovich) Date: Mon, 9 Nov 2009 09:58:17 +0000 Subject: [LLVMdev] DenseMap iterator constness fix In-Reply-To: References: Message-ID: Reminding about the patches... Is there a problem with them or simply nobody have looked at them since? Victor 2009/11/4 Victor Zverovich > Good catch! I meant "for iterator" of course. Attached is a corrected patch > together with an old patch for clang just to keep them together. > Could someone commit these, please? > > Thanks, > Victor > > 2009/11/4 Jeffrey Yasskin > > + // Otherwise this is a copy constructor for const_iterator. >> >> Do you mean "for iterator"? >> >> Otherwise, looks good to me. If you can commit this, please do. >> Otherwise, someone else should as I'm not going to be around tomorrow. >> >> On Wed, Nov 4, 2009 at 12:27 AM, Victor Zverovich >> wrote: >> > Hi Jeffrey, >> > You are right that the generated copy constructor is used for >> > const_iterator. I have added a comment clarifying this. Also I have >> added >> > the tests you suggested and corrected the comparison operators. Please >> find >> > attached the updated patches. >> > Best regards, >> > Victor >> > 2009/11/3 Jeffrey Yasskin >> >> >> >> +template >> >> +struct If { typedef True Result; }; >> >> + >> >> +template >> >> +struct If { typedef False Result; }; >> >> >> >> These should probably go into include/llvm/Support/type_traits.h. In >> >> C++0x, this is named "conditional" (section 20.6.7), so I think you >> >> should use the same name, despite the standard committee's bad taste. >> >> >> >> + DenseMapIterator(const DenseMapIterator> >> + KeyInfoT, ValueInfoT, >> false>& >> >> I) >> >> >> >> This looks like it will make it impossible to copy const_iterators. I >> >> guess it doesn't because the copy-constructor is auto-generated, but >> >> please comment that and add tests for it and for the non-const->const >> >> conversion to unittests/ADT/DenseMapTest.cpp. >> >> >> >> Otherwise, the patches just change iterator to const_iterator, which >> looks >> >> fine. >> >> >> >> On Tue, Nov 3, 2009 at 3:09 AM, Victor Zverovich >> >> wrote: >> >> > Dear all, >> >> > The first of the proposed patches (DenseMapIterator.patch) forbids >> >> > implicit >> >> > conversion of DenseMap::const_iterator to DenseMap::iterator which >> was >> >> > possible because DenseMapIterator inherited (publicly) from >> >> > DenseMapConstIterator. Conversion the other way around is now allowed >> as >> >> > one >> >> > may expect. >> >> > The template DenseMapConstIterator is removed and the template >> >> > parameter IsConst which specifies whether the iterator is constant >> >> > is added >> >> > to DenseMapIterator. >> >> > Actually IsConst parameter is not necessary since the constness can >> be >> >> > determined from KeyT but this is not relevant to the fix and can be >> >> > addressed later. >> >> > The second patch (DenseMapIterator-clang.patch) corrects clang's >> usage >> >> > of >> >> > DenseMap iterators. >> >> > Best regards, >> >> > Victor >> >> > _______________________________________________ >> >> > LLVM Developers mailing list >> >> > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > >> >> > >> > >> > >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091109/1577067e/attachment.html From j.prasanth.j at gmail.com Mon Nov 9 04:55:19 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Mon, 9 Nov 2009 16:25:19 +0530 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM Message-ID: Hi, i am a newbie to llvm architecture. i have been trying to port llvm on ARM target. i am using the following configuration for cross compiling llvm. ../llvm/configure --host=arm-linux --target=arm-linux --build=i686-linux --prefix=/opt/llvm-arm/ --enable-optimized --disable-debug \ --disable-expensive-checks --disable-doxygen \ --disable-threads --enable-targets=cbe,cpp,arm using this configuration i am facing the following compilation error. pls help me how to resolve this error.. *make[1]: Entering directory `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System' llvm[1]: Compiling Alarm.cpp for Release build llvm[1]: Compiling Atomic.cpp for Release build llvm[1]: Compiling Disassembler.cpp for Release build llvm[1]: Compiling DynamicLibrary.cpp for Release build llvm[1]: Compiling Errno.cpp for Release build llvm[1]: Compiling Host.cpp for Release build llvm[1]: Compiling IncludeFile.cpp for Release build llvm[1]: Compiling Memory.cpp for Release build /home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp: In static member function ?static void llvm::sys::Memory::InvalidateInstructionCache(const void*, size_t)?: /home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp:67: error: ?__clear_cache? was not declared in this scope make[1]: *** [/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System/Release/Memory.o] Error 1 make[1]: Leaving directory `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System' make: *** [all] Error 1** *i can able to compile by commenting the line in Memory.cpp but i am not sure whether it will affect anything while running llvm on target. After cross-compilation i copied the binaries to target and i tried to compile and run a simple helloworld.c application. As clang requires a working gcc on target i used to "-ccc-clang-archs" options to skip the need for gcc on target. But still i am getting the following error. *# TMPDIR=/dtv/usb/sda ../bin/clang -ccc-clang-archs arm hello.c -v -I/dtv/usb/sda/LLVM/include clang version 1.0 (https://llvm.org/svn/llvm-project/cfe/branches/release_26exported) Target: arm-unknown-linux-gnu Thread model: posix "/dtv/usb/sda/LLVM/llvm-2.6-arm/bin/../libexec/clang-cc" -triple arm-unknown-linux-gnu -S -disable-free -main-file-name hello.c --relocation-mc clang-cc version 1.0 based upon llvm 2.6 hosted on arm-unknown-linux-gnu ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/include" ignoring nonexistent directory "/System/Library/Frameworks" ignoring nonexistent directory "/Library/Frameworks" #include "..." search starts here: #include <...> search starts here: /dtv/usb/sda/LLVM/include /dtv/usb/sda/LLVM/llvm-2.6-arm/lib/clang/1.0/include End of search list. clang-cc: /home/prasanth/LLVM_ARM/llvm-target/llvm-2.6/include/llvm/ADT/ilist.h:197: typename bidirectional_iterator::reference ll. 0 clang-cc 0x00cd314c Stack dump: 0. Program arguments: /dtv/usb/sda/LLVM/llvm-2.6-arm/bin/../libexec/clang-cc -triple arm-unknown-linux-gnu -S -disable-free -main-file-nam 1. parser at end of file 2. Code generation 3. Running pass 'ARM Instruction Selection' on function '@main' clang: error: compiler command failed due to signal 6 (use -v to see invocation) # *can anyone help me how to use clang for compiling applications on target. is it possible to run llvm bytecode on target using lli? if it is so pls let me know how to do it.. following are the target info: *target : arm cpu : arm1136jf-s toolchain : armv6* Thanks and Regards, Prasanth J -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091109/607514e1/attachment.html From xerxes at zafena.se Mon Nov 9 05:50:49 2009 From: xerxes at zafena.se (=?windows-1252?Q?Xerxes_R=E5nby?=) Date: Mon, 09 Nov 2009 12:50:49 +0100 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue In-Reply-To: References: Message-ID: <4AF80219.6090809@zafena.se> Prasanth J skrev: > Hi, > > i am a newbie to llvm architecture. i have been trying to port llvm on > ARM target. i am using the following configuration for cross compiling > llvm. > > ../llvm/configure --host=arm-linux --target=arm-linux > --build=i686-linux --prefix=/opt/llvm-arm/ --enable-optimized > --disable-debug \ > --disable-expensive-checks --disable-doxygen \ > --disable-threads --enable-targets=cbe,cpp,arm > > using this configuration i am facing the following compilation error. > pls help me how to resolve this error.. > > /make[1]: Entering directory > `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System' > llvm[1]: Compiling Alarm.cpp for Release build > llvm[1]: Compiling Atomic.cpp for Release build > llvm[1]: Compiling Disassembler.cpp for Release build > llvm[1]: Compiling DynamicLibrary.cpp for Release build > llvm[1]: Compiling Errno.cpp for Release build > llvm[1]: Compiling Host.cpp for Release build > llvm[1]: Compiling IncludeFile.cpp for Release build > llvm[1]: Compiling Memory.cpp for Release build > /home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp: In > static member function ?static void > llvm::sys::Memory::InvalidateInstructionCache(const void*, size_t)?: > /home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp:67: > error: ?__clear_cache? was not declared in this scope > make[1]: *** > [/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System/Release/Memory.o] > Error 1 > make[1]: Leaving directory > `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System' > make: *** [all] Error 1// > > /i can able to compile by commenting the line in Memory.cpp but i am > not sure whether it will affect anything while running llvm on target. > After cross-compilation i copied the binaries to target and i tried to > compile and run a simple helloworld.c application. As clang requires a > working gcc on target i used to "-ccc-clang-archs" options to skip the > need for gcc on target. But still i am getting the following error. By commenting out that line will make your llvm version crash sporadically since you would recreate llvm PR4960 if using the llvm JIT. http://llvm.org/bugs/show_bug.cgi?id=4960 __clear_cache are needed to clear the instructioncache after jitting a function and this gcc builtin are found in gcc 4.3.3 and later or CodeSourcery's 2007Q3/2008Q1 compiler releases and later. Try updating you cross compiler! Cheers Xerxes From mariusz.grad at googlemail.com Mon Nov 9 09:14:39 2009 From: mariusz.grad at googlemail.com (mg) Date: Mon, 9 Nov 2009 07:14:39 -0800 (PST) Subject: [LLVMdev] Cmake and pass Message-ID: Hi, Is it possible to generate pass (shared object) from Cmake? I tried to use add_llvm_library() however it produces only static libs. Thanks, Mariusz. From ofv at wanadoo.es Mon Nov 9 09:36:31 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Mon, 09 Nov 2009 16:36:31 +0100 Subject: [LLVMdev] Cmake and pass References: Message-ID: <87vdhj7ls0.fsf@telefonica.net> mg writes: > Is it possible to generate pass (shared object) from Cmake? ? Please name the library or libraries you want to build as shared objects. > I tried to use add_llvm_library() however it produces only static > libs. As mentioned on http://www.llvm.org/docs/CMake.html : cmake -DBUILD_SHARED_LIBS=ON path/to/llvm/source This builds all LLVM libraries as shared objects, though. -- ?scar From kennethuil at gmail.com Mon Nov 9 09:58:18 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Mon, 9 Nov 2009 09:58:18 -0600 Subject: [LLVMdev] Proposal: intp type Message-ID: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> Simply put, it's a pointer-sized integer. I'm blatantly stealing this idea from .NET, where IntPtr (a pointer-sized integer) is a basic type. In my front end, I had considered just using a pointer for intp behind-the-scenes and doing conversion to/from int64 when I wanted to do arithmetic on them, but pointers and integers don't always align the same way. So what I really want is a way to represent in IR that a certain parameter/struct member is a pointer-sized integer. Now that optimizations work without target data, I think we're tantalizingly close to a situation where useful, target-independent IR files are a real possibility. intp is one of the remaining pieces of that puzzle; lots of native code expects an integer parameter/struct member sized the same as a pointer. It makes sense for sizes and offsets to be represented this way, and in a lot of cases, they are represented this way, and in IR a lot more would be represented this way if such a type existed. Also, having this type present will tend over time to reduce the number of casts to/from int64 appearing in bitcode that have to be stripped out, slightly speeding up optimizations and codegen. The ramifications that I see: 1. Conversions to/from other integer types: right now, integer type conversions are always explicity specified as either a trunc, a sext, or a zext. Since the size of intp is not known at IR generation time, you can't know whether a conversion to/from intp truncates or extends. 2. The usual ramifications of adding a new type: IR generation/analysis, optimizations, and codegen all have to be updated to deal with the existence of the new type. The changes should be minor; it's an integer type with all of the supported operations of integer types, with the only difference being that its size cannot be determined without target data. From gohman at apple.com Mon Nov 9 13:29:18 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 9 Nov 2009 11:29:18 -0800 Subject: [LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything In-Reply-To: <4AF5417A.9030600@hanshq.net> References: <4AF14E9B.9060209@hanshq.net> <4AF4458E.1050504@hanshq.net> <3CCEAD4B-9147-40FC-86F6-44B091204F4B@apple.com> <4AF5417A.9030600@hanshq.net> Message-ID: <82AEF5D8-2569-49F9-86E5-224A04255777@apple.com> On Nov 7, 2009, at 1:44 AM, Hans Wennborg wrote: > > > Dan Gohman wrote: >> On Nov 6, 2009, at 7:49 AM, Hans Wennborg wrote: >>> I'm not sure what you mean by generalizing. >>> Do you mean I should do the check on O1 and O2, which are the results of calls to getUnderlyingObject? >>> >>> Something like: >>> >>> if (const ConstantPointerNull *CPN = dyn_cast(O1)) >>> if (CPN->getType()->getAddressSpace() == 0) >>> return NoAlias; >>> >>> and the same for O2 (maybe extract it into a function?) >> Yes, thanks. > > Ok, patch with test case attached. Applied, thanks! Dan From gohman at apple.com Mon Nov 9 13:49:57 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 9 Nov 2009 11:49:57 -0800 Subject: [LLVMdev] MachineFunction::get In-Reply-To: <54a19460911061743g5ec8ce79o460c641eec992c62@mail.gmail.com> References: <54a19460911061743g5ec8ce79o460c641eec992c62@mail.gmail.com> Message-ID: <6940318C-7DF3-41CD-9214-60F265E05BE5@apple.com> On Nov 6, 2009, at 5:43 PM, Sumesh Udayakumaran wrote: > Hi > I have a ModulePass in LLC that runs after most of codegen completes, > right before OBJ emission. I want the ModulePass to iterate over all > MachineFunctions, emulating them. I used to do this by iterating over > all Module Function's, and using MachineFunction::get() to get the > MachineFunction associated with said Function. > > In LLVM 2.6, MachineFunction::get() is gone. What is the new way of > doing what I need? CodeGen doesn't attempt to keep the MachineFunctions for all the Functions allocated at the same time. Looking back at 2.5, it seems it may have been possible to get CodeGen to do this, though it was probably accidental. MachineFunctions are now allocated and deallocated with the MachineFunctionAnalysis pass. It's very straight-forward; it's just a FunctionPass which allocates a new MachineFunction in its runOnFunction and deallocates it in its releaseMemory. You may be able to change it to fit your needs. Dan From alysson.pina at gmail.com Mon Nov 9 14:22:01 2009 From: alysson.pina at gmail.com (Alysson) Date: Mon, 9 Nov 2009 17:22:01 -0300 Subject: [LLVMdev] Optimizing class casts away In-Reply-To: References: Message-ID: Dear all, I am trying to remove some instanceof tests from bc code that is produced by vmkit. For instance: 1 if (o instanceof String) { 2 String s = (String)o; 3 } Vmkit seems to be inserting two tests into the bc code: one for the test in line 1, and another, implicit, that would lunch perhaps JavaClassCastException if the cast fails at runtime. Would it be possible for some of you guys more familiar with vmkit to explain me how it produces code for these casts and tests? I have separated two CFG's. The first hereis for the program below: public class J2 { Object o = new String; } The second CFG hereis for the same program, without the cast: public class J1 { Object o = new String; String s = (String)o; } Could some of you give me an idea of how the extra code would look like? It seems that the CFG's are a bit big for such small programs. All the best, Alysson -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091109/72b9ffb6/attachment.html From mariusz.grad at googlemail.com Mon Nov 9 14:27:31 2009 From: mariusz.grad at googlemail.com (mg) Date: Mon, 9 Nov 2009 12:27:31 -0800 (PST) Subject: [LLVMdev] Cmake and pass In-Reply-To: <87vdhj7ls0.fsf@telefonica.net> References: <87vdhj7ls0.fsf@telefonica.net> Message-ID: On Nov 9, 4:36?pm, ?scar Fuentes wrote: > cmake -DBUILD_SHARED_LIBS=ON path/to/llvm/source > > This builds all LLVM libraries as shared objects, though. Works great. Thank You. CMakeLists.txt looks like this: set(BUILD_SHARED_LIBS "ON") add_llvm_library(LLVMfoo pass/main.cc) It generates Debug/lib/libLLVMfoo.so which then can be loaded with opt -load. -- mg. From neelnagar42 at gmail.com Mon Nov 9 18:34:54 2009 From: neelnagar42 at gmail.com (Neel Nagar) Date: Tue, 10 Nov 2009 00:34:54 +0000 Subject: [LLVMdev] speed up memcpy intrinsic using ARM Neon registers Message-ID: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> I tried to speed up Dhrystone on ARM Cortex-A8 by optimizing the memcpy intrinsic. I used the Neon load multiple instruction to move up to 48 bytes at a time . Over 15 scalar instructions collapsed down into these 2 Neon instructions. fldmiad r3, {d0, d1, d2, d3, d4, d5} @ SrcLine dhrystone.c 359 fstmiad r1, {d0, d1, d2, d3, d4, d5} It seems like this should be faster. But I did not see any appreciable speedup. I think the patch is correct. The code runs fine. I have attached my patch for "lib/Target/ARM/ARMISelLowering.cpp" to this email. Does this look like the right modification? Does anyone have any insights into why this is not way faster than using scalar registers? I am using a BeagleBoard. Thanks, Neel Nagar -------------- next part -------------- A non-text attachment was scrubbed... Name: memcpy_neon_091109.patch Type: application/octet-stream Size: 2039 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091110/61765619/attachment.obj From jyasskin at google.com Mon Nov 9 19:19:18 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Mon, 9 Nov 2009 17:19:18 -0800 Subject: [LLVMdev] DenseMap iterator constness fix In-Reply-To: References: Message-ID: Whoops! Thanks for the ping! I've committed your patches as r86636 and r86638. On Mon, Nov 9, 2009 at 1:58 AM, Victor Zverovich wrote: > Reminding about the patches... > Is there a problem with them or simply nobody have looked at them since? > > Victor > > 2009/11/4 Victor Zverovich >> >> Good catch! I meant "for iterator" of course. Attached is a corrected >> patch together with an old patch for clang just to keep them together. >> Could someone commit these, please? >> Thanks, >> Victor >> 2009/11/4 Jeffrey Yasskin >>> >>> + ?// Otherwise this is a copy constructor for const_iterator. >>> >>> Do you mean "for iterator"? >>> >>> Otherwise, looks good to me. If you can commit this, please do. >>> Otherwise, someone else should as I'm not going to be around tomorrow. >>> >>> On Wed, Nov 4, 2009 at 12:27 AM, Victor Zverovich >>> wrote: >>> > Hi Jeffrey, >>> > You are right that the generated copy constructor is used for >>> > const_iterator. I have added a comment clarifying this. Also I have >>> > added >>> > the tests you suggested and corrected the comparison operators.?Please >>> > find >>> > attached the updated patches. >>> > Best regards, >>> > Victor >>> > 2009/11/3 Jeffrey Yasskin >>> >> >>> >> +template >>> >> +struct If { typedef True Result; }; >>> >> + >>> >> +template >>> >> +struct If { typedef False Result; }; >>> >> >>> >> These should probably go into include/llvm/Support/type_traits.h. In >>> >> C++0x, this is named "conditional" (section 20.6.7), so I think you >>> >> should use the same name, despite the standard committee's bad taste. >>> >> >>> >> + ?DenseMapIterator(const DenseMapIterator>> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?KeyInfoT, ValueInfoT, >>> >> false>& >>> >> I) >>> >> >>> >> This looks like it will make it impossible to copy const_iterators. I >>> >> guess it doesn't because the copy-constructor is auto-generated, but >>> >> please comment that and add tests for it and for the non-const->const >>> >> conversion to unittests/ADT/DenseMapTest.cpp. >>> >> >>> >> Otherwise, the patches just change iterator to const_iterator, which >>> >> looks >>> >> fine. >>> >> >>> >> On Tue, Nov 3, 2009 at 3:09 AM, Victor Zverovich >>> >> wrote: >>> >> > Dear all, >>> >> > The first of the proposed patches (DenseMapIterator.patch) forbids >>> >> > implicit >>> >> > conversion of DenseMap::const_iterator to DenseMap::iterator which >>> >> > was >>> >> > possible because DenseMapIterator inherited (publicly) from >>> >> > DenseMapConstIterator. Conversion the other way around is now >>> >> > allowed as >>> >> > one >>> >> > may expect. >>> >> > The template DenseMapConstIterator is?removed and the template >>> >> > parameter?IsConst which specifies whether the iterator is constant >>> >> > is?added >>> >> > to?DenseMapIterator. >>> >> > Actually IsConst parameter is not necessary since the constness can >>> >> > be >>> >> > determined from KeyT but this is not relevant to the fix and can be >>> >> > addressed later. >>> >> > The second patch (DenseMapIterator-clang.patch) corrects clang's >>> >> > usage >>> >> > of >>> >> > DenseMap iterators. >>> >> > Best regards, >>> >> > Victor >>> >> > _______________________________________________ >>> >> > LLVM Developers mailing list >>> >> > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >>> >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >> > >>> >> > >>> > >>> > >> > > From lessen42 at gmail.com Mon Nov 9 19:59:07 2009 From: lessen42 at gmail.com (David Conrad) Date: Mon, 9 Nov 2009 20:59:07 -0500 Subject: [LLVMdev] speed up memcpy intrinsic using ARM Neon registers In-Reply-To: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> References: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> Message-ID: On Nov 9, 2009, at 7:34 PM, Neel Nagar wrote: > I tried to speed up Dhrystone on ARM Cortex-A8 by optimizing the > memcpy intrinsic. I used the Neon load multiple instruction to move up > to 48 bytes at a time . Over 15 scalar instructions collapsed down > into these 2 Neon instructions. > > fldmiad r3, {d0, d1, d2, d3, d4, d5} @ SrcLine dhrystone.c 359 > fstmiad r1, {d0, d1, d2, d3, d4, d5} > > It seems like this should be faster. But I did not see any > appreciable speedup. > > I think the patch is correct. The code runs fine. > > I have attached my patch for "lib/Target/ARM/ARMISelLowering.cpp" to > this email. > > Does this look like the right modification? > > Does anyone have any insights into why this is not way faster than > using scalar registers? On the A8, an ARM store after NEON stores to the same 16-byte block incurs a ~20 cycle penalty since the NEON unit executes behind ARM. It's worse if the NEON store was split across a 16-byte boundary, then there could be a 50 cycle stall. See http://hardwarebug.org/2008/12/31/arm-neon-memory-hazards/ for some more details and benchmarks. From dalej at apple.com Mon Nov 9 20:11:34 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 9 Nov 2009 18:11:34 -0800 Subject: [LLVMdev] Altivec vs the type legalizer Message-ID: PPC Altivec supports vector type v16i8 (and others) where the element type is not legal (in llvm's implementation). When we have a BUILD_VECTOR of these types with constant elements, LegalizeTypes first promotes the element types to i32, then builds a constant pool entry of type v16i32. This is wrong. I can fix it by truncating the elements back to i8 in ExpandBUILD_VECTOR. Does this seem like the right approach? I ask because we'll be relying on ConstantVector::get and getConstantPool to work even with elements of a type that's illegal for the target; currently, they do. (And I see no other way to fix it except to break the vector into scalars, which produces horrendous code.) typedef vector unsigned char vuint8_t; vuint8_t baz; void foo(vuint8_t x) { vuint8_t temp = (vuint8_t)(22,21,20, 3, 25,24,23, 3, 28,27,26, 3, 31,30,29, 3); baz = vec_add(x, temp); } From baldrick at free.fr Mon Nov 9 20:33:53 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 10 Nov 2009 03:33:53 +0100 Subject: [LLVMdev] Altivec vs the type legalizer In-Reply-To: References: Message-ID: <4AF8D111.4060509@free.fr> Hi Dale, > PPC Altivec supports vector type v16i8 (and others) where the element > type is not legal (in llvm's implementation). When we have a > BUILD_VECTOR of these types with constant elements, LegalizeTypes first > promotes the element types to i32, then builds a constant pool entry of > type v16i32. are you sure? I would expect it to build v4i32. Ciao, Duncan. From dalej at apple.com Mon Nov 9 23:38:38 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 9 Nov 2009 21:38:38 -0800 Subject: [LLVMdev] Altivec vs the type legalizer In-Reply-To: <4AF8D111.4060509@free.fr> References: <4AF8D111.4060509@free.fr> Message-ID: On Nov 9, 2009, at 6:33 PM, Duncan Sands wrote: > Hi Dale, > >> PPC Altivec supports vector type v16i8 (and others) where the >> element type is not legal (in llvm's implementation). When we have >> a BUILD_VECTOR of these types with constant elements, LegalizeTypes >> first promotes the element types to i32, then builds a constant >> pool entry of type v16i32. > > are you sure? I would expect it to build v4i32. Yes, I'm sure. Try it. From dalej at apple.com Mon Nov 9 23:43:22 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 9 Nov 2009 21:43:22 -0800 Subject: [LLVMdev] Altivec vs the type legalizer In-Reply-To: References: <4AF8D111.4060509@free.fr> Message-ID: <90470359-3130-419D-B41A-789E54058265@apple.com> On Nov 9, 2009, at 9:38 PM, Dale Johannesen wrote: > > On Nov 9, 2009, at 6:33 PM, Duncan Sands wrote: > >> Hi Dale, >> >>> PPC Altivec supports vector type v16i8 (and others) where the >>> element type is not legal (in llvm's implementation). When we >>> have a BUILD_VECTOR of these types with constant elements, >>> LegalizeTypes first promotes the element types to i32, then builds >>> a constant pool entry of type v16i32. >> >> are you sure? I would expect it to build v4i32. > > Yes, I'm sure. Try it. (Unless somebody's fixed it in the last week or so; I'm a bit out of date.) From bob.wilson at apple.com Mon Nov 9 23:49:07 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 9 Nov 2009 21:49:07 -0800 Subject: [LLVMdev] Altivec vs the type legalizer In-Reply-To: References: Message-ID: On Nov 9, 2009, at 6:11 PM, Dale Johannesen wrote: > PPC Altivec supports vector type v16i8 (and others) where the element > type is not legal (in llvm's implementation). When we have a > BUILD_VECTOR of these types with constant elements, LegalizeTypes > first promotes the element types to i32, then builds a constant pool > entry of type v16i32. This is wrong. I can fix it by truncating the > elements back to i8 in ExpandBUILD_VECTOR. Does this seem like the > right approach? I ask because we'll be relying on ConstantVector::get > and getConstantPool to work even with elements of a type that's > illegal for the target; currently, they do. (And I see no other way > to fix it except to break the vector into scalars, which produces > horrendous code.) > > > typedef vector unsigned char vuint8_t; > vuint8_t baz; > void foo(vuint8_t x) { > vuint8_t temp = (vuint8_t)(22,21,20, 3, 25,24,23, 3, 28,27,26, 3, > 31,30,29, 3); > baz = vec_add(x, temp); > } Earlier this year we ran into a similar problem for NEON and ended up modifying the type rules for BUILD_VECTOR so that the operand types do not need to mach the element types. It is possible that what you are seeing is fall-out from that change. With the "new" BUILD_VECTOR rules, you can have a v16i8 BUILD_VECTOR with 16 operands of type i32, and the operands are implicitly truncated to i8. Before we made that change, the type legalizer would (for the v16i8 case, e.g.) translate to a legal BUILD_VECTOR by using a bunch of shift and mask operations to pack 4 elements into each i32 value. When the target (like NEON) can directly support the smaller element types, it is a big mess to try to undo the shifting and masking to figure out what the original i8 operands were before type legalization. ExpandBUILD_VECTOR seems like the right place to handle this, but I would not do it by operating on illegal types. We should add code there to combine the individual elements into values of the smallest legal integer type (e.g., for v16i8, pack 4 operands into each i32 value) and then bitcast the result. I think this used to happen upstream in type legalization, and now some more work is needed later on. From viridia at gmail.com Tue Nov 10 00:35:07 2009 From: viridia at gmail.com (Talin) Date: Mon, 09 Nov 2009 22:35:07 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> Message-ID: <4AF9099B.4070108@gmail.com> I've asked for this as well. A workaround that I have considered, but haven't had time to explore yet, is to actually store such integers as pointers, and then bitcast to int64 to do actual math operations and GEPs. While this might sound inefficient on 32-bit platforms, I believe that LLVM's optimizers can take notice of the fact that you aren't using the upper bits and therefore degrade to the less expensive 32-bit operations. Clearly this is an ugly hack (especially in the obscurity of the IR code generated), but I haven't come up with anything better so far. Kenneth Uildriks wrote: > Simply put, it's a pointer-sized integer. I'm blatantly stealing this > idea from .NET, where IntPtr (a pointer-sized integer) is a basic > type. > > In my front end, I had considered just using a pointer for intp > behind-the-scenes and doing conversion to/from int64 when I wanted to > do arithmetic on them, but pointers and integers don't always align > the same way. So what I really want is a way to represent in IR that > a certain parameter/struct member is a pointer-sized integer. > > Now that optimizations work without target data, I think we're > tantalizingly close to a situation where useful, target-independent IR > files are a real possibility. intp is one of the remaining pieces of > that puzzle; lots of native code expects an integer parameter/struct > member sized the same as a pointer. It makes sense for sizes and > offsets to be represented this way, and in a lot of cases, they are > represented this way, and in IR a lot more would be represented this > way if such a type existed. > > Also, having this type present will tend over time to reduce the > number of casts to/from int64 appearing in bitcode that have to be > stripped out, slightly speeding up optimizations and codegen. > > The ramifications that I see: > > 1. Conversions to/from other integer types: right now, integer type > conversions are always explicity specified as either a trunc, a sext, > or a zext. Since the size of intp is not known at IR generation time, > you can't know whether a conversion to/from intp truncates or extends. > > 2. The usual ramifications of adding a new type: IR > generation/analysis, optimizations, and codegen all have to be updated > to deal with the existence of the new type. The changes should be > minor; it's an integer type with all of the supported operations of > integer types, with the only difference being that its size cannot be > determined without target data. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > -- Talin From evan.cheng at apple.com Tue Nov 10 01:13:28 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 9 Nov 2009 23:13:28 -0800 Subject: [LLVMdev] speed up memcpy intrinsic using ARM Neon registers In-Reply-To: References: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> Message-ID: On Nov 9, 2009, at 5:59 PM, David Conrad wrote: > On Nov 9, 2009, at 7:34 PM, Neel Nagar wrote: > >> I tried to speed up Dhrystone on ARM Cortex-A8 by optimizing the >> memcpy intrinsic. I used the Neon load multiple instruction to move >> up >> to 48 bytes at a time . Over 15 scalar instructions collapsed down >> into these 2 Neon instructions. Nice. Thanks for working on this. It has long been on my todo list. >> >> fldmiad r3, {d0, d1, d2, d3, d4, d5} @ SrcLine dhrystone.c 359 >> fstmiad r1, {d0, d1, d2, d3, d4, d5} >> >> It seems like this should be faster. But I did not see any >> appreciable speedup. Even if it's not faster, it's still a code size win which is also important. Are we generating the right aligned NEON load / stores? >> >> I think the patch is correct. The code runs fine. >> >> I have attached my patch for "lib/Target/ARM/ARMISelLowering.cpp" to >> this email. >> >> Does this look like the right modification? >> >> Does anyone have any insights into why this is not way faster than >> using scalar registers? > > On the A8, an ARM store after NEON stores to the same 16-byte block > incurs a ~20 cycle penalty since the NEON unit executes behind ARM. > It's worse if the NEON store was split across a 16-byte boundary, then > there could be a 50 cycle stall. > > See http://hardwarebug.org/2008/12/31/arm-neon-memory-hazards/ for > some more details and benchmarks. If that's the case, then for A8 we should only do this when there won't be trailing scalar load / stores. Evan > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From clattner at apple.com Tue Nov 10 01:25:20 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Nov 2009 23:25:20 -0800 Subject: [LLVMdev] speed up memcpy intrinsic using ARM Neon registers In-Reply-To: References: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> Message-ID: <89A3A1F8-F99E-408B-874E-748EF70708FB@apple.com> On Nov 9, 2009, at 11:13 PM, Evan Cheng wrote: >> >> On the A8, an ARM store after NEON stores to the same 16-byte block >> incurs a ~20 cycle penalty since the NEON unit executes behind ARM. >> It's worse if the NEON store was split across a 16-byte boundary, >> then >> there could be a 50 cycle stall. >> >> See http://hardwarebug.org/2008/12/31/arm-neon-memory-hazards/ for >> some more details and benchmarks. > > If that's the case, then for A8 we should only do this when there > won't be trailing scalar load / stores. It should be safe if the start pointer is known 16-byte aligned. The trailing stores won't be in the same 16-byte chunk. -Chris From baldrick at free.fr Tue Nov 10 03:20:34 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 10 Nov 2009 10:20:34 +0100 Subject: [LLVMdev] Altivec vs the type legalizer In-Reply-To: References: Message-ID: <4AF93062.20007@free.fr> Hi Dale, I think Bob is right: the type legalizer shouldn't be turning v16i8 into v16i32, what should happen is that the return type of the BUILD_VECTOR continues to be v16i8, but the type of the operands changes to i32, so you end up with a BUILD_VECTOR that takes 16 lots of i32, and produces a v16i8. The target then has all the info it needs to produce the best code, but needs to be careful not the use the operand type (i32) when it really wants the vector element type (i8). While Bob describes this as being new rules, IIRC the old type legalizer used to handle BUILD_VECTOR with an illegal element type needing promotion the same way: it just promoted the operands, resulting in a mismatch between the operand type and the vector element type (unlike in the bad old days, I believe this is now documented as being allowed, in the description of the BUILD_VECTOR node). However in the case of PPC I think the PPC code grabbed the BUILD_VECTOR and transformed it before it hit this logic in the old type legalizer. Now that type legalization is being done first, probably this got reversed: first the type legalizer logic transforms the BUILD_VECTOR, and only later the ppc code gets to do its stuff. Ciao, Duncan. From hans at hanshq.net Tue Nov 10 03:56:38 2009 From: hans at hanshq.net (Hans Wennborg) Date: Tue, 10 Nov 2009 10:56:38 +0100 Subject: [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter In-Reply-To: <4D39951A-5792-4BBC-9BEF-92540CE91349@apple.com> References: <4AF19306.20803@hanshq.net> <4D39951A-5792-4BBC-9BEF-92540CE91349@apple.com> Message-ID: <4AF938D6.3030706@hanshq.net> Dan Gohman wrote: > On Nov 4, 2009, at 6:43 AM, Hans Wennborg wrote: > >> Here is another change I'd like to suggest to the BasicAliasAnalysis. >> >> LLVM fails to remove the dead store in the following code: >> >> %t = type { i32 } >> >> define void @f(%t* noalias nocapture %stuff ) { >> %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 >> >> store i32 1, i32* %p; <-- This store is dead >> >> %x = load i32* inttoptr (i32 12345 to i32*) >> store i32 %x, i32* %p >> ret void >> } >> >> >> when run through >> ./llvm-as -o - test2.ll | ./opt -O3 -o - | ./llvm-dis -o - >> >> >> The problem is that the alias analysis is unsure about whether %p and 12345 may alias. But since %p is derived from %stuff, which has the noalias attribute, and 12345 is a constant and therefore cannot be derived from %stuff, they cannot alias. > > This sounds right. And actually, it's not limited to noalias; > isIdentifiedObject objects don't alias inttoptr-casted integer > literals either. I have a few comments on the patch below. > >> I'm attaching a patch which implements this. Please comment on whether this is sane, and if my code is the right way of doing it. >> >> >> / Hans >> Index: lib/Analysis/BasicAliasAnalysis.cpp >> =================================================================== >> --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) >> +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) >> @@ -643,6 +643,23 @@ >> if (!isa(V1->getType()) || !isa(V2->getType())) >> return NoAlias; // Scalars cannot alias each other >> >> + // Constant ptr cannot alias with a noalias attribute >> + if (isa(V1) && isa(V2->getType())) { >> + while (const GEPOperator *g = dyn_cast(V2)) >> + V2 = g->getOperand(0); >> + >> + if (const Argument *A = dyn_cast(V2)) >> + if (A->hasNoAliasAttr()) >> + return NoAlias; >> + } else if (isa(V2) && isa(V1->getType())) { >> + while (const GEPOperator *g = dyn_cast(V1)) >> + V1 = g->getOperand(0); >> + >> + if (const Argument *A = dyn_cast(V1)) >> + if (A->hasNoAliasAttr()) >> + return NoAlias; >> + } > > The GEP logic here is effectively doing (a subset of) what > getUnderlyingObject does. It would be better to move these checks > below the getUnderlyingObject calls just below so that they can > use the results from those calls instead. > > And instead of checking for a no-alias argument, this code could > use isIdentifiedObject instead, following my comment above. Thank you for the input, this certainly made things nicer. I have attached a patch that does this together with a test case. / Hans > > Dan > >> // Figure out what objects these things are pointing to if we can. >> const Value *O1 = V1->getUnderlyingObject(); >> const Value *O2 = V2->getUnderlyingObject(); >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > -------------- next part -------------- A non-text attachment was scrubbed... Name: BasicAliasAnalysis.patch Type: text/x-patch Size: 2180 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091110/e2f41ca9/attachment.bin From kennethuil at gmail.com Tue Nov 10 07:59:45 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Tue, 10 Nov 2009 07:59:45 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <4AF9099B.4070108@gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <4AF9099B.4070108@gmail.com> Message-ID: <400d33ea0911100559q5319f6cfsa1193fe63795db6b@mail.gmail.com> On Tue, Nov 10, 2009 at 12:35 AM, Talin wrote: > A workaround that I have considered, but haven't had time to explore yet, is > to actually store such integers as pointers, and then bitcast to int64 to do > actual math operations and GEPs. While this might sound inefficient on > 32-bit platforms, I believe that LLVM's optimizers can take notice of the > fact that you aren't using the upper bits and therefore degrade to the less > expensive 32-bit operations. The trouble with that is that the alignment of pointers is not necessarily the same as the alignment of pointer-sized integers. From me22.ca at gmail.com Tue Nov 10 08:10:54 2009 From: me22.ca at gmail.com (me22) Date: Tue, 10 Nov 2009 09:10:54 -0500 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> Message-ID: 2009/11/9 Kenneth Uildriks : > > 1. Conversions to/from other integer types: right now, integer type > conversions are always explicity specified as either a trunc, a sext, > or a zext. ?Since the size of intp is not known at IR generation time, > you can't know whether a conversion to/from intp truncates or extends. > Now that there are arbitrary-sized integers, couldn't you zext to i256 then trunc down again, and later let the folder simplify as appropriate? From stephan.reiter at gmail.com Tue Nov 10 08:58:22 2009 From: stephan.reiter at gmail.com (Stephan Reiter) Date: Tue, 10 Nov 2009 15:58:22 +0100 Subject: [LLVMdev] Bugfix: SCCP Message-ID: <135ebb010911100658w1a66fe3dp62622fb919219468@mail.gmail.com> The SCCP pass was failing an assertion that I traced back to SCCPSolver::visitExtractValueInst. getStructValueState was used on the aggregate operand even if it had no structure type. I added a check to use getStructValueState for structs and getValueState for other operands. This behavior was introduced in r85793. Please note that I'm not sure whether my changes correctly address this problem. In case they don't, I'd be glad to learn why in order to get a better understanding of llvm. :-) Please find attached a patch. Best, Stephan -------------- next part -------------- A non-text attachment was scrubbed... Name: sccp-fix.patch Type: application/octet-stream Size: 836 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091110/592c3056/attachment.obj From kennethuil at gmail.com Tue Nov 10 09:19:57 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Tue, 10 Nov 2009 09:19:57 -0600 Subject: [LLVMdev] Prescriptions Message-ID: <400d33ea0911100719t4937f50cn841e69dcf638147a@mail.gmail.com> Amber and Thomas need a refill. Will you be there at lunchtime today? From mmwu at princeton.edu Tue Nov 10 09:55:38 2009 From: mmwu at princeton.edu (Michael Wu) Date: Tue, 10 Nov 2009 10:55:38 -0500 Subject: [LLVMdev] Timing information out of the profiler Message-ID: <4AF98CFA.5020105@princeton.edu> Hi, Is is possible to get timing information out of ProfileInfo? Looking at the API for ProfileInfo, it seems to me that it only reports edge and execution counts, not timing information. Michael From kennethuil at gmail.com Tue Nov 10 10:24:36 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Tue, 10 Nov 2009 10:24:36 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> Message-ID: <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> On Tue, Nov 10, 2009 at 8:10 AM, me22 wrote: > 2009/11/9 Kenneth Uildriks : >> >> 1. Conversions to/from other integer types: right now, integer type >> conversions are always explicity specified as either a trunc, a sext, >> or a zext. ?Since the size of intp is not known at IR generation time, >> you can't know whether a conversion to/from intp truncates or extends. >> > > Now that there are arbitrary-sized integers, couldn't you zext to i256 > then trunc down again, and later let the folder simplify as > appropriate? I suppose that would work, but I wouldn't like to see two cast instructions for every conversion. Perhaps every conversion to/from intp could be represented as a zext, whether or not it actually performs an extension. Is there anything in LLVM that depends on a zext actually increasing the size of the integer? From kameo76890 at gmail.com Tue Nov 10 10:24:35 2009 From: kameo76890 at gmail.com (Patrick Kelly) Date: Tue, 10 Nov 2009 11:24:35 -0500 Subject: [LLVMdev] Hello! Message-ID: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> I'm interested in contributing to LLVM, but I'm a rather bad C/C++ developer. I do most of my work in Ada and was wondering if there was a way to still contribute to something other than the Ada frontend. From ofv at wanadoo.es Tue Nov 10 10:34:50 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Tue, 10 Nov 2009 17:34:50 +0100 Subject: [LLVMdev] Hello! References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> Message-ID: <87bpja72z9.fsf@telefonica.net> Patrick Kelly writes: > I'm interested in contributing to LLVM, but I'm a rather bad C/C++ > developer. I do most of my work in Ada and was wondering if there was > a way to still contribute to something other than the Ada frontend. See http://www.llvm.org/OpenProjects.html There are quite a few tasks with no C++ required. -- ?scar From arplynn at gmail.com Tue Nov 10 11:56:48 2009 From: arplynn at gmail.com (Alastair Lynn) Date: Tue, 10 Nov 2009 17:56:48 +0000 Subject: [LLVMdev] Overflow intrinsics Message-ID: <5E0F0ED5-0E61-41C8-8CB7-1991C0F30D90@gmail.com> Hello- Over the past couple of days I've been writing some very basic optimisations in -instcombine for the arithmetic with overflow intrinsics. As Duncan Sands pointed out on IRC however, this is duplicated effort when one can get equivalent results using weird sizes of ints in the IR. At present (at least, on x86/x86-64), the overflow intrinsics generate better code. So what would be the better route: keeping the overflow intrinsics, or getting rid of them and improving codegen to handle flags better? Alastair From baldrick at free.fr Tue Nov 10 12:19:52 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 10 Nov 2009 19:19:52 +0100 Subject: [LLVMdev] Overflow intrinsics In-Reply-To: <5E0F0ED5-0E61-41C8-8CB7-1991C0F30D90@gmail.com> References: <5E0F0ED5-0E61-41C8-8CB7-1991C0F30D90@gmail.com> Message-ID: <4AF9AEC8.90503@free.fr> Hi, > At present (at least, on x86/x86-64), the overflow intrinsics generate > better code. So what would be the better route: keeping the overflow > intrinsics, or getting rid of them and improving codegen to handle > flags better? http://llvm.org/bugs/show_bug.cgi?id=5443 Ciao, Duncan. From dalej at apple.com Tue Nov 10 12:33:45 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 10 Nov 2009 10:33:45 -0800 Subject: [LLVMdev] Altivec vs the type legalizer In-Reply-To: <4AF93062.20007@free.fr> References: <4AF93062.20007@free.fr> Message-ID: On Nov 10, 2009, at 1:20 AMPST, Duncan Sands wrote: > Hi Dale, I think Bob is right: the type legalizer shouldn't be > turning v16i8 > into v16i32, what should happen is that the return type of the > BUILD_VECTOR > continues to be v16i8, but the type of the operands changes to i32, > so you > end up with a BUILD_VECTOR that takes 16 lots of i32, and produces a > v16i8. It does that. > The target then has all the info it needs to produce the best code, > but needs > to be careful not the use the operand type (i32) when it really > wants the vector > element type (i8). I don't think it's target dependent. This is also broken on Neon; the breakage is introduced when lowering a BUILD_VECTOR to a load from ConstantPool, and the call that builds the ConstantPool does not currently pass enough information to DTRT, it just passes a vector of i32's. Try the following with -march=arm -mattr=+neon . (It is possible that there's no way to get the FE to generate this on Neon, however.) ; ModuleID = 'small.c' target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64- f128:64:128-n32" @baz = common global <16 x i8> zeroinitializer ; <<16 x i8>*> [#uses=1] define void @foo(<16 x i8> %x) nounwind ssp { entry: %x_addr = alloca <16 x i8> ; <<16 x i8>*> [#uses=2] %temp = alloca <16 x i8> ; <<16 x i8>*> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] store <16 x i8> %x, <16 x i8>* %x_addr store <16 x i8> , <16 x i8>* %temp, align 16 %0 = load <16 x i8>* %x_addr, align 16 ; <<16 x i8>> [#uses=1] %1 = load <16 x i8>* %temp, align 16 ; <<16 x i8>> [#uses=1] %tmp = add <16 x i8> %0, %1 ; <<16 x i8>> [#uses=1] store <16 x i8> %tmp, <16 x i8>* @baz, align 16 br label %return return: ; preds = %entry ret void } To make things more concrete here is the patch I was trying out: Index: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp =================================================================== --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (revision 85265) +++ lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (working copy) @@ -1810,7 +1810,16 @@ CV.push_back(const_cast(V- >getConstantFPValue())); } else if (ConstantSDNode *V = dyn_cast(Node->getOperand(i))) { - CV.push_back(const_cast(V- >getConstantIntValue())); + if (OpVT==EltVT) + CV.push_back(const_cast(V- >getConstantIntValue())); + else { + // If OpVT and EltVT don't match, EltVT is not legal and the + // element values have been promoted/truncated earlier. Undo this; + // we don't want a v16i8 to become a v16i32 for example. + const ConstantInt *CI = V->getConstantIntValue(); + CV.push_back(ConstantInt::get(EltVT.getTypeForEVT(*DAG.getContext()), + CI->getZExtValue())); + } } else { assert(Node->getOperand(i).getOpcode() == ISD::UNDEF); const Type *OpNTy = OpVT.getTypeForEVT(*DAG.getContext()); > While Bob describes this as being new rules, IIRC the old type > legalizer used > to handle BUILD_VECTOR with an illegal element type needing > promotion the same > way: it just promoted the operands, resulting in a mismatch between > the operand > type and the vector element type (unlike in the bad old days, I > believe this is > now documented as being allowed, in the description of the > BUILD_VECTOR node). Right. > However in the case of PPC I think the PPC code grabbed the > BUILD_VECTOR and > transformed it before it hit this logic in the old type legalizer. > Now that > type legalization is being done first, probably this got reversed: > first the > type legalizer logic transforms the BUILD_VECTOR, and only later the > ppc code > gets to do its stuff. I don't think so; by the time it reaches ExpandBUILD_VECTOR it's been through, and rejected, a bunch of special cases in the PPCISel code. From evan.cheng at apple.com Tue Nov 10 13:27:31 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 10 Nov 2009 11:27:31 -0800 Subject: [LLVMdev] speed up memcpy intrinsic using ARM Neon registers In-Reply-To: <89A3A1F8-F99E-408B-874E-748EF70708FB@apple.com> References: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> <89A3A1F8-F99E-408B-874E-748EF70708FB@apple.com> Message-ID: <8AF6129A-862A-4511-964E-F53A8B1AA6C0@apple.com> On Nov 9, 2009, at 11:25 PM, Chris Lattner wrote: > > On Nov 9, 2009, at 11:13 PM, Evan Cheng wrote: > >>> >>> On the A8, an ARM store after NEON stores to the same 16-byte block >>> incurs a ~20 cycle penalty since the NEON unit executes behind ARM. >>> It's worse if the NEON store was split across a 16-byte boundary, then >>> there could be a 50 cycle stall. >>> >>> See http://hardwarebug.org/2008/12/31/arm-neon-memory-hazards/ for >>> some more details and benchmarks. >> >> If that's the case, then for A8 we should only do this when there >> won't be trailing scalar load / stores. > > It should be safe if the start pointer is known 16-byte aligned. The trailing stores won't be in the same 16-byte chunk. According to http://hardwarebug.org/2008/12/31/arm-neon-memory-hazards/ There are secondary effects if the load / store are within 64-byte block. Evan > > -Chris From clattner at apple.com Tue Nov 10 15:57:14 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 10 Nov 2009 13:57:14 -0800 Subject: [LLVMdev] Overflow intrinsics In-Reply-To: <5E0F0ED5-0E61-41C8-8CB7-1991C0F30D90@gmail.com> References: <5E0F0ED5-0E61-41C8-8CB7-1991C0F30D90@gmail.com> Message-ID: <6C2460C7-DDBC-4A18-9C03-ED5BE483AFC1@apple.com> On Nov 10, 2009, at 9:56 AM, Alastair Lynn wrote: > Hello- > > Over the past couple of days I've been writing some very basic > optimisations in -instcombine for the arithmetic with overflow > intrinsics. As Duncan Sands pointed out on IRC however, this is > duplicated effort when one can get equivalent results using weird > sizes of ints in the IR. > > At present (at least, on x86/x86-64), the overflow intrinsics generate > better code. So what would be the better route: keeping the overflow > intrinsics, or getting rid of them and improving codegen to handle > flags better? Both. Until codegen improves to the point where it is always better or equal to the intrinsics, we should keep the intrinsics and keep improving codegen. If they ever become "always better than" the intrinsics, we can remove the intrinsics. We're a long way away from being able to remove them, but I agree in principle that it would be nice to eliminate them. -Chris From clattner at apple.com Tue Nov 10 16:02:41 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 10 Nov 2009 14:02:41 -0800 Subject: [LLVMdev] Bugfix: SCCP In-Reply-To: <135ebb010911100658w1a66fe3dp62622fb919219468@mail.gmail.com> References: <135ebb010911100658w1a66fe3dp62622fb919219468@mail.gmail.com> Message-ID: <521C8757-428D-48B3-A5A8-A87A8AE0B9DB@apple.com> On Nov 10, 2009, at 6:58 AM, Stephan Reiter wrote: > The SCCP pass was failing an assertion that I traced back to > SCCPSolver::visitExtractValueInst. getStructValueState was used on the > aggregate operand even if it had no structure type. I added a check to > use getStructValueState for structs and getValueState for other > operands. > > This behavior was introduced in r85793. Please note that I'm not sure > whether my changes correctly address this problem. In case they don't, > I'd be glad to learn why in order to get a better understanding of > llvm. :-) Thanks, I applied a variant of your patch with a testcase here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091109/090817.html You're seeing this on extractvalue from a array, right? -Chris From lattner at apple.com Tue Nov 10 16:17:10 2009 From: lattner at apple.com (Tanya Lattner) Date: Tue, 10 Nov 2009 14:17:10 -0800 Subject: [LLVMdev] LLVM server downtime ** Nov 12th ** Message-ID: <500E4ACC-4C81-40C3-96E9-2A67B3A24259@apple.com> The LLVM web/svn server will be down on November 12th from 11AM PST to 12PM PST. Thanks, Tanya Lattner From viridia at gmail.com Tue Nov 10 18:10:13 2009 From: viridia at gmail.com (Talin) Date: Tue, 10 Nov 2009 16:10:13 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> Message-ID: I realize that most users of LLVM aren't affected by this, because most frontends aren't target-neutral, and thus know in advance how big a pointer is. At least, that's my impression. In my case, I've been attempting to build a target-neutral frontend. In my tool chain, the target is specified at link time, not at compile time. Among other things, that means that the same IR file can be used for multiple targets. What strikes me is how tantalizingly close LLVM comes to being able to do this. I am surprised, for example, that I can general all of the DWARF debugging structures without ever having to choose a target machine. Most things can be done quite easily without knowing the exact size of a pointer. When it comes to being able to "generate once, run anywhere", LLVM is like 99.5% of the way there. Which makes that last remaining .5% particularly vexing. There's only a tiny handful of fairly esoteric cases which require selecting a target before you generate IR. Unfortunately, the "pointer the same size as an int" is one of these rare cases - it is something that is very painful to try and work around. (A similar esoteric use case is: "which of the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the union problem.) On Tue, Nov 10, 2009 at 8:24 AM, Kenneth Uildriks wrote: > On Tue, Nov 10, 2009 at 8:10 AM, me22 wrote: > > 2009/11/9 Kenneth Uildriks : > >> > >> 1. Conversions to/from other integer types: right now, integer type > >> conversions are always explicity specified as either a trunc, a sext, > >> or a zext. Since the size of intp is not known at IR generation time, > >> you can't know whether a conversion to/from intp truncates or extends. > >> > > > > Now that there are arbitrary-sized integers, couldn't you zext to i256 > > then trunc down again, and later let the folder simplify as > > appropriate? > > I suppose that would work, but I wouldn't like to see two cast > instructions for every conversion. > > Perhaps every conversion to/from intp could be represented as a zext, > whether or not it actually performs an extension. Is there anything > in LLVM that depends on a zext actually increasing the size of the > integer? > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091110/6ef4c865/attachment.html From kameo76890 at gmail.com Tue Nov 10 18:37:23 2009 From: kameo76890 at gmail.com (Patrick Kelly) Date: Tue, 10 Nov 2009 19:37:23 -0500 Subject: [LLVMdev] Hello! In-Reply-To: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> Message-ID: <8bd081200911101637y3d0f6a59k216559fb0a92fae7@mail.gmail.com> On Tue, Nov 10, 2009 at 11:24 AM, Patrick Kelly wrote: > I'm interested in contributing to LLVM, but I'm a rather bad C/C++ > developer. I do most of my work in Ada and was wondering if there was a way > to still contribute to something other than the Ada frontend. > Since I didn't elaborate, specifically I want to work on an Ada back-end. As I understand it, there are already C and C++ backends so it technically is possible. I just want to make sure that theres no complaints to me writing this in Ada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091110/27bc2bad/attachment.html From kennethuil at gmail.com Tue Nov 10 18:41:59 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Tue, 10 Nov 2009 18:41:59 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> Message-ID: <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> On Tue, Nov 10, 2009 at 6:10 PM, Talin wrote: > In my case, I've been attempting to build a target-neutral frontend. In my > tool chain, the target is specified at link time, not at compile time. Among > other things, that means that the same IR file can be used for multiple > targets. That's the direction I'm going in too. > > What strikes me is how tantalizingly close LLVM comes to being able to do > this. I am surprised, for example, that I can general all of the DWARF > debugging structures without ever having to choose a target machine. Most > things can be done quite easily without knowing the exact size of a pointer. > When it comes to being able to "generate once, run anywhere", LLVM is like > 99.5% of the way there. Which makes that last remaining .5% particularly > vexing. > > There's only a tiny handful of fairly esoteric cases which require selecting > a target before you generate IR. Unfortunately, the "pointer the same size > as an int" is one of these rare cases -? it is something that is very > painful to try and work around. (A similar esoteric use case is: "which of > the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the union > problem.) I'm willing to spend some time on adding intp to LLVM... my front-end's standard libraries would be cleaner and more portable that way. From eocallaghan at auroraux.org Tue Nov 10 19:11:59 2009 From: eocallaghan at auroraux.org (Edward O'Callaghan) Date: Wed, 11 Nov 2009 01:11:59 +0000 Subject: [LLVMdev] Hello! In-Reply-To: <8bd081200911101637y3d0f6a59k216559fb0a92fae7@mail.gmail.com> References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> <8bd081200911101637y3d0f6a59k216559fb0a92fae7@mail.gmail.com> Message-ID: <521640720911101711o39d5531crcd947fafd2adc3d8@mail.gmail.com> Hello Patrick, Great to have a fellow Ada programmer around, yes there are some tasks that really need doing ! We^[1] contributed a Ada binding to the LLVM project some months ago. However, The binding needs to be correctly tighten into the rest of the LLVM build system properly and it needs possibly some test cases also. This would be a really fantastic contribution if you could take care of this particular project on the Ada front? We have the intent on some day soon porting the Ada frontend to LLVM^[2] however the above work needs to be done so the LLVM side is 'ready' for that to happen. There is of course other projects if your not interested, but I guess these are a things would like to be done. Cheers, Edward. [1] - http://www.auroraux.org/ [2] - http://forums.auroraux.org/viewtopic.php?f=12&t=6&sid=1f7338c7bb4f5c32d69d6392b454ee3f 2009/11/11 Patrick Kelly : > > > On Tue, Nov 10, 2009 at 11:24 AM, Patrick Kelly > wrote: >> >> I'm interested in contributing to LLVM, but I'm a rather bad C/C++ >> developer. I do most of my work in Ada and was wondering if there was a way >> to still contribute to something other than the Ada frontend. > > Since I didn't elaborate, specifically I want to work on an Ada back-end. As > I understand it, there are already C and C++ backends so it technically is > possible. > > I just want to make sure that theres no complaints to me writing this in > Ada. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > -- -- Edward O'Callaghan http://www.auroraux.org/ eocallaghan at auroraux dot org From nnmahaja at umail.iu.edu Tue Nov 10 21:05:06 2009 From: nnmahaja at umail.iu.edu (Nilesh Mahajan) Date: Tue, 10 Nov 2009 22:05:06 -0500 Subject: [LLVMdev] llvm-gcc-4.2-2.6 build failed, In-Reply-To: <17800835.783551257510262211.JavaMail.coremail@bj163app67.163.com> References: <4AF2D07D.70408@free.fr> <26955286.540831257421474353.JavaMail.coremail@app179.163.com> <4AF2C9B2.9010100@free.fr> <200911052113161711730@163.com> <19972946.777131257507689109.JavaMail.coremail@bj163app46.163.com> <4AF412F2.4000009@free.fr> <17800835.783551257510262211.JavaMail.coremail@bj163app67.163.com> Message-ID: Don't build the LLVM GCC source checked out from SVN. Download the source tar.gz, unzip it and then build it. That works. 2009/11/6 tianshuo_1 : > oooo. I check out llvm form svn by > "svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm", > but not "svn co https://user at llvm.org/svn/llvm-project/llvm/trunk llvm",,,, > > > > ??2009-11-06??"Duncan Sands" ?????? >>> and , I found no file ,System/DataTypes.h, exist in the directory >>> llvm-2.6/include/llvm/ >> >>Are you sure you are building llvm-gcc-4.2-2.6 against llvm-2.6 and not >> against >>a version of llvm checked out from subversion? >> >>Ciao, >> >>Duncan. > > > ________________________________ > 09??????3D???????????????????????????????????? > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > From criswell at uiuc.edu Tue Nov 10 22:26:06 2009 From: criswell at uiuc.edu (John Criswell) Date: Tue, 10 Nov 2009 22:26:06 -0600 Subject: [LLVMdev] Support for Aggregate Return Values Message-ID: <4AFA3CDE.4070206@uiuc.edu> Dear All, How well does the LLVM code generators support returns of structure types in LLVM 2.6? I'm currently writing a transform that requires functions to return multiple values and am thinking implementing it by changing the function to return a struct. If it matters, I'm currently targeting 32-bit Linux and Mac OS X for x86. -- John T. From clattner at apple.com Tue Nov 10 23:22:58 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 10 Nov 2009 21:22:58 -0800 Subject: [LLVMdev] Support for Aggregate Return Values In-Reply-To: <4AFA3CDE.4070206@uiuc.edu> References: <4AFA3CDE.4070206@uiuc.edu> Message-ID: <36EB7D0B-FADD-4189-9DD1-DDDFA1943FDD@apple.com> On Nov 10, 2009, at 8:26 PM, John Criswell wrote: > Dear All, > > How well does the LLVM code generators support returns of structure > types in LLVM 2.6? I'm currently writing a transform that requires > functions to return multiple values and am thinking implementing it by > changing the function to return a struct. > > If it matters, I'm currently targeting 32-bit Linux and Mac OS X for > x86. returning aggregates with up to two elements will work reliably. -Chris From stephan.reiter at gmail.com Wed Nov 11 03:04:14 2009 From: stephan.reiter at gmail.com (Stephan) Date: Wed, 11 Nov 2009 01:04:14 -0800 (PST) Subject: [LLVMdev] Bugfix: SCCP In-Reply-To: <521C8757-428D-48B3-A5A8-A87A8AE0B9DB@apple.com> References: <135ebb010911100658w1a66fe3dp62622fb919219468@mail.gmail.com> <521C8757-428D-48B3-A5A8-A87A8AE0B9DB@apple.com> Message-ID: <01df74dc-762d-4b80-b4b4-38ddb7ab2e4d@p35g2000yqh.googlegroups.com> On 10 Nov., 23:02, Chris Lattner wrote: > You're seeing this on extractvalue from a array, right? That is correct. With the latest code from the trunk the problem is gone. From stephan.reiter at gmail.com Wed Nov 11 03:42:32 2009 From: stephan.reiter at gmail.com (Stephan) Date: Wed, 11 Nov 2009 01:42:32 -0800 (PST) Subject: [LLVMdev] Puzzled by results of -O3 Message-ID: Hi, I'm trying to figure out why the following sequence of intructions is not collapsed to "ret i32 0" by the opt tool with "-03". --- %0 = type <{ i32* }> define i32 @main(%0* noalias nocapture %arg) nounwind readnone { bb: %tmp = alloca [1024 x i32], align 4 ; <[1024 x i32]*> [#uses=2] %tmp3 = getelementptr inbounds [1024 x i32]* %tmp, i32 0, i32 0 ; [#uses=1] %tmp4 = bitcast [1024 x i32]* %tmp to [1 x i32]* ; <[1 x i32]*> [#uses=1] store [1 x i32] zeroinitializer, [1 x i32]* %tmp4 %tmp5 = load i32* %tmp3 ; [#uses=1] ret i32 %tmp5 } --- %tmp is what I'd like to call a local heap: It is allocated in the entry function and passed as a parameter to all called functions. These functions can then perform instantiations of types with reference semantics and return the objects to their callers without problems. In this case the local heap has a size of 1024 words. Memory for an array of one integer is allocated on it (%tmp4), initialized to zero, and then the array's first element is returned (optimizer is using %tmp3 for the load). The original code in my language reads: entry int main() { int[] arr = int[1](); // int[] has reference semantics return arr[0]; } Any thoughts on this? I figured it had something to do with alias analysis not covering this case, so I ran the AA evaluator and let LLVM output all alias queries: ===== Alias Analysis Evaluator Report ===== 6 Total Alias Queries Performed 3 no alias responses (50.0%) 0 may alias responses (0.0%) 3 must alias responses (50.0%) Alias Analysis Evaluator Pointer Alias Summary: 50%/0%/50% Alias Analysis Mod/Ref Evaluator Summary: no mod/ref! no alias ... tmp(4096) : arg(4) no alias ... tmp3(4) : arg(4) must alias ... tmp3(4) : tmp(4096) no alias ... tmp4(4) : arg(4) must alias ... tmp4(4) : tmp(4096) must alias ... tmp4(4) : tmp3(4) %tmp3 and %tmp4 are correctly determined to alias, so it should be possible for an optimization pass (is it instruction combining?) to figure out that %tmp5 will be 0. Am I right? store [1 x i32] zeroinitializer, [1 x i32]* %tmp4 %tmp5 = load i32* %tmp3 ; [#uses=1] Thanks! Stephan From rodolph.perfetta at arm.com Wed Nov 11 05:27:59 2009 From: rodolph.perfetta at arm.com (Rodolph Perfetta) Date: Wed, 11 Nov 2009 11:27:59 -0000 Subject: [LLVMdev] speed up memcpy intrinsic using ARM Neon registers In-Reply-To: References: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> Message-ID: <000001ca62c2$05dbf880$1193e980$@perfetta@arm.com> > >> I tried to speed up Dhrystone on ARM Cortex-A8 by optimizing the > >> memcpy intrinsic. I used the Neon load multiple instruction to move > >> up to 48 bytes at a time . Over 15 scalar instructions collapsed > >> down into these 2 Neon instructions. > > Nice. Thanks for working on this. It has long been on my todo list. > > >> > >> fldmiad r3, {d0, d1, d2, d3, d4, d5} @ SrcLine dhrystone.c 359 > >> fstmiad r1, {d0, d1, d2, d3, d4, d5} > >> > >> It seems like this should be faster. But I did not see any > >> appreciable speedup. If you know about the alignment, maybe use structured load/store (vst1.64/vld1.64 {dn-dm}). You may also want to work on whole cache lines (64 bytes on A8). You can find more in this discussion: http://groups.google.com/group/beagleboard/browse_thread/thread/12c7bd415fbc 0993/e382202f1a92b0f8?lnk=gst&q=memcpy&pli=1 . > Even if it's not faster, it's still a code size win which is also > important. Yes but NEON will drive up your power consumption, so if you are not faster you will drain your battery faster (assuming you care of course). In general we wouldn't recommend writing memcpy using NEON unless you can detect the exact core you will be running on: on A9 NEON will not give you any speed up, you'll just end up using more power. NEON is a SIMD engine. If one wanted to write memcpy on A9 we would recommend something like: * do not use NEON * use PLD (3-6 cache lines ahead, to be tuned) * ldm/stm whole cache lines (32 bytes on A9) * align destination Cheers, Rodolph. From timo.lindfors at iki.fi Wed Nov 11 05:47:56 2009 From: timo.lindfors at iki.fi (Timo Juhani Lindfors) Date: Wed, 11 Nov 2009 13:47:56 +0200 Subject: [LLVMdev] Puzzled by results of -O3 In-Reply-To: (stephan.reiter@gmail.com's message of "Wed, 11 Nov 2009 01:42:32 -0800 (PST)") References: Message-ID: <84k4xx9tar.fsf@sauna.l.org> Stephan writes: > store [1 x i32] zeroinitializer, [1 x i32]* %tmp4 If I replace this with %tmp6 = bitcast [1 x i32]* %tmp4 to i32* ; <[1 x i32]*>[#uses=1] store i32 0, i32* %tmp6 then "opt -gvn" alone is enough figure out "ret i32 0". From baldrick at free.fr Wed Nov 11 06:23:44 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 11 Nov 2009 13:23:44 +0100 Subject: [LLVMdev] Puzzled by results of -O3 In-Reply-To: References: Message-ID: <4AFAACD0.70807@free.fr> Hi Stephan, > I'm trying to figure out why the following sequence of intructions is > not collapsed to "ret i32 0" by the opt tool with "-03". no target data maybe? Ciao, Duncan. From kennethuil at gmail.com Wed Nov 11 06:56:00 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Wed, 11 Nov 2009 06:56:00 -0600 Subject: [LLVMdev] Support for Aggregate Return Values In-Reply-To: <36EB7D0B-FADD-4189-9DD1-DDDFA1943FDD@apple.com> References: <4AFA3CDE.4070206@uiuc.edu> <36EB7D0B-FADD-4189-9DD1-DDDFA1943FDD@apple.com> Message-ID: <400d33ea0911110456i28140b3cw13d566442fe0d687@mail.gmail.com> On Tue, Nov 10, 2009 at 11:22 PM, Chris Lattner wrote: > > On Nov 10, 2009, at 8:26 PM, John Criswell wrote: > >> Dear All, >> >> How well does the LLVM code generators support returns of structure >> types in LLVM 2.6? ?I'm currently writing a transform that requires >> functions to return multiple values and am thinking implementing it by >> changing the function to return a struct. >> >> If it matters, I'm currently targeting 32-bit Linux and Mac OS X for >> x86. > > returning aggregates with up to two elements will work reliably. > > -Chris > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > An update to support arbitrary-sized struct returns is awaiting final approval. From kennethuil at gmail.com Wed Nov 11 07:00:06 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Wed, 11 Nov 2009 07:00:06 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> Message-ID: <400d33ea0911110500s6627dba9x4c1500b8e3885682@mail.gmail.com> On Tue, Nov 10, 2009 at 6:41 PM, Kenneth Uildriks wrote: > On Tue, Nov 10, 2009 at 6:10 PM, Talin wrote: (A similar esoteric use case is: "which of >> the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the union >> problem.) The size of a union can be compiled into a ConstantExpr. i.e., (sizeof(T1) > sizeof(T2)) ? sizeof(T1) : sizeof(T2)) Since sizeof(T1) and sizeof(T2) themselves are ConstantExpr's, and so is icmp(ConstantExpr, ConstantExpr) and select (ConstantExpr, ConstantExpr, ConstantExpr). You won't be able to tell which is bigger from your front-end, but you'll have a ConstantExpr that you can feed to malloc, etc. From stephan.reiter at gmail.com Wed Nov 11 07:01:59 2009 From: stephan.reiter at gmail.com (Stephan) Date: Wed, 11 Nov 2009 05:01:59 -0800 (PST) Subject: [LLVMdev] Support for Aggregate Return Values In-Reply-To: <400d33ea0911110456i28140b3cw13d566442fe0d687@mail.gmail.com> References: <4AFA3CDE.4070206@uiuc.edu> <36EB7D0B-FADD-4189-9DD1-DDDFA1943FDD@apple.com> <400d33ea0911110456i28140b3cw13d566442fe0d687@mail.gmail.com> Message-ID: <04db90f5-5a92-4f4f-9b64-50c7e4fb6eeb@j19g2000yqk.googlegroups.com> On 11 Nov., 13:56, Kenneth Uildriks wrote: > An update to support arbitrary-sized struct returns is awaiting final approval. You da man! ^^ Seriously, reading this makes me very happy and I look forward to seeing unrestricted support for struct returns in LLVM! Thank you, Stephan From kennethuil at gmail.com Wed Nov 11 08:22:23 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Wed, 11 Nov 2009 08:22:23 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911110500s6627dba9x4c1500b8e3885682@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> <400d33ea0911110500s6627dba9x4c1500b8e3885682@mail.gmail.com> Message-ID: <400d33ea0911110622s284c8358y2b3fbde2b742c416@mail.gmail.com> On Wed, Nov 11, 2009 at 7:00 AM, Kenneth Uildriks wrote: > On Tue, Nov 10, 2009 at 6:41 PM, Kenneth Uildriks wrote: >> On Tue, Nov 10, 2009 at 6:10 PM, Talin wrote: > (A similar esoteric use case is: "which of >>> the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the union >>> problem.) > > The size of a union can be compiled into a ConstantExpr. ?i.e., > > (sizeof(T1) > sizeof(T2)) ? sizeof(T1) : sizeof(T2)) > > Since sizeof(T1) and sizeof(T2) themselves are ConstantExpr's, and so > is icmp(ConstantExpr, ConstantExpr) and select (ConstantExpr, > ConstantExpr, ConstantExpr). > > You won't be able to tell which is bigger from your front-end, but > you'll have a ConstantExpr that you can feed to malloc, etc. > Of course if you try to represent it as an aggregate, rather than a block of memory, you're stuck again, and for the same reason. An array type can't use a ConstantExpr for its size... it has to be specified as a literal integer by the front-end. So passing your union as a parameter or returning it by value won't work... unions can *only* live in memory unless you've got target data. Very interesting problem (but one I don't feel ready to even high-level-design a solution for yet)... From claesenm at gmail.com Wed Nov 11 09:22:56 2009 From: claesenm at gmail.com (Marc Claesen) Date: Wed, 11 Nov 2009 16:22:56 +0100 Subject: [LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error Message-ID: <4AFAD6D0.60102@gmail.com> Hi, I'm trying to add function calls in the LLVM IR using the IRBuilder class. I've read both tutorials about functions but I still get assertion errors. I allocate memory for all function arguments and pass them as explained in the tutorial. My code is (this function is supposed to add a call to f in bb at pos): void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) { std::vector args; IRBuilder<> builder(bb,pos); for(Function::arg_iterator argit = f->arg_begin();argit!=f->arg_end();argit++){ AllocaInst* allocInst = builder.CreateAlloca(argit->getType()); args.push_back(allocInst); } builder.CreateCall(f,args.begin(),args.end()); } This seems to work for functions without parameters (eg. int foo()), but once a function has a parameter I get the following assertion error: /lib/VMCore/Instructions.cpp:297: void llvm::CallInst::init(llvm::Value*, llvm::Value* const*, unsigned int): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a bad signature!"' failed. I've checked everything I can think of and it all seems correct to me ... Any help would be greatly appreciated! Thanks in advance, Marc Claesen From jyasskin at google.com Wed Nov 11 10:05:13 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Wed, 11 Nov 2009 08:05:13 -0800 Subject: [LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error In-Reply-To: <4AFAD6D0.60102@gmail.com> References: <4AFAD6D0.60102@gmail.com> Message-ID: CreateAlloca(Type) returns an object of type Type*, the memory that can hold an object of type Type. You probably don't want to be creating allocas just before calling the function since 1) if that call winds up in a loop they'll grow your stack frame without bound, and 2) the memory they point to is initially uninitialized. Where did the tutorial tell you to do that? In general, when I hit one of those assertions, I gdb to it, use "p f->dump()" to see the types of the function's arguments, and use "p Params[i]->dump()" to see the parameter with the bad type. On Wed, Nov 11, 2009 at 7:22 AM, Marc Claesen wrote: > Hi, > > I'm trying to add function calls in the LLVM IR using the IRBuilder > class. I've read both tutorials about functions but I still get > assertion errors. I allocate memory for all function arguments and pass > them as explained in the tutorial. > > My code is (this function is supposed to add a call to f in bb at pos): > void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) { > ?std::vector args; > ?IRBuilder<> builder(bb,pos); > ?for(Function::arg_iterator argit = > f->arg_begin();argit!=f->arg_end();argit++){ > ? ? ?AllocaInst* allocInst = builder.CreateAlloca(argit->getType()); > ? ? ?args.push_back(allocInst); > ?} > ?builder.CreateCall(f,args.begin(),args.end()); > } > > This seems to work for functions without parameters (eg. int foo()), but > once a function has a parameter I get the following assertion error: > /lib/VMCore/Instructions.cpp:297: void > llvm::CallInst::init(llvm::Value*, llvm::Value* const*, unsigned int): > Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == > Params[i]->getType()) && "Calling a function with a bad signature!"' failed. > > I've checked everything I can think of and it all seems correct to me > ... Any help would be greatly appreciated! > > Thanks in advance, > > Marc Claesen > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From claesenm at gmail.com Wed Nov 11 11:19:07 2009 From: claesenm at gmail.com (Marc Claesen) Date: Wed, 11 Nov 2009 18:19:07 +0100 Subject: [LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error In-Reply-To: References: <4AFAD6D0.60102@gmail.com> Message-ID: <4AFAF20B.6080006@gmail.com> > CreateAlloca(Type) returns an object of type Type*, the memory that > can hold an object of type Type. You probably don't want to be > creating allocas just before calling the function since 1) if that > call winds up in a loop they'll grow your stack frame without bound, > and 2) the memory they point to is initially uninitialized. Where did > the tutorial tell you to do that? I used CreateAllocA(Type) because I assumed that was the correct way to create a variable of a given type. What I'm trying to do is create new variables of the types required by a function and then call the function, so it's quite simple ... I just don't know how to initialise correctly by the looks of it. What function should I use if not CreateAllocA(Type)? Thanks in advance, Marc Jeffrey Yasskin wrote: > CreateAlloca(Type) returns an object of type Type*, the memory that > can hold an object of type Type. You probably don't want to be > creating allocas just before calling the function since 1) if that > call winds up in a loop they'll grow your stack frame without bound, > and 2) the memory they point to is initially uninitialized. Where did > the tutorial tell you to do that? > > In general, when I hit one of those assertions, I gdb to it, use "p > f->dump()" to see the types of the function's arguments, and use "p > Params[i]->dump()" to see the parameter with the bad type. > > On Wed, Nov 11, 2009 at 7:22 AM, Marc Claesen wrote: > >> Hi, >> >> I'm trying to add function calls in the LLVM IR using the IRBuilder >> class. I've read both tutorials about functions but I still get >> assertion errors. I allocate memory for all function arguments and pass >> them as explained in the tutorial. >> >> My code is (this function is supposed to add a call to f in bb at pos): >> void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) { >> std::vector args; >> IRBuilder<> builder(bb,pos); >> for(Function::arg_iterator argit = >> f->arg_begin();argit!=f->arg_end();argit++){ >> AllocaInst* allocInst = builder.CreateAlloca(argit->getType()); >> args.push_back(allocInst); >> } >> builder.CreateCall(f,args.begin(),args.end()); >> } >> >> This seems to work for functions without parameters (eg. int foo()), but >> once a function has a parameter I get the following assertion error: >> /lib/VMCore/Instructions.cpp:297: void >> llvm::CallInst::init(llvm::Value*, llvm::Value* const*, unsigned int): >> Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == >> Params[i]->getType()) && "Calling a function with a bad signature!"' failed. >> >> I've checked everything I can think of and it all seems correct to me >> ... Any help would be greatly appreciated! >> >> Thanks in advance, >> >> Marc Claesen >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > From bob.wilson at apple.com Wed Nov 11 11:20:24 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 11 Nov 2009 09:20:24 -0800 Subject: [LLVMdev] speed up memcpy intrinsic using ARM Neon registers In-Reply-To: <000001ca62c2$05dbf880$1193e980$%perfetta@arm.com> References: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> <000001ca62c2$05dbf880$1193e980$%perfetta@arm.com> Message-ID: On Nov 11, 2009, at 3:27 AM, Rodolph Perfetta wrote: > > If you know about the alignment, maybe use structured load/store > (vst1.64/vld1.64 {dn-dm}). You may also want to work on whole cache > lines > (64 bytes on A8). You can find more in this discussion: > http://groups.google.com/group/beagleboard/browse_thread/thread/12c7bd415fbc > 0993/e382202f1a92b0f8?lnk=gst&q=memcpy&pli=1 . > >> Even if it's not faster, it's still a code size win which is also >> important. > > Yes but NEON will drive up your power consumption, so if you are not > faster > you will drain your battery faster (assuming you care of course). > > In general we wouldn't recommend writing memcpy using NEON unless > you can > detect the exact core you will be running on: on A9 NEON will not > give you > any speed up, you'll just end up using more power. NEON is a SIMD > engine. > > If one wanted to write memcpy on A9 we would recommend something like: > * do not use NEON > * use PLD (3-6 cache lines ahead, to be tuned) > * ldm/stm whole cache lines (32 bytes on A9) > * align destination Thanks, Rodolph. That is very helpful. Can you comment on David Conrad's message in this thread regarding a ~20 cycle penalty for an ARM store following a NEON store to the same 16-byte block? If the memcpy size is not a multiple of 8, we need some ARM load/store instructions to copy the tail end of it. The context here is LLVM generating inline code for small copies, so if there is a penalty like that, it is probably not worthwhile to use NEON unless the alignment shows that the tail will be in a separate 16- byte block. (And what's up with the 16-byte divisions? I thought the cache lines are 64 bytes....) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091111/1cd1162f/attachment-0001.html From ofv at wanadoo.es Wed Nov 11 11:38:14 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Wed, 11 Nov 2009 18:38:14 +0100 Subject: [LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error References: <4AFAD6D0.60102@gmail.com> Message-ID: <87vdhh55dl.fsf@telefonica.net> Marc Claesen writes: > I'm trying to add function calls in the LLVM IR using the IRBuilder > class. I've read both tutorials about functions but I still get > assertion errors. I allocate memory for all function arguments and pass > them as explained in the tutorial. > > My code is (this function is supposed to add a call to f in bb at pos): > void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) { > std::vector args; > IRBuilder<> builder(bb,pos); > for(Function::arg_iterator argit = > f->arg_begin();argit!=f->arg_end();argit++){ > AllocaInst* allocInst = builder.CreateAlloca(argit->getType()); > args.push_back(allocInst); > } > builder.CreateCall(f,args.begin(),args.end()); > } > > This seems to work for functions without parameters (eg. int foo()), but > once a function has a parameter I get the following assertion error: > /lib/VMCore/Instructions.cpp:297: void > llvm::CallInst::init(llvm::Value*, llvm::Value* const*, unsigned int): > Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == > Params[i]->getType()) && "Calling a function with a bad signature!"' failed. CreateAlloca(someType) returns an AllocaInst* which has type someType*. So if your function takes a parameter of type int, with this chunk of code AllocaInst* allocInst = builder.CreateAlloca(argit->getType()); args.push_back(allocInst); you are passing an int*. This triggers the assert. For now, forget about the allocas. Another issue is that I don't see in your code the _values_ you want to pass to the called function. Apparently you already have the function declaration (Function *f) but you are creating a call to that function, and you need the actual arguments (not the argument types): inf foo(int); // declaration. you already have this elsewhere. foo(10); // call. you need the value (10) to pass to the function. -- ?scar From ggreif at gmail.com Wed Nov 11 12:20:26 2009 From: ggreif at gmail.com (heisenbug) Date: Wed, 11 Nov 2009 10:20:26 -0800 (PST) Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> Message-ID: <367a9c06-fde3-4cc2-bd68-495149c96214@15g2000yqy.googlegroups.com> On 10 Nov., 15:10, me22 wrote: > 2009/11/9 Kenneth Uildriks : > > > > > 1. Conversions to/from other integer types: right now, integer type > > conversions are always explicity specified as either a trunc, a sext, > > or a zext. ?Since the size of intp is not known at IR generation time, > > you can't know whether a conversion to/from intp truncates or extends. > > Now that there are arbitrary-sized integers, couldn't you zext to i256 > then trunc down again, and later let the folder simplify as > appropriate? This is not correct, because i256 occupies too much space in structures, etc. This question came up in the past, and I half-jokingly suggested "i0" as the interger type that can store a null-pointer, and thus every pointer. i0 could be a type alias which gets resolved at the time when sizeof (void*) is first known. But as a nice bonus, conversions between i0 and T* could be omitted. Just my 2 cents. Gabor > > _______________________________________________ > LLVM Developers mailing list > LLVM... at cs.uiuc.edu ? ? ? ?http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From ofv at wanadoo.es Wed Nov 11 12:43:59 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar?= Fuentes) Date: Wed, 11 Nov 2009 19:43:59 +0100 Subject: [LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error In-Reply-To: <4AFAFA9F.5050406@gmail.com> (Marc Claesen's message of "Wed, 11 Nov 2009 18:55:43 +0100") References: <4AFAD6D0.60102@gmail.com> <87vdhh55dl.fsf@telefonica.net> <4AFAFA9F.5050406@gmail.com> Message-ID: <87pr7o6gwg.fsf@telefonica.net> [Please use Reply to All for sending your message to the ml too] Marc Claesen writes: >> Another issue is that I don't see in your code the _values_ you want to >> pass to the called function. Apparently you already have the function >> declaration (Function *f) but you are creating a call to that function, >> and you need the actual arguments (not the argument types): > > That's exactly the problem. I'm trying to initialise values of the > appropriate types as required by a given function and pass those. What > I'm looking for is the appropriate instructions to initialise a > variable of a given type to it's type's default value. I realise this > program will generate useless function calls but it's part of a binary > obfuscation chain. In LLVM there is no such a thing as a type default value. Maybe that concept exists on your language. Creating allocas is not the solution, as the alloca is just uninitialized space on the stack. Suppossing that the function parameters simple enough, like integral or floating point types, and the "default value" is zero, something like this will do (untested): std::vector args; IRBuilder<> builder(bb,pos); for(Function::arg_iterator argit = f->arg_begin();argit!=f->arg_end(); argit++) { Value *arg = Constant::getNullValue(argit->getType()); args.push_back(arg); } builder.CreateCall(f,args.begin(),args.end()); If your arguments are something more fancy, you have more work ahead (for following the platform/language ABI, etc). -- ?scar From clattner at apple.com Wed Nov 11 12:56:28 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 11 Nov 2009 10:56:28 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <367a9c06-fde3-4cc2-bd68-495149c96214@15g2000yqy.googlegroups.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <367a9c06-fde3-4cc2-bd68-495149c96214@15g2000yqy.googlegroups.com> Message-ID: On Nov 11, 2009, at 10:20 AM, heisenbug wrote: > On 10 Nov., 15:10, me22 wrote: >> 2009/11/9 Kenneth Uildriks : >> >> >> >>> 1. Conversions to/from other integer types: right now, integer type >>> conversions are always explicity specified as either a trunc, a sext, >>> or a zext. Since the size of intp is not known at IR generation time, >>> you can't know whether a conversion to/from intp truncates or extends. >> >> Now that there are arbitrary-sized integers, couldn't you zext to i256 >> then trunc down again, and later let the folder simplify as >> appropriate? > > This is not correct, because i256 occupies too much space in > structures, etc. If you're storing it in a structure, just cast it back to an i8* and store it as i8*. -Chris From clattner at apple.com Wed Nov 11 13:11:17 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 11 Nov 2009 11:11:17 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> Message-ID: <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> On Nov 10, 2009, at 4:10 PM, Talin wrote: > I realize that most users of LLVM aren't affected by this, because most frontends aren't target-neutral, and thus know in advance how big a pointer is. At least, that's my impression. I believe that. > There's only a tiny handful of fairly esoteric cases which require selecting a target before you generate IR. Unfortunately, the "pointer the same size as an int" is one of these rare cases - it is something that is very painful to try and work around. (A similar esoteric use case is: "which of the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the union problem.) With this explanation, the idea of adding a union type seems a lot more compelling to me. For the record, I'm not opposed to an intptr_t type or a union type, but the semantics have to be clean and well specified. -Chris From nicholas at mxc.ca Wed Nov 11 14:10:27 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 11 Nov 2009 12:10:27 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> Message-ID: <4AFB1A33.9090104@mxc.ca> Kenneth Uildriks wrote: > On Tue, Nov 10, 2009 at 6:10 PM, Talin wrote: >> In my case, I've been attempting to build a target-neutral frontend. In my >> tool chain, the target is specified at link time, not at compile time. Among >> other things, that means that the same IR file can be used for multiple >> targets. > > That's the direction I'm going in too. > >> What strikes me is how tantalizingly close LLVM comes to being able to do >> this. I am surprised, for example, that I can general all of the DWARF >> debugging structures without ever having to choose a target machine. Most >> things can be done quite easily without knowing the exact size of a pointer. >> When it comes to being able to "generate once, run anywhere", LLVM is like >> 99.5% of the way there. Which makes that last remaining .5% particularly >> vexing. >> >> There's only a tiny handful of fairly esoteric cases which require selecting >> a target before you generate IR. Unfortunately, the "pointer the same size >> as an int" is one of these rare cases - it is something that is very >> painful to try and work around. (A similar esoteric use case is: "which of >> the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the union >> problem.) > > I'm willing to spend some time on adding intp to LLVM... my > front-end's standard libraries would be cleaner and more portable that > way. Sorry, but I'm still opposed. From your description of 'intp' it sounds like it's a strict subset of pointers. You can't sext it, zext it or trunc it, like you can with integers. You can bitcast it, but only to another pointer. The use case you mentioned was that some native system APIs want integers that are the same size as pointers. So why not just declare those arguments or fields with a pointer type in LLVM? Then you've got a field with the right size. Nick From kennethuil at gmail.com Wed Nov 11 14:17:27 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Wed, 11 Nov 2009 14:17:27 -0600 Subject: [LLVMdev] Need help to finish arbitrary-sized aggregate returns support Message-ID: <400d33ea0911111217t24f6ec1nd0ceb7f0ac0099b6@mail.gmail.com> I've got it working on x86. Most of the logic is in SelectionDAGBuild and friends, but there is one target-specific hook (TargetLowering::CanLowerReturn) that needs to be implemented for each target. It should return true if the function can return the value in registers without crashing, and false if the function needs to have a hidden sret-parameter inserted to do the return; i.e., if the aggregate is too large to fit in the registers. The implementation for x86 is very simple, and the implementation for the other targets is *probably* pretty much the same. But I have no way to test it, and no desire to break something. (If CanLowerReturn returns false when it should return true, unexpected ABI mismatches with native external functions will result.). So I will leave it to those who have access to non-X86 machines to fill in the CanLowerReturn implementation for those targets and provide test cases. Once that is done, we can safely return large aggregates in IR without crashing the code generator. From kennethuil at gmail.com Wed Nov 11 14:22:58 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Wed, 11 Nov 2009 14:22:58 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <4AFB1A33.9090104@mxc.ca> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> <4AFB1A33.9090104@mxc.ca> Message-ID: <400d33ea0911111222r16ad65a3l3ff85f1a5baf8fc6@mail.gmail.com> On Wed, Nov 11, 2009 at 2:10 PM, Nick Lewycky wrote: > Kenneth Uildriks wrote: >> >> On Tue, Nov 10, 2009 at 6:10 PM, Talin wrote: >>> >>> In my case, I've been attempting to build a target-neutral frontend. In >>> my >>> tool chain, the target is specified at link time, not at compile time. >>> Among >>> other things, that means that the same IR file can be used for multiple >>> targets. >> >> That's the direction I'm going in too. >> >>> What strikes me is how tantalizingly close LLVM comes to being able to do >>> this. I am surprised, for example, that I can general all of the DWARF >>> debugging structures without ever having to choose a target machine. Most >>> things can be done quite easily without knowing the exact size of a >>> pointer. >>> When it comes to being able to "generate once, run anywhere", LLVM is >>> like >>> 99.5% of the way there. Which makes that last remaining .5% particularly >>> vexing. >>> >>> There's only a tiny handful of fairly esoteric cases which require >>> selecting >>> a target before you generate IR. Unfortunately, the "pointer the same >>> size >>> as an int" is one of these rare cases - ?it is something that is very >>> painful to try and work around. (A similar esoteric use case is: "which >>> of >>> the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the >>> union >>> problem.) >> >> I'm willing to spend some time on adding intp to LLVM... my >> front-end's standard libraries would be cleaner and more portable that >> way. > > Sorry, but I'm still opposed. From your description of 'intp' it sounds like > it's a strict subset of pointers. You can't sext it, zext it or trunc it, > like you can with integers. You can bitcast it, but only to another pointer. You can do integer arithmetic & bitwise operations with it. You can convert it to other types of integers, although you wouldn't be able to tell whether you were truncating or zexting them at IR-generation time (at least not without target data). You can create literal values of intp type. You can, of course, safely convert it to/from a pointer. intp is an integer, not a pointer. It's sized the same as a pointer, so you can use it as a pointer offset, a size parameter, or something along those lines, without having to know how big a pointer. > > The use case you mentioned was that some native system APIs want integers > that are the same size as pointers. So why not just declare those arguments > or fields with a pointer type in LLVM? Then you've got a field with the > right size. But not necessarily the right alignment. Some platforms align pointers differently from ints. From nicholas at mxc.ca Wed Nov 11 14:46:19 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 11 Nov 2009 12:46:19 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911111222r16ad65a3l3ff85f1a5baf8fc6@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> <4AFB1A33.9090104@mxc.ca> <400d33ea0911111222r16ad65a3l3ff85f1a5baf8fc6@mail.gmail.com> Message-ID: <4AFB229B.1050304@mxc.ca> Kenneth Uildriks wrote: > On Wed, Nov 11, 2009 at 2:10 PM, Nick Lewycky wrote: >> Kenneth Uildriks wrote: >>> On Tue, Nov 10, 2009 at 6:10 PM, Talin wrote: >>>> In my case, I've been attempting to build a target-neutral frontend. In >>>> my >>>> tool chain, the target is specified at link time, not at compile time. >>>> Among >>>> other things, that means that the same IR file can be used for multiple >>>> targets. >>> That's the direction I'm going in too. >>> >>>> What strikes me is how tantalizingly close LLVM comes to being able to do >>>> this. I am surprised, for example, that I can general all of the DWARF >>>> debugging structures without ever having to choose a target machine. Most >>>> things can be done quite easily without knowing the exact size of a >>>> pointer. >>>> When it comes to being able to "generate once, run anywhere", LLVM is >>>> like >>>> 99.5% of the way there. Which makes that last remaining .5% particularly >>>> vexing. >>>> >>>> There's only a tiny handful of fairly esoteric cases which require >>>> selecting >>>> a target before you generate IR. Unfortunately, the "pointer the same >>>> size >>>> as an int" is one of these rare cases - it is something that is very >>>> painful to try and work around. (A similar esoteric use case is: "which >>>> of >>>> the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the >>>> union >>>> problem.) >>> I'm willing to spend some time on adding intp to LLVM... my >>> front-end's standard libraries would be cleaner and more portable that >>> way. >> Sorry, but I'm still opposed. From your description of 'intp' it sounds like >> it's a strict subset of pointers. You can't sext it, zext it or trunc it, >> like you can with integers. You can bitcast it, but only to another pointer. > > You can do integer arithmetic & bitwise operations with it. You can > convert it to other types of integers, although you wouldn't be able > to tell whether you were truncating or zexting them at IR-generation > time (at least not without target data). You can create literal > values of intp type. You can, of course, safely convert it to/from a > pointer. I'd be happy to permit arithmetic and bitwise operations on pointers. (I thought we already did. We don't.) You still can't create literal values with it (besides null) because you don't know whether your constant will fit. Or rather, what you get is exactly what the inttoptr instruction already gives you. > intp is an integer, not a pointer. It's sized the same as a pointer, > so you can use it as a pointer offset, a size parameter, or something > along those lines, without having to know how big a pointer. > >> The use case you mentioned was that some native system APIs want integers >> that are the same size as pointers. So why not just declare those arguments >> or fields with a pointer type in LLVM? Then you've got a field with the >> right size. > > But not necessarily the right alignment. Some platforms align > pointers differently from ints. Within a structure or array you mean? Or do you mean that some platforms pass pointers and integers differently as function arguments? Nick From kennethuil at gmail.com Wed Nov 11 14:52:40 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Wed, 11 Nov 2009 14:52:40 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <4AFB229B.1050304@mxc.ca> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> <4AFB1A33.9090104@mxc.ca> <400d33ea0911111222r16ad65a3l3ff85f1a5baf8fc6@mail.gmail.com> <4AFB229B.1050304@mxc.ca> Message-ID: <400d33ea0911111252t3f2be9c5xe7e5458be5897560@mail.gmail.com> On Wed, Nov 11, 2009 at 2:46 PM, Nick Lewycky wrote: > I'd be happy to permit arithmetic and bitwise operations on pointers. (I > thought we already did. We don't.) That would be very helpful too. > > You still can't create literal values with it (besides null) because you > don't know whether your constant will fit. Or rather, what you get is > exactly what the inttoptr instruction already gives you. > Within a structure or array you mean? Or do you mean that some platforms > pass pointers and integers differently as function arguments? > > Nick > I mean within a structure or array. I don't know whether any platforms would pass them any differently as function arguments, but I do know that the "default" data layout (which I believe is the Sparc data layout) aligns int32's on 32-bit boundaries and 32-bit pointers on 64-bit boundaries. From kameo76890 at gmail.com Wed Nov 11 17:46:49 2009 From: kameo76890 at gmail.com (Patrick Kelly) Date: Wed, 11 Nov 2009 18:46:49 -0500 Subject: [LLVMdev] Hello! In-Reply-To: <8bd081200911101637y3d0f6a59k216559fb0a92fae7@mail.gmail.com> References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> <8bd081200911101637y3d0f6a59k216559fb0a92fae7@mail.gmail.com> Message-ID: <9A7C69DB-3644-48E1-B61D-86B3DEF8E62E@gmail.com> On Nov 10, 2009, at 19:37, Patrick Kelly wrote: > > > On Tue, Nov 10, 2009 at 11:24 AM, Patrick Kelly > wrote: > I'm interested in contributing to LLVM, but I'm a rather bad C/C++ > developer. I do most of my work in Ada and was wondering if there > was a way to still contribute to something other than the Ada > frontend. > > Since I didn't elaborate, specifically I want to work on an Ada back- > end. As I understand it, there are already C and C++ backends so it > technically is possible. > > I just want to make sure that theres no complaints to me writing > this in Ada. I meant target -.-, that was a dumb mistake. I got an okay for both the target and frontend so, pleasure to work with you all. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091111/67ac2e78/attachment.html From scook at swri.org Wed Nov 11 18:15:11 2009 From: scook at swri.org (Cook, Stephen W.) Date: Wed, 11 Nov 2009 18:15:11 -0600 Subject: [LLVMdev] LLVM's Makefile System Questions Message-ID: <6681CCE9F4B1494291E208F3F37318AA4208BC@adsms01.dyn.datasys.swri.edu> Hi, I have already successfully created a loadable module to perform a transformation pass that is used by LLVM's opt program. However, now I would like to incorporate a specialized parser (built with flex and bison) within that very same loadable module. This parser's function is to parse a simple language that will be used to specify how and where to perform the transformations. What I have right now is a single cpp file (transform.cpp) and corresponding Makefile in a "project" directory, and a "parser" subdirectory directly under the "project" directory that contains all the parser source code (i.e. lang.l, lang.y, etc.) and corresponding Makefile for creating the scanner and parser object files. The Makefile under the "project" directory (similar to what is in the LLVM documenation) was used successfully to a perform transformation pass using LLVM's opt, but now I am having trouble with incorporating the parser Makefile. I would be very grateful if someone could tell me how to get these two "user" makfiles to coordinate with each other to create one LLVM loadable module using LLVM's makefile system. Some more specific questions are the following: 1) Which variables should I use in the Makefile under the "project" directory to refer to the Makefile in the "parser" subdirectory? Is it something like ( DIRS = parser )? 2) What should the Makefile under the "parser" subdirectory contain to allow the objects created from there to be part of the loadable module specified in project module? How does the default target of "all" fit in here? Note that I am doing some tricks in the "parser" Makefile to create a C++ compatible parser, so I was hoping that I could keep it fairly intact and just modify it somewhat to fit in with LLVM's makefile system. If there is a better way, or if someone could point me to a relevant example please let me know. I will gladly supply more specifics if it will help. I understand the basics of Make but not its advanced features. Thanks in advance for any response, Steve Cook Senior Research Analyst Communications and Embedded Systems Department Southwest Research Institute -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 4229 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091111/e2ca4263/attachment.bin From jon at ffconsultancy.com Wed Nov 11 22:58:27 2009 From: jon at ffconsultancy.com (Jon Harrop) Date: Thu, 12 Nov 2009 04:58:27 +0000 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls Message-ID: <200911120458.27521.jon@ffconsultancy.com> Is "opt" expected to honour tail calls? -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e From idadesub at users.sourceforge.net Thu Nov 12 00:33:52 2009 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Wed, 11 Nov 2009 22:33:52 -0800 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <200911120458.27521.jon@ffconsultancy.com> References: <200911120458.27521.jon@ffconsultancy.com> Message-ID: <1ef034530911112233h1331b6e5r18afde5f03171320@mail.gmail.com> On Wed, Nov 11, 2009 at 8:58 PM, Jon Harrop wrote: > > Is "opt" expected to honour tail calls? I don't believe tail call elimination is on by default. Did you try including the "-tailcallelim" option? From plmdvy at gmail.com Thu Nov 12 00:46:27 2009 From: plmdvy at gmail.com (Paul Davey) Date: Thu, 12 Nov 2009 19:46:27 +1300 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <1ef034530911112233h1331b6e5r18afde5f03171320@mail.gmail.com> References: <200911120458.27521.jon@ffconsultancy.com> <1ef034530911112233h1331b6e5r18afde5f03171320@mail.gmail.com> Message-ID: <9430ad070911112246m77326a85uc321136da304fd9a@mail.gmail.com> tail calls are only implemented for fastcall calling convention if i remeber right from my inquiries. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/e8f1dd2a/attachment.html From Sachin.Punyani at microchip.com Thu Nov 12 02:46:58 2009 From: Sachin.Punyani at microchip.com (Sachin.Punyani at microchip.com) Date: Thu, 12 Nov 2009 01:46:58 -0700 Subject: [LLVMdev] Crash in PBQP register allocator Message-ID: Hi, Please see the two ".ll' files attached. Command line used llc -march=pic16 -pre-RA-sched=list-burr -regalloc=pbqp new.obc The above test case crashes only when I use the combination of list-burr scheduler and pbqp register allocator. If any of them (scheduler or register allocator) is replaced with some alternate then I don't see the crash. I could not figure out the reason. Please provide some pointers to reasons of the crash. Regards Sachin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/dfe0cdc6/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: new.obc.ll.pass Type: application/octet-stream Size: 551 bytes Desc: new.obc.ll.pass Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/dfe0cdc6/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: new.obc.ll.crash Type: application/octet-stream Size: 679 bytes Desc: new.obc.ll.crash Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/dfe0cdc6/attachment-0001.obj From hans at hanshq.net Thu Nov 12 03:05:28 2009 From: hans at hanshq.net (Hans Wennborg) Date: Thu, 12 Nov 2009 10:05:28 +0100 Subject: [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter In-Reply-To: <4AF938D6.3030706@hanshq.net> References: <4AF19306.20803@hanshq.net> <4D39951A-5792-4BBC-9BEF-92540CE91349@apple.com> <4AF938D6.3030706@hanshq.net> Message-ID: <4AFBCFD8.2070908@hanshq.net> After discussing with Nick Lewycky in the IRC channel, here comes a less aggressive patch. We were worried that a constant pointer could alias with a GlobalValue. Also, if one pointer could be a GlobalValue and the other a GlobalAlias with the GlobalValue as aliasee. However, I was not able to produce a test where this happens wihout the getUnderlyingObject() returning the same value. It would be nice if someone could produce such a test case, or dismiss the possibility of this happening. Anyway, saying that a Constant does not alias with a non-const isIdentifiedObject object seems safe. / Hans Hans Wennborg wrote: > Dan Gohman wrote: >> On Nov 4, 2009, at 6:43 AM, Hans Wennborg wrote: >> >>> Here is another change I'd like to suggest to the BasicAliasAnalysis. >>> >>> LLVM fails to remove the dead store in the following code: >>> >>> %t = type { i32 } >>> >>> define void @f(%t* noalias nocapture %stuff ) { >>> %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 >>> >>> store i32 1, i32* %p; <-- This store is dead >>> >>> %x = load i32* inttoptr (i32 12345 to i32*) >>> store i32 %x, i32* %p >>> ret void >>> } >>> >>> >>> when run through >>> ./llvm-as -o - test2.ll | ./opt -O3 -o - | ./llvm-dis -o - >>> >>> >>> The problem is that the alias analysis is unsure about whether %p and >>> 12345 may alias. But since %p is derived from %stuff, which has the >>> noalias attribute, and 12345 is a constant and therefore cannot be >>> derived from %stuff, they cannot alias. >> >> This sounds right. And actually, it's not limited to noalias; >> isIdentifiedObject objects don't alias inttoptr-casted integer >> literals either. I have a few comments on the patch below. >> >>> I'm attaching a patch which implements this. Please comment on >>> whether this is sane, and if my code is the right way of doing it. >>> >>> >>> / Hans >>> Index: lib/Analysis/BasicAliasAnalysis.cpp >>> =================================================================== >>> --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) >>> +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) >>> @@ -643,6 +643,23 @@ >>> if (!isa(V1->getType()) || >>> !isa(V2->getType())) >>> return NoAlias; // Scalars cannot alias each other >>> >>> + // Constant ptr cannot alias with a noalias attribute >>> + if (isa(V1) && isa(V2->getType())) { >>> + while (const GEPOperator *g = dyn_cast(V2)) >>> + V2 = g->getOperand(0); >>> + >>> + if (const Argument *A = dyn_cast(V2)) >>> + if (A->hasNoAliasAttr()) >>> + return NoAlias; >>> + } else if (isa(V2) && isa(V1->getType())) { >>> + while (const GEPOperator *g = dyn_cast(V1)) >>> + V1 = g->getOperand(0); >>> + >>> + if (const Argument *A = dyn_cast(V1)) >>> + if (A->hasNoAliasAttr()) >>> + return NoAlias; >>> + } >> >> The GEP logic here is effectively doing (a subset of) what >> getUnderlyingObject does. It would be better to move these checks >> below the getUnderlyingObject calls just below so that they can >> use the results from those calls instead. >> >> And instead of checking for a no-alias argument, this code could >> use isIdentifiedObject instead, following my comment above. > > Thank you for the input, this certainly made things nicer. I have > attached a patch that does this together with a test case. > > / Hans > >> >> Dan >> >>> // Figure out what objects these things are pointing to if we can. >>> const Value *O1 = V1->getUnderlyingObject(); >>> const Value *O2 = V2->getUnderlyingObject(); >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > > ------------------------------------------------------------------------ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- A non-text attachment was scrubbed... Name: BasicAliasAnalysis2.patch Type: text/x-patch Size: 1996 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/23e81267/attachment.bin From baldrick at free.fr Thu Nov 12 03:42:27 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 12 Nov 2009 10:42:27 +0100 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911111252t3f2be9c5xe7e5458be5897560@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> <4AFB1A33.9090104@mxc.ca> <400d33ea0911111222r16ad65a3l3ff85f1a5baf8fc6@mail.gmail.com> <4AFB229B.1050304@mxc.ca> <400d33ea0911111252t3f2be9c5xe7e5458be5897560@mail.gmail.com> Message-ID: <4AFBD883.6060809@free.fr> > I mean within a structure or array. I don't know whether any > platforms would pass them any differently as function arguments, but I > do know that the "default" data layout (which I believe is the Sparc > data layout) aligns int32's on 32-bit boundaries and 32-bit pointers > on 64-bit boundaries. Wrap the pointer in a packed struct maybe? Ciao, Duncan. From stephan.reiter at gmail.com Thu Nov 12 04:42:42 2009 From: stephan.reiter at gmail.com (Stephan) Date: Thu, 12 Nov 2009 02:42:42 -0800 (PST) Subject: [LLVMdev] Puzzled by results of -O3 In-Reply-To: <4AFAACD0.70807@free.fr> References: <4AFAACD0.70807@free.fr> Message-ID: <6aba3904-5540-4d1e-af92-866e9042f6ed@j4g2000yqe.googlegroups.com> On 11 Nov., 13:23, Duncan Sands wrote: > Hi Stephan, > > > I'm trying to figure out why the following sequence of intructions is > > not collapsed to "ret i32 0" by the opt tool with "-03". > > no target data maybe? > Hmmm, my jitter-based application, which spit out this piece of code, adds target data to the passmanager that's used to carry out code optimizations. So, I think I've got this covered. It's interesting that Timo's approach with a single-value store instead of an aggregate store works. Could it be possible that a type mismatch (pointer to array of ints vs. pointer to int(s)) breaks GVN? Stephan From kennethuil at gmail.com Thu Nov 12 11:20:43 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Thu, 12 Nov 2009 11:20:43 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <4AFBD883.6060809@free.fr> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> <4AFB1A33.9090104@mxc.ca> <400d33ea0911111222r16ad65a3l3ff85f1a5baf8fc6@mail.gmail.com> <4AFB229B.1050304@mxc.ca> <400d33ea0911111252t3f2be9c5xe7e5458be5897560@mail.gmail.com> <4AFBD883.6060809@free.fr> Message-ID: <400d33ea0911120920p76bc0867q6a9f1000e851c92a@mail.gmail.com> On Thu, Nov 12, 2009 at 3:42 AM, Duncan Sands wrote: >> I mean within a structure or array. ?I don't know whether any >> platforms would pass them any differently as function arguments, but I >> do know that the "default" data layout (which I believe is the Sparc >> data layout) aligns int32's on 32-bit boundaries and 32-bit pointers >> on 64-bit boundaries. > > Wrap the pointer in a packed struct maybe? > > Ciao, > > Duncan. > That sets the alignment to 1 unconditionally, which might also be wrong. Now I assume that a one-element regular struct would have the same alignment as the element, right? In that case: 1. A type such as intp will get the following definition: struct { {intAAA, intBBB, intCCC, intDDD, intEEE, intFFF, intGGG, intHHH}*[0]; int32 or int64 }; where AAA, BBB, CCC, DDD, EEE, FFF, GGG, HHH are 16 bit values that combine to form a GUID. Since it's zero-sized, the struct as a whole will align the same way as the int. Then define a transform that looks for the GUID and changes the int32 to the platform-specific intp integer-size. This transform will be run at link time. From mclachlan at apple.com Thu Nov 12 11:53:13 2009 From: mclachlan at apple.com (Jon McLachlan) Date: Thu, 12 Nov 2009 09:53:13 -0800 Subject: [LLVMdev] Google's Go In-Reply-To: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> Message-ID: <9A9798E2-BBD0-4094-B070-86C28BEA3431@apple.com> Any plans to make LLVM work with Google's new language, Go? http://www.technewsworld.com/story/Go-Go-Google-Programming-Language-68622.html?wlc=1257974768&wlc=1258041607&wlc=1258047741 From jyasskin at google.com Thu Nov 12 12:25:03 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Thu, 12 Nov 2009 10:25:03 -0800 Subject: [LLVMdev] Google's Go In-Reply-To: <9A9798E2-BBD0-4094-B070-86C28BEA3431@apple.com> References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> <9A9798E2-BBD0-4094-B070-86C28BEA3431@apple.com> Message-ID: That's a better question for the Go developers. AFAIK, the only thing they rely on that isn't already in LLVM is segmented stacks, and Ian had to add that to gcc too. On Thu, Nov 12, 2009 at 9:53 AM, Jon McLachlan wrote: > Any plans to make LLVM work with Google's new language, Go? > > http://www.technewsworld.com/story/Go-Go-Google-Programming-Language-68622.html?wlc=1257974768&wlc=1258041607&wlc=1258047741 From eocallaghan at auroraux.org Thu Nov 12 12:25:48 2009 From: eocallaghan at auroraux.org (Edward O'Callaghan) Date: Thu, 12 Nov 2009 18:25:48 +0000 Subject: [LLVMdev] Google's Go In-Reply-To: <9A9798E2-BBD0-4094-B070-86C28BEA3431@apple.com> References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> <9A9798E2-BBD0-4094-B070-86C28BEA3431@apple.com> Message-ID: <521640720911121025g100f49d0red7a0a4bb1cf9bcb@mail.gmail.com> No, its up to them which backend they want to use. Sounds like they think that GCC is super quick compared to LLVM. Looks like another fud fart out of google to me. 2009/11/12 Jon McLachlan : > Any plans to make LLVM work with Google's new language, Go? > > http://www.technewsworld.com/story/Go-Go-Google-Programming-Language-68622.html?wlc=1257974768&wlc=1258041607&wlc=1258047741 > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > -- -- Edward O'Callaghan http://www.auroraux.org/ eocallaghan at auroraux dot org From evan.cheng at apple.com Thu Nov 12 12:39:31 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 12 Nov 2009 10:39:31 -0800 Subject: [LLVMdev] Google's Go In-Reply-To: <521640720911121025g100f49d0red7a0a4bb1cf9bcb@mail.gmail.com> References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> <9A9798E2-BBD0-4094-B070-86C28BEA3431@apple.com> <521640720911121025g100f49d0red7a0a4bb1cf9bcb@mail.gmail.com> Message-ID: On Nov 12, 2009, at 10:25 AM, Edward O'Callaghan wrote: > No, its up to them which backend they want to use. > Sounds like they think that GCC is super quick compared to LLVM. Looks > like another fud fart out of google to me. Edward, this is no place for comments like this. Evan > > 2009/11/12 Jon McLachlan : >> Any plans to make LLVM work with Google's new language, Go? >> >> http://www.technewsworld.com/story/Go-Go-Google-Programming-Language-68622.html?wlc=1257974768&wlc=1258041607&wlc=1258047741 >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > > > > -- > -- > Edward O'Callaghan > http://www.auroraux.org/ > eocallaghan at auroraux dot org > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From gohman at apple.com Thu Nov 12 12:54:30 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 12 Nov 2009 10:54:30 -0800 Subject: [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter In-Reply-To: <4AFBCFD8.2070908@hanshq.net> References: <4AF19306.20803@hanshq.net> <4D39951A-5792-4BBC-9BEF-92540CE91349@apple.com> <4AF938D6.3030706@hanshq.net> <4AFBCFD8.2070908@hanshq.net> Message-ID: On Nov 12, 2009, at 1:05 AM, Hans Wennborg wrote: > After discussing with Nick Lewycky in the IRC channel, here comes a less aggressive patch. > > We were worried that a constant pointer could alias with a GlobalValue. It can. You can have a GetElementPtr ConstantExpr which aliases a GlobalValue, for example. What problem does this cause though? > Also, if one pointer could be a GlobalValue and the other a GlobalAlias with the GlobalValue as aliasee. > However, I was not able to produce a test where this happens wihout the getUnderlyingObject() returning the same value. AliasAnalysis::isIdentifiedObject knows that GlobalAlias and ConstantExpr values are not "identified objects", so I don't see the trouble here. Also, getUnderlyingObject() knows how to look through (non-weak) GlobalAliases. Dan > It would be nice if someone could produce such a test case, or dismiss the possibility of this happening. > > > Anyway, saying that a Constant does not alias with a non-const isIdentifiedObject object seems safe. > > / Hans > From resistor at mac.com Thu Nov 12 12:59:51 2009 From: resistor at mac.com (Owen Anderson) Date: Thu, 12 Nov 2009 10:59:51 -0800 Subject: [LLVMdev] Google's Go In-Reply-To: <521640720911121025g100f49d0red7a0a4bb1cf9bcb@mail.gmail.com> References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> <9A9798E2-BBD0-4094-B070-86C28BEA3431@apple.com> <521640720911121025g100f49d0red7a0a4bb1cf9bcb@mail.gmail.com> Message-ID: <84797702-8A42-4209-8127-C1767659DFD4@mac.com> On Nov 12, 2009, at 10:25 AM, Edward O'Callaghan wrote: > No, its up to them which backend they want to use. > Sounds like they think that GCC is super quick compared to LLVM. Looks > like another fud fart out of google to me. Actually, after chatting with Ian about it, it's more of a case of the FAQ being poorly worded than them being anti-LLVM. If you read it closely, it says that LLVM was too slow for 6g, which is their ultra-fast, non-optimizing implementation based on the Plan9 compilers. In this case, the assertion that LLVM is slow is correct: it's definitely slower than a non-optimizing compiler. They then later implemented an optimizing implementation, which they based on GCC because they had a team member (Ian) who is a GCC expert. On the positive side, Ian seemed very positive and even encouraging that his GCCGo frontend might be retargettable from GCC to LLVM, so I wouldn't rule it out as a possibility if some interested community members stepped up to do it. --Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/556dafb6/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2620 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/556dafb6/attachment.bin From eocallaghan at auroraux.org Thu Nov 12 13:03:58 2009 From: eocallaghan at auroraux.org (Edward O'Callaghan) Date: Thu, 12 Nov 2009 19:03:58 +0000 Subject: [LLVMdev] Google's Go In-Reply-To: References: <8DC98F49-DA18-48B4-A625-5BC07ED71436@gmail.com> <9A9798E2-BBD0-4094-B070-86C28BEA3431@apple.com> <521640720911121025g100f49d0red7a0a4bb1cf9bcb@mail.gmail.com> Message-ID: <521640720911121103m35aa0f8yf83961a044a2b67b@mail.gmail.com> Sorry :| no bad intentions.. 2009/11/12 Evan Cheng : > On Nov 12, 2009, at 10:25 AM, Edward O'Callaghan wrote: > >> No, its up to them which backend they want to use. >> Sounds like they think that GCC is super quick compared to LLVM. Looks >> like another fud fart out of google to me. > > Edward, this is no place for comments like this. > > Evan > >> >> 2009/11/12 Jon McLachlan : >>> >>> Any plans to make LLVM work with Google's new language, Go? >>> >>> >>> http://www.technewsworld.com/story/Go-Go-Google-Programming-Language-68622.html?wlc=1257974768&wlc=1258041607&wlc=1258047741 >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >> >> >> >> -- >> -- >> Edward O'Callaghan >> http://www.auroraux.org/ >> eocallaghan at auroraux dot org >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > -- -- Edward O'Callaghan http://www.auroraux.org/ eocallaghan at auroraux dot org From baldrick at free.fr Thu Nov 12 13:16:19 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 12 Nov 2009 20:16:19 +0100 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <400d33ea0911120920p76bc0867q6a9f1000e851c92a@mail.gmail.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <400d33ea0911101641s1c9d2477x544fcd1df17ff7d5@mail.gmail.com> <4AFB1A33.9090104@mxc.ca> <400d33ea0911111222r16ad65a3l3ff85f1a5baf8fc6@mail.gmail.com> <4AFB229B.1050304@mxc.ca> <400d33ea0911111252t3f2be9c5xe7e5458be5897560@mail.gmail.com> <4AFBD883.6060809@free.fr> <400d33ea0911120920p76bc0867q6a9f1000e851c92a@mail.gmail.com> Message-ID: <4AFC5F03.7090600@free.fr> Hi Kenneth, > On Thu, Nov 12, 2009 at 3:42 AM, Duncan Sands wrote: >>> I mean within a structure or array. I don't know whether any >>> platforms would pass them any differently as function arguments, but I >>> do know that the "default" data layout (which I believe is the Sparc >>> data layout) aligns int32's on 32-bit boundaries and 32-bit pointers >>> on 64-bit boundaries. >> Wrap the pointer in a packed struct maybe? >> >> Ciao, >> >> Duncan. >> > > That sets the alignment to 1 unconditionally, which might also be wrong. you just have to set the alignment you want on alloca, add explicit struct padding etc, to get the effect of the alignment you are seeking. Of course to do this you need to know the alignment... Ciao, Duncan. From gohman at apple.com Thu Nov 12 13:28:08 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 12 Nov 2009 11:28:08 -0800 Subject: [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter In-Reply-To: <4AFBCFD8.2070908@hanshq.net> References: <4AF19306.20803@hanshq.net> <4D39951A-5792-4BBC-9BEF-92540CE91349@apple.com> <4AF938D6.3030706@hanshq.net> <4AFBCFD8.2070908@hanshq.net> Message-ID: Hello Hans, This patch looks fine. I've now talked with Nick on IRC and I've gone re-read your previous patch and found what I was confused about. Your original email talked about inttoptr-casted integer constants, and I missed that the patch itself was using isa instead, which covers a lot of other kinds of things. So while it's true that constants don't alias non-constant identified objects and your new patch is fine, it's also true that the special case of inttoptr-casted constant ints don't alias *any* identified objects, in case you're interested in that too. Dan On Nov 12, 2009, at 1:05 AM, Hans Wennborg wrote: > After discussing with Nick Lewycky in the IRC channel, here comes a less aggressive patch. > > We were worried that a constant pointer could alias with a GlobalValue. > Also, if one pointer could be a GlobalValue and the other a GlobalAlias with the GlobalValue as aliasee. > However, I was not able to produce a test where this happens wihout the getUnderlyingObject() returning the same value. > > It would be nice if someone could produce such a test case, or dismiss the possibility of this happening. > > > Anyway, saying that a Constant does not alias with a non-const isIdentifiedObject object seems safe. > > / Hans > > > Hans Wennborg wrote: >> Dan Gohman wrote: >>> On Nov 4, 2009, at 6:43 AM, Hans Wennborg wrote: >>> >>>> Here is another change I'd like to suggest to the BasicAliasAnalysis. >>>> >>>> LLVM fails to remove the dead store in the following code: >>>> >>>> %t = type { i32 } >>>> >>>> define void @f(%t* noalias nocapture %stuff ) { >>>> %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 >>>> >>>> store i32 1, i32* %p; <-- This store is dead >>>> >>>> %x = load i32* inttoptr (i32 12345 to i32*) >>>> store i32 %x, i32* %p >>>> ret void >>>> } >>>> >>>> >>>> when run through >>>> ./llvm-as -o - test2.ll | ./opt -O3 -o - | ./llvm-dis -o - >>>> >>>> >>>> The problem is that the alias analysis is unsure about whether %p and 12345 may alias. But since %p is derived from %stuff, which has the noalias attribute, and 12345 is a constant and therefore cannot be derived from %stuff, they cannot alias. >>> >>> This sounds right. And actually, it's not limited to noalias; >>> isIdentifiedObject objects don't alias inttoptr-casted integer >>> literals either. I have a few comments on the patch below. >>> >>>> I'm attaching a patch which implements this. Please comment on whether this is sane, and if my code is the right way of doing it. >>>> >>>> >>>> / Hans >>>> Index: lib/Analysis/BasicAliasAnalysis.cpp >>>> =================================================================== >>>> --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) >>>> +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) >>>> @@ -643,6 +643,23 @@ >>>> if (!isa(V1->getType()) || !isa(V2->getType())) >>>> return NoAlias; // Scalars cannot alias each other >>>> >>>> + // Constant ptr cannot alias with a noalias attribute >>>> + if (isa(V1) && isa(V2->getType())) { >>>> + while (const GEPOperator *g = dyn_cast(V2)) >>>> + V2 = g->getOperand(0); >>>> + >>>> + if (const Argument *A = dyn_cast(V2)) >>>> + if (A->hasNoAliasAttr()) >>>> + return NoAlias; >>>> + } else if (isa(V2) && isa(V1->getType())) { >>>> + while (const GEPOperator *g = dyn_cast(V1)) >>>> + V1 = g->getOperand(0); >>>> + >>>> + if (const Argument *A = dyn_cast(V1)) >>>> + if (A->hasNoAliasAttr()) >>>> + return NoAlias; >>>> + } >>> >>> The GEP logic here is effectively doing (a subset of) what >>> getUnderlyingObject does. It would be better to move these checks >>> below the getUnderlyingObject calls just below so that they can >>> use the results from those calls instead. >>> >>> And instead of checking for a no-alias argument, this code could >>> use isIdentifiedObject instead, following my comment above. >> Thank you for the input, this certainly made things nicer. I have attached a patch that does this together with a test case. >> / Hans >>> >>> Dan >>> >>>> // Figure out what objects these things are pointing to if we can. >>>> const Value *O1 = V1->getUnderlyingObject(); >>>> const Value *O2 = V2->getUnderlyingObject(); >>>> _______________________________________________ >>>> LLVM Developers mailing list >>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >> ------------------------------------------------------------------------ >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From viridia at gmail.com Thu Nov 12 13:29:50 2009 From: viridia at gmail.com (Talin) Date: Thu, 12 Nov 2009 11:29:50 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> Message-ID: On Wed, Nov 11, 2009 at 11:11 AM, Chris Lattner wrote: > On Nov 10, 2009, at 4:10 PM, Talin wrote: > > I realize that most users of LLVM aren't affected by this, because most > frontends aren't target-neutral, and thus know in advance how big a pointer > is. At least, that's my impression. > > I believe that. > > > There's only a tiny handful of fairly esoteric cases which require > selecting a target before you generate IR. Unfortunately, the "pointer the > same size as an int" is one of these rare cases - it is something that is > very painful to try and work around. (A similar esoteric use case is: "which > of the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the > union problem.) > > With this explanation, the idea of adding a union type seems a lot more > compelling to me. For the record, I'm not opposed to an intptr_t type or a > union type, but the semantics have to be clean and well specified. > > -Chris Well, as far as intp goes (or iptr if you prefer - the naming convention in LLVM is i), here's what I would expect: - General rule #1: If an instruction accepts both i32 and i64, then it should accept iptr as well. If it only accepts i32, then it can continue to only accept i32. - General rule #2: It should support operations that are commonly used with size_t and ptrdiff_t. - Operations that should work with iptr: - Basic math: add, subtract, multiply, divide, mod. - Bitwise binary operators: shl, ashr, lshr, and, or, xor, etc. - Comparison operations. - alloca - currently doesn't work with i64, should it? - GEP - rules are the same as for using i64 indices. - memcpy intrinsics - bit manipulation intrinsics - overflow arithmetic intrinsics - would be nice - atomic intrinsics - would be very nice (I assume that atomic iptr works on all platforms that support atomics: That is, on 32-bit platforms where iptr == i32 I expect atomic i32 to work; on 64-bit platforms where iptr == i64 I expect atomic i64 to work). - Operations that don't need to work with iptr - i.e. I don't mind having to convert to some other int type first: - switch - extractelement / insertelement / shufflevector - extractvalue / insertvalue - not sure about these. - code generator intrinsics (frameaddress, etc.) - Converting to pointer types: inttoptr and ptrtoint should be no-ops, effectively. - Converting to other integer types: The issue here is that with other integer conversions in LLVM, you are required to know whether or not you are converting to a larger or smaller size - whether to use an ext or a trunc instruction. When converting to pointers, however, the choice of trunc or ext is automatic. Ideally, conversion to iptr would work the same way as conversion to a pointer type. There's also the issue of signed vs. unsigned extension. - Note that some constant-folding operations would need to be deferred until the target size is established. - Converting to FP types: Either don't support (i.e. require casting to known-width integer first), or map to i32->FP or i64->FP after the size is known. -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/ba266ae2/attachment.html From isanbard at gmail.com Thu Nov 12 13:30:17 2009 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 12 Nov 2009 11:30:17 -0800 Subject: [LLVMdev] SVN is Down Message-ID: <796FD6BB-D686-46D5-94AF-735C0F2DCD81@gmail.com> SVN is down. -bw From criswell at uiuc.edu Thu Nov 12 13:33:14 2009 From: criswell at uiuc.edu (John Criswell) Date: Thu, 12 Nov 2009 13:33:14 -0600 Subject: [LLVMdev] SVN is Down In-Reply-To: <796FD6BB-D686-46D5-94AF-735C0F2DCD81@gmail.com> References: <796FD6BB-D686-46D5-94AF-735C0F2DCD81@gmail.com> Message-ID: <4AFC62FA.2080002@uiuc.edu> Bill Wendling wrote: > SVN is down. > The LLVM server is being moved to a different machine at Siebel Center today. I believe email was sent to llvmdev about it a week ago. The outage will hopefully not last too much longer. -- John T. > -bw > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From kennethuil at gmail.com Thu Nov 12 13:41:31 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Thu, 12 Nov 2009 13:41:31 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> Message-ID: <400d33ea0911121141y4db1407ak293e347dee1986c7@mail.gmail.com> > Well, as far as intp goes (or iptr if you prefer - the naming convention in > LLVM is i), here's what I would expect: > > General rule #1: If an instruction accepts both i32 and i64, then it should > accept iptr as well. If it only accepts i32, then it can continue to only > accept i32. > General rule #2: It should support operations that are commonly used with > size_t and ptrdiff_t. > Operations that should work with iptr: > > Basic math: add, subtract, multiply, divide, mod. > Bitwise binary operators: shl, ashr, lshr, and, or, xor, etc. > Comparison operations. > alloca - currently doesn't work with i64, should it? I would say it should work with iptr. It's the size of a region of memory after all, and that's one of the things that iptr is *supposed* to be used for. For that matter, I was surprised to find that it didn't work with i64... > GEP - rules are the same as for using i64 indices. > memcpy intrinsics > bit manipulation intrinsics > overflow arithmetic intrinsics - would be nice > atomic intrinsics - would be very nice (I assume that atomic iptr works on > all platforms that support atomics: That is, on 32-bit platforms where iptr > == i32 I expect atomic i32 to work; on 64-bit platforms where iptr == i64 I > expect atomic i64 to work). > > Operations that don't need to work with iptr - i.e. I don't mind having to > convert to some other int type first: > > switch > extractelement / insertelement / shufflevector > extractvalue / insertvalue - not sure about these. > code generator intrinsics (frameaddress, etc.) > > Converting to pointer types:?inttoptr and ptrtoint should be no-ops, > effectively. > Converting to other integer types: The issue here is that with other integer > conversions in LLVM, you are required to know whether or not you are > converting to a larger or smaller size - whether to use an ext or a trunc > instruction. When converting to pointers, however, the choice of trunc or > ext is automatic. Ideally, conversion to iptr would work the same way as > conversion to a pointer type. There's also the issue of signed vs. unsigned > extension. The best thing I can think of is for conversions to/from iptr to use zext/sext, whether or not it's actually extending anything. I need to do some digging and see if that would break anything. > > Note that some constant-folding operations would need to be deferred until > the target size is established. > > Converting to FP types: Either don't support (i.e. require casting to > known-width integer first), or map to i32->FP or i64->FP after the size is > known. > > -- > -- Talin > From criswell at uiuc.edu Thu Nov 12 13:43:27 2009 From: criswell at uiuc.edu (John Criswell) Date: Thu, 12 Nov 2009 13:43:27 -0600 Subject: [LLVMdev] libLTO on Mac OS X Message-ID: <4AFC655F.8070008@uiuc.edu> Dear LLVMers, I'm currently working on creating an alternate libLTO.so that will run some whole-program analysis and transforms of mine during the final linking of an executable. The idea is for it to link all of the bitcode files together, run the regular LTO passes, and then run my passes. For Linux, I should be able to get the Gold linker to load my libLTO.so instead of the standard one, thereby allowing my passes to be run seamlessly when compiling large programs with complicated build systems. Can something similar be done on Mac OS X? Does the XCode linker dynamically load libLTO.dylib to perform link-time optimization? -- John T. From clattner at apple.com Thu Nov 12 13:51:30 2009 From: clattner at apple.com (Chris Lattner) Date: Thu, 12 Nov 2009 11:51:30 -0800 Subject: [LLVMdev] libLTO on Mac OS X In-Reply-To: <4AFC655F.8070008@uiuc.edu> References: <4AFC655F.8070008@uiuc.edu> Message-ID: <4B5757A6-453F-4895-B346-817EE7065F6B@apple.com> On Nov 12, 2009, at 11:43 AM, John Criswell wrote: > Dear LLVMers, > > I'm currently working on creating an alternate libLTO.so that will run > some whole-program analysis and transforms of mine during the final > linking of an executable. The idea is for it to link all of the > bitcode > files together, run the regular LTO passes, and then run my passes. > For > Linux, I should be able to get the Gold linker to load my libLTO.so > instead of the standard one, thereby allowing my passes to be run > seamlessly when compiling large programs with complicated build > systems. > > Can something similar be done on Mac OS X? Does the XCode linker > dynamically load libLTO.dylib to perform link-time optimization? Yes, it looks relative to itself to find it. If you link with / Developer/usr/bin/ld, it uses /Developer/usr/lib/libLTO.dylib. -Chris From criswell at uiuc.edu Thu Nov 12 13:57:41 2009 From: criswell at uiuc.edu (John Criswell) Date: Thu, 12 Nov 2009 13:57:41 -0600 Subject: [LLVMdev] SVN is Down In-Reply-To: <4AFC62FA.2080002@uiuc.edu> References: <796FD6BB-D686-46D5-94AF-735C0F2DCD81@gmail.com> <4AFC62FA.2080002@uiuc.edu> Message-ID: <4AFC68B5.5060801@uiuc.edu> John Criswell wrote: > Bill Wendling wrote: > >> SVN is down. >> >> > The LLVM server is being moved to a different machine at Siebel Center > today. I believe email was sent to llvmdev about it a week ago. > > The outage will hopefully not last too much longer. > Update: The server is in its new location and is currently doing an ext3 disk-check (which is taking awhile). I don't have a quantitative estimate on when it will be back online, but things are going smoothly, and hopefully it will be online soon. -- John T. From lattner at apple.com Thu Nov 12 14:07:32 2009 From: lattner at apple.com (Tanya Lattner) Date: Thu, 12 Nov 2009 12:07:32 -0800 Subject: [LLVMdev] SVN is Down In-Reply-To: <796FD6BB-D686-46D5-94AF-735C0F2DCD81@gmail.com> References: <796FD6BB-D686-46D5-94AF-735C0F2DCD81@gmail.com> Message-ID: <1D7B538D-8A72-4D36-A4EC-464A5CE26A1E@apple.com> I sent an announcement to the list about this scheduled downtime. -Tanya On Nov 12, 2009, at 11:30 AM, Bill Wendling wrote: > SVN is down. > > -bw > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From me22.ca at gmail.com Thu Nov 12 14:11:35 2009 From: me22.ca at gmail.com (me22) Date: Thu, 12 Nov 2009 15:11:35 -0500 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> Message-ID: 2009/11/12 Talin : > > Converting to pointer types:?inttoptr and ptrtoint should be no-ops, > effectively. > Converting to other integer types: The issue here is that with other integer > conversions in LLVM, you are required to know whether or not you are > converting to a larger or smaller size - whether to use an ext or a trunc > instruction. When converting to pointers, however, the choice of trunc or > ext is automatic. Ideally, conversion to iptr would work the same way as > conversion to a pointer type. There's also the issue of signed vs. unsigned > extension. > What about just allowing iptr to be considered a pointer? %x = ptrtoint iptr %X to i8 ; yields truncation on 32-bit architecture %y = ptrtoint iptr %Y to i64 ; yields zero extension on 32-bit architecture From wendling at apple.com Thu Nov 12 14:51:24 2009 From: wendling at apple.com (Bill Wendling) Date: Thu, 12 Nov 2009 12:51:24 -0800 Subject: [LLVMdev] SVN is Down In-Reply-To: <1D7B538D-8A72-4D36-A4EC-464A5CE26A1E@apple.com> References: <796FD6BB-D686-46D5-94AF-735C0F2DCD81@gmail.com> <1D7B538D-8A72-4D36-A4EC-464A5CE26A1E@apple.com> Message-ID: <4CDE6519-6144-4749-8A6C-F839E26E0BCA@apple.com> I forgot about that...:-( -bw On Nov 12, 2009, at 12:07 PM, Tanya Lattner wrote: > I sent an announcement to the list about this scheduled downtime. > > -Tanya > > On Nov 12, 2009, at 11:30 AM, Bill Wendling wrote: > >> SVN is down. >> >> -bw >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From wendling at apple.com Thu Nov 12 15:28:55 2009 From: wendling at apple.com (Bill Wendling) Date: Thu, 12 Nov 2009 13:28:55 -0800 Subject: [LLVMdev] Bootstrap Failure Message-ID: <0E9F555F-D09E-4E70-B405-A53D29366690@apple.com> Hi all, There's been a recent bootstrap failure that might be covered up because of another failure. I just wanted to point this out so that people can take a look: -bw Here's the failure from our buildbot: Assertion failed: (DestReg == VirtReg && "Unknown load situation!"), function RewriteMBB, file /Volumes/Sandbox/Buildbot/llvm/build.llvm- gcc-x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~obj/src/lib/ CodeGen/VirtRegRewriter.cpp, line 2294. /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/xgcc -B/Volumes/ Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/ -B/Developer/usr/ llvm-gcc-4.2/i686-apple-darwin10/bin/ -B/Developer/usr/llvm-gcc-4.2/ i686-apple-darwin10/lib/ -isystem /Developer/usr/llvm-gcc-4.2/i686- apple-darwin10/include -isystem /Developer/usr/llvm-gcc-4.2/i686-apple- darwin10/sys-include -mmacosx-version-min=10.4 -O2 -O2 -g -O2 - DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing- prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g - DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I/ Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/Buildbot/llvm/ build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/ src/gcc/. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../include - I./../intl -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libcpp/ include -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../ libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/ build.llvm-gcc-x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/ Developer/usr/local/include -DL_ucmpdi2 -fvisibility=hidden - DHIDE_EXPORTS -c /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c -o libgcc/./_ucmpdi2.o /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/xgcc -B/Volumes/ Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/ -B/Developer/usr/ llvm-gcc-4.2/i686-apple-darwin10/bin/ -B/Developer/usr/llvm-gcc-4.2/ i686-apple-darwin10/lib/ -isystem /Developer/usr/llvm-gcc-4.2/i686- apple-darwin10/include -isystem /Developer/usr/llvm-gcc-4.2/i686-apple- darwin10/sys-include -mmacosx-version-min=10.4 -O2 -O2 -g -O2 - DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing- prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g - DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I/ Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/Buildbot/llvm/ build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/ src/gcc/. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../include - I./../intl -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libcpp/ include -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../ libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/ build.llvm-gcc-x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~dst/ Developer/usr/local/include -DL_clear_cache -fvisibility=hidden - DHIDE_EXPORTS -c /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c -o libgcc/./_clear_cache.o /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:1174: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make[5]: *** [libgcc/./_cmpdi2.o] Error 1 make[5]: *** Waiting for unfinished jobs.... Assertion failed: (DestReg == VirtReg && "Unknown load situation!"), function RewriteMBB, file /Volumes/Sandbox/Buildbot/llvm/build.llvm- gcc-x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~obj/src/lib/ CodeGen/VirtRegRewriter.cpp, line 2294. /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:1193: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make[5]: *** [libgcc/./_ucmpdi2.o] Error 1 # APPLE LOCAL use -mlongcall for large text support /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/xgcc -B/Volumes/ Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/ -B/Developer/usr/ llvm-gcc-4.2/i686-apple-darwin10/bin/ -B/Developer/usr/llvm-gcc-4.2/ i686-apple-darwin10/lib/ -isystem /Developer/usr/llvm-gcc-4.2/i686- apple-darwin10/include -isystem /Developer/usr/llvm-gcc-4.2/i686-apple- darwin10/sys-include -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition - isystem ./include -I. -I. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm- gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc -I/ Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmgcc42.roots/llvmgcc42~obj/src/gcc/. -I/Volumes/Sandbox/Buildbot/ llvm/build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ llvmgcc42~obj/src/gcc/../include -I./../intl -I/Volumes/Sandbox/ Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ llvmgcc42~obj/src/gcc/../libcpp/include -I/Volumes/Sandbox/Buildbot/ llvm/build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ llvmgcc42~obj/src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/ Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ llvmCore.roots/llvmCore~dst/Developer/usr/local/include -mlongcall \ -fno-tree-dominator-opts \ \ -c /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/config/darwin-crt3.c -o crt3.o make[4]: *** [stmp-multilib] Error 2 rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gcc.pod gpl.pod make[3]: *** [all-stage1-gcc] Error 2 make[2]: *** [stage1-bubble] Error 2 make[1]: *** [all] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/c4573027/attachment.html From wendling at apple.com Thu Nov 12 15:49:39 2009 From: wendling at apple.com (Bill Wendling) Date: Thu, 12 Nov 2009 13:49:39 -0800 Subject: [LLVMdev] Bootstrap Failure In-Reply-To: <0E9F555F-D09E-4E70-B405-A53D29366690@apple.com> References: <0E9F555F-D09E-4E70-B405-A53D29366690@apple.com> Message-ID: These are the likely culprits. David, it looks likely one of yours. Could you investigate please? And/or revert Changed by: greened Changed at: Thu 12 Nov 2009 12:14:53 Revision: 87016 Changed files: include/llvm/CodeGen/AsmPrinter.h Comments: Add comment flags so AsmPrinter can output additional information when emitting comments. These flags carry semantic information not otherwise easily derivable from the IR text. Changed by: greened Changed at: Thu 12 Nov 2009 12:24:53 Revision: 87018 Changed files: include/llvm/CodeGen/MachineInstr.h Comments: Add AsmPrinter comment flags to machine instructions so that AsmPrinter can emit extra information in comments. Changed by: greened Changed at: Thu 12 Nov 2009 12:29:53 Revision: 87019 Changed files: include/llvm/CodeGen/PseudoSourceValue.h lib/CodeGen/PseudoSourceValue.cpp Comments: Make FixedStackPseudoSourceValue a first-class PseudoSourceValue by making it visible to clients and adding LLVM-style cast capability. This will be used by AsmPrinter to determine when to emit spill comments for an instruction. Changed by: d0k Changed at: Thu 12 Nov 2009 12:39:53 Revision: 87020 Changed files: include/llvm/ADT/StringRef.h lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Support/StringRef.cpp lib/Target/X86/X86ISelLowering.cpp tools/bugpoint/ToolRunner.cpp Comments: Add compare_lower and equals_lower methods to StringRef. Switch all users of StringsEqualNoCase (from StringExtras.h) to it. Changed by: greened Changed at: Thu 12 Nov 2009 12:49:53 Revision: 87022 Changed files: include/llvm/CodeGen/MachineFrameInfo.h lib/CodeGen/MachineFunction.cpp lib/CodeGen/PreAllocSplitting.cpp lib/CodeGen/PrologEpilogInserter.cpp lib/CodeGen/RegAllocLocal.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp lib/CodeGen/VirtRegMap.cpp lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/Alpha/AlphaISelLowering.cpp lib/Target/Blackfin/BlackfinISelLowering.cpp lib/Target/Blackfin/BlackfinRegisterInfo.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/MSP430/MSP430ISelLowering.cpp lib/Target/MSP430/MSP430RegisterInfo.cpp lib/Target/Mips/MipsISelLowering.cpp lib/Target/Mips/MipsRegisterInfo.cpp lib/Target/PIC16/PIC16ISelLowering.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCRegisterInfo.cpp lib/Target/Sparc/SparcISelLowering.cpp lib/Target/SystemZ/SystemZISelLowering.cpp lib/Target/X86/X86FastISel.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86RegisterInfo.cpp lib/Target/XCore/XCoreISelLowering.cpp lib/Target/XCore/XCoreRegisterInfo.cpp Comments: Add a bool flag to StackObjects telling whether they reference spill slots. The AsmPrinter will use this information to determine whether to print a spill/reload comment. Remove default argument values. It's too easy to pass a wrong argument value when multiple arguments have default values. Make everything explicit to trap bugs early. Update all targets to adhere to the new interfaces.. Changed by: greened Changed at: Thu 12 Nov 2009 12:57:30 Revision: 87026 Changed files: include/llvm/Target/TargetInstrInfo.h lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86InstrInfo.h Comments: Add hasLoadFromStackSlot and hasStoreToStackSlot to return whether a machine instruction loads or stores from/to a stack slot. Unlike isLoadFromStackSlot and isStoreFromStackSlot, the instruction may be something other than a pure load/store (e.g. it may be an arithmetic operation with a memory operand). This helps AsmPrinter determine when to print a spill/reload comment. This is only a hint since we may not be able to figure this out in all cases. As such, it should not be relied upon for correctness. Implement for X86. Return false by default for other architectures. On Nov 12, 2009, at 1:28 PM, Bill Wendling wrote: > Hi all, > > There's been a recent bootstrap failure that might be covered up > because of another failure. I just wanted to point this out so that > people can take a look: > > -bw > > Here's the failure from our buildbot: > > Assertion failed: (DestReg == VirtReg && "Unknown load situation!"), > function RewriteMBB, file /Volumes/Sandbox/Buildbot/llvm/build.llvm- > gcc-x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~obj/src/lib/ > CodeGen/VirtRegRewriter.cpp, line 2294. > /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/xgcc -B/ > Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/ -B/ > Developer/usr/llvm-gcc-4.2/i686-apple-darwin10/bin/ -B/Developer/usr/ > llvm-gcc-4.2/i686-apple-darwin10/lib/ -isystem /Developer/usr/llvm- > gcc-4.2/i686-apple-darwin10/include -isystem /Developer/usr/llvm- > gcc-4.2/i686-apple-darwin10/sys-include -mmacosx-version-min=10.4 - > O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict- > prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./ > include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 - > D__GCC_FLOAT_NOT_NEEDED -I. -I. -I/Volumes/Sandbox/Buildbot/llvm/ > build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ > llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/Buildbot/llvm/build.llvm- > gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/. > -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../include -I./../ > intl -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libcpp/include -I/ > Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libdecnumber -I../ > libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- > darwin10-selfhost/llvmCore.roots/llvmCore~dst/Developer/usr/local/ > include -DL_ucmpdi2 -fvisibility=hidden -DHIDE_EXPORTS -c /Volumes/ > Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ > llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c -o libgcc/./_ucmpdi2.o > /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/xgcc -B/ > Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/ -B/ > Developer/usr/llvm-gcc-4.2/i686-apple-darwin10/bin/ -B/Developer/usr/ > llvm-gcc-4.2/i686-apple-darwin10/lib/ -isystem /Developer/usr/llvm- > gcc-4.2/i686-apple-darwin10/include -isystem /Developer/usr/llvm- > gcc-4.2/i686-apple-darwin10/sys-include -mmacosx-version-min=10.4 - > O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict- > prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./ > include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 - > D__GCC_FLOAT_NOT_NEEDED -I. -I. -I/Volumes/Sandbox/Buildbot/llvm/ > build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ > llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/Buildbot/llvm/build.llvm- > gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/. > -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../include -I./../ > intl -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libcpp/include -I/ > Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libdecnumber -I../ > libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64- > darwin10-selfhost/llvmCore.roots/llvmCore~dst/Developer/usr/local/ > include -DL_clear_cache -fvisibility=hidden -DHIDE_EXPORTS -c / > Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c -o libgcc/./ > _clear_cache.o > /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:1174: > internal compiler error: Abort trap > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. > make[5]: *** [libgcc/./_cmpdi2.o] Error 1 > make[5]: *** Waiting for unfinished jobs.... > Assertion failed: (DestReg == VirtReg && "Unknown load situation!"), > function RewriteMBB, file /Volumes/Sandbox/Buildbot/llvm/build.llvm- > gcc-x86_64-darwin10-selfhost/llvmCore.roots/llvmCore~obj/src/lib/ > CodeGen/VirtRegRewriter.cpp, line 2294. > /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:1193: > internal compiler error: Abort trap > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. > make[5]: *** [libgcc/./_ucmpdi2.o] Error 1 > # APPLE LOCAL use -mlongcall for large text support > /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/xgcc -B/ > Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/obj-i686-i686/./gcc/ -B/ > Developer/usr/llvm-gcc-4.2/i686-apple-darwin10/bin/ -B/Developer/usr/ > llvm-gcc-4.2/i686-apple-darwin10/lib/ -isystem /Developer/usr/llvm- > gcc-4.2/i686-apple-darwin10/include -isystem /Developer/usr/llvm- > gcc-4.2/i686-apple-darwin10/sys-include -O2 -g -O2 -DIN_GCC -W - > Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold- > style-definition -isystem ./include -I. -I. -I/Volumes/Sandbox/ > Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ > llvmgcc42.roots/llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/Buildbot/ > llvm/build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ > llvmgcc42~obj/src/gcc/. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm- > gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/llvmgcc42~obj/src/ > gcc/../include -I./../intl -I/Volumes/Sandbox/Buildbot/llvm/ > build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ > llvmgcc42~obj/src/gcc/../libcpp/include -I/Volumes/Sandbox/Buildbot/ > llvm/build.llvm-gcc-x86_64-darwin10-selfhost/llvmgcc42.roots/ > llvmgcc42~obj/src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/ > Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/ > llvmCore.roots/llvmCore~dst/Developer/usr/local/include -mlongcall \ > -fno-tree-dominator-opts \ > \ > -c /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10- > selfhost/llvmgcc42.roots/llvmgcc42~obj/src/gcc/config/darwin-crt3.c - > o crt3.o > make[4]: *** [stmp-multilib] Error 2 > rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gcc.pod gpl.pod > make[3]: *** [all-stage1-gcc] Error 2 > make[2]: *** [stage1-bubble] Error 2 > make[1]: *** [all] Error 2 > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/ff9f10a0/attachment-0001.html From dag at cray.com Thu Nov 12 15:52:39 2009 From: dag at cray.com (David Greene) Date: Thu, 12 Nov 2009 15:52:39 -0600 Subject: [LLVMdev] Fwd: Re: Bootstrap Failure Message-ID: <200911121552.39381.dag@cray.com> Forgot to CC the list. I'm looking into it. -Dave ---------- Forwarded Message ---------- Subject: Re: [LLVMdev] Bootstrap Failure Date: Thursday 12 November 2009 15:50 From: David Greene To: Bill Wendling On Thursday 12 November 2009 15:49, you wrote: > These are the likely culprits. David, it looks likely one of yours. Could > you investigate please? And/or revert Will do. I'm rebuilding everything from scratch right now. -Dave ------------------------------------------------------- From anton at korobeynikov.info Thu Nov 12 15:54:17 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Fri, 13 Nov 2009 00:54:17 +0300 Subject: [LLVMdev] Bootstrap Failure In-Reply-To: <0E9F555F-D09E-4E70-B405-A53D29366690@apple.com> References: <0E9F555F-D09E-4E70-B405-A53D29366690@apple.com> Message-ID: Hello, Bill > There's been a recent bootstrap failure that might be covered up because of > another failure. I just wanted to point this out so that people can take a > look: Sounds like codegen problem. You should be able to distill a .bc testcase & reproduce via llc... -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From danchr at gmail.com Thu Nov 12 16:56:13 2009 From: danchr at gmail.com (Dan Villiom Podlaski Christiansen) Date: Thu, 12 Nov 2009 23:56:13 +0100 Subject: [LLVMdev] libLTO on Mac OS X In-Reply-To: <4B5757A6-453F-4895-B346-817EE7065F6B@apple.com> References: <4AFC655F.8070008@uiuc.edu> <4B5757A6-453F-4895-B346-817EE7065F6B@apple.com> Message-ID: On 12 Nov 2009, at 20:51, Chris Lattner wrote: > Yes, it looks relative to itself to find it. If you link with / > Developer/usr/bin/ld, it uses /Developer/usr/lib/libLTO.dylib. Alternatively, you could set the ?DYLD_LIBRARY_PATH? environment variable. The paths specified by it are searched *before* the both the path specified in the binary as well as the system fallback path. I often use it myself for newer versions of LLVM; the only caveat is that it won't work for e.g. ?nm?, ?ar? and so on. Unlike ?ld? they load the library at runtime using a hardcoded path. For example: DYLD_LIBRARY_PATH=/opt/llvm/lib make -j2 Hope that helps, -- Dan Villiom Podlaski Christiansen danchr at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1943 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/0eea394e/attachment.bin From wendling at apple.com Thu Nov 12 17:06:44 2009 From: wendling at apple.com (Bill Wendling) Date: Thu, 12 Nov 2009 15:06:44 -0800 Subject: [LLVMdev] Fwd: Re: Bootstrap Failure In-Reply-To: <200911121552.39381.dag@cray.com> References: <200911121552.39381.dag@cray.com> Message-ID: Here's the .bc file -------------- next part -------------- A non-text attachment was scrubbed... Name: testcase.bc Type: application/octet-stream Size: 1328 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/79af2e36/attachment.obj -------------- next part -------------- -bw On Nov 12, 2009, at 1:52 PM, David Greene wrote: > Forgot to CC the list. I'm looking into it. > > -Dave > > ---------- Forwarded Message ---------- > > Subject: Re: [LLVMdev] Bootstrap Failure > Date: Thursday 12 November 2009 15:50 > From: David Greene > To: Bill Wendling > > On Thursday 12 November 2009 15:49, you wrote: >> These are the likely culprits. David, it looks likely one of yours. >> Could >> you investigate please? And/or revert > > Will do. I'm rebuilding everything from scratch right now. > > -Dave > > ------------------------------------------------------- > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From dag at cray.com Thu Nov 12 17:42:08 2009 From: dag at cray.com (David Greene) Date: Thu, 12 Nov 2009 17:42:08 -0600 Subject: [LLVMdev] Fwd: Re: Bootstrap Failure In-Reply-To: References: <200911121552.39381.dag@cray.com> Message-ID: <200911121742.09326.dag@cray.com> On Thursday 12 November 2009 17:06, Bill Wendling wrote: > Here's the .bc file I don't see the bootstrap failure so it must be a Darwin thing. -Dave From wendling at apple.com Thu Nov 12 17:43:11 2009 From: wendling at apple.com (Bill Wendling) Date: Thu, 12 Nov 2009 15:43:11 -0800 Subject: [LLVMdev] Fwd: Re: Bootstrap Failure In-Reply-To: <200911121742.09326.dag@cray.com> References: <200911121552.39381.dag@cray.com> <200911121742.09326.dag@cray.com> Message-ID: <9A93E050-94A8-4659-B295-2F279573333D@apple.com> On Nov 12, 2009, at 3:42 PM, David Greene wrote: > On Thursday 12 November 2009 17:06, Bill Wendling wrote: >> Here's the .bc file > > I don't see the bootstrap failure so it must be a Darwin thing. > The .bc file I sent shows the error. Could you revert your patches until you have a fix, please? :-) -bw From shreyas76 at gmail.com Thu Nov 12 18:12:18 2009 From: shreyas76 at gmail.com (shreyas krishnan) Date: Thu, 12 Nov 2009 16:12:18 -0800 Subject: [LLVMdev] legalize dag problem Message-ID: <24389fb30911121612u41c86f44m58e341f2ceeaf53d@mail.gmail.com> Hi I am running into a legalize dag issue after custom lowering a load. If someone can give me pointers that would be great. I am using llvm 2.6 When custom lowering a load, the following code gets executed. Tmp1 = TLI.LowerOperation(Tmp3, DAG); if (Tmp1.getNode()) { Tmp3 = LegalizeOp(Tmp1); Tmp4 = LegalizeOp(Tmp1.getValue(1)); <----------------- what is the value expected } What is the value supposed to legalized by the second call to legalizeOp. ? My problem is that the second call asserts inside legalize ops at ResultVals[Op.getResNo()]; b'cos ResultVals has only 1 element and Op.resno is 0. I am not sure if I provided enough context. Please let me know if more information is needed. thanks shrey From shreyas76 at gmail.com Thu Nov 12 18:19:29 2009 From: shreyas76 at gmail.com (shreyas krishnan) Date: Thu, 12 Nov 2009 16:19:29 -0800 Subject: [LLVMdev] legalize dag problem In-Reply-To: <24389fb30911121612u41c86f44m58e341f2ceeaf53d@mail.gmail.com> References: <24389fb30911121612u41c86f44m58e341f2ceeaf53d@mail.gmail.com> Message-ID: <24389fb30911121619x70505034vc01ec9b94ea1d25c@mail.gmail.com> Correction: I meant Op.resno is 1 - so out of bounds assert shrey On Thu, Nov 12, 2009 at 4:12 PM, shreyas krishnan wrote: > Hi > ? I am running into a legalize dag issue after custom lowering a > load. If someone can give me pointers that would be great. ?I am using > llvm 2.6 > > When custom lowering a load, the following code gets executed. > > ? ? ? ?Tmp1 = TLI.LowerOperation(Tmp3, DAG); > ? ? ? ?if (Tmp1.getNode()) { > ? ? ? ? ?Tmp3 = LegalizeOp(Tmp1); > ? ? ? ? ?Tmp4 = LegalizeOp(Tmp1.getValue(1)); <----------------- what > is the value expected > ? ? ? ?} > > > What is the value supposed to legalized by the second call to legalizeOp. ? > > My problem is that the second call asserts inside legalize ops at > ResultVals[Op.getResNo()]; b'cos ResultVals has only 1 element and > Op.resno is 0. > > I am not sure if I provided enough context. Please let me know if more > information is needed. > > thanks > shrey > From lhames at gmail.com Thu Nov 12 18:29:56 2009 From: lhames at gmail.com (Lang Hames) Date: Thu, 12 Nov 2009 16:29:56 -0800 Subject: [LLVMdev] Crash in PBQP register allocator In-Reply-To: References: Message-ID: <728927c70911121629i5091b14ay1ae37dc5f0568d66@mail.gmail.com> This looks like a bug in the PBQP solver. I'm currently investigating. Cheers, Lang. On Thu, Nov 12, 2009 at 12:46 AM, wrote: > Hi, > > > > Please see the two ?.ll? files attached. > > > > Command line used > > llc ?march=pic16 ??pre-RA-sched=list-burr ?regalloc=pbqp new.obc > > > > The above test case crashes only when I use the combination of list-burr > scheduler and pbqp register allocator. If any of them (scheduler or register > allocator) is replaced with some alternate then I don?t see the crash. > > > > I could not figure out the reason. Please provide some pointers to reasons > of the crash. > > > > Regards > > Sachin > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > From dag at cray.com Thu Nov 12 18:30:39 2009 From: dag at cray.com (David Greene) Date: Thu, 12 Nov 2009 18:30:39 -0600 Subject: [LLVMdev] Fwd: Re: Bootstrap Failure In-Reply-To: <9A93E050-94A8-4659-B295-2F279573333D@apple.com> References: <200911121552.39381.dag@cray.com> <200911121742.09326.dag@cray.com> <9A93E050-94A8-4659-B295-2F279573333D@apple.com> Message-ID: <200911121830.40083.dag@cray.com> On Thursday 12 November 2009 17:43, Bill Wendling wrote: > On Nov 12, 2009, at 3:42 PM, David Greene wrote: > > On Thursday 12 November 2009 17:06, Bill Wendling wrote: > >> Here's the .bc file > > > > I don't see the bootstrap failure so it must be a Darwin thing. > > The .bc file I sent shows the error. Yes, I was just commenting, not giving up. > Could you revert your patches until you have a fix, please? :-) I just checked in the fix. :) -Dave From anton at korobeynikov.info Thu Nov 12 18:41:22 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Fri, 13 Nov 2009 03:41:22 +0300 Subject: [LLVMdev] legalize dag problem In-Reply-To: <24389fb30911121612u41c86f44m58e341f2ceeaf53d@mail.gmail.com> References: <24389fb30911121612u41c86f44m58e341f2ceeaf53d@mail.gmail.com> Message-ID: > My problem is that the second call asserts inside legalize ops at > ResultVals[Op.getResNo()]; b'cos ResultVals has only 1 element and > Op.resno is 0. Looks like you lowered the load improperly. It should return 2 values: the value loaded and a chain. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From shreyas76 at gmail.com Thu Nov 12 19:13:29 2009 From: shreyas76 at gmail.com (shreyas krishnan) Date: Thu, 12 Nov 2009 17:13:29 -0800 Subject: [LLVMdev] legalize dag problem In-Reply-To: References: <24389fb30911121612u41c86f44m58e341f2ceeaf53d@mail.gmail.com> Message-ID: <24389fb30911121713q6fc33e7bwd80b9b5924d180af@mail.gmail.com> thanks for the help ..I do add the chain and the result. My code is like this ... SDValue Ops[] = { load->getChain(), load->getOperand(1), load->getBasePtr(), des }; DAG.getNode(CustomOpc, NodeTys, Ops, 4); thanks again! shrey On Thu, Nov 12, 2009 at 4:41 PM, Anton Korobeynikov wrote: >> My problem is that the second call asserts inside legalize ops at >> ResultVals[Op.getResNo()]; b'cos ResultVals has only 1 element and >> Op.resno is 0. > Looks like you lowered the load improperly. It should return 2 values: > the value loaded and a chain. > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University > From clattner at apple.com Thu Nov 12 19:58:36 2009 From: clattner at apple.com (Chris Lattner) Date: Thu, 12 Nov 2009 17:58:36 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> Message-ID: On Nov 12, 2009, at 11:29 AM, Talin wrote: > > Well, as far as intp goes (or iptr if you prefer - the naming > convention in LLVM is i) How about "intptr". > here's what I would expect: > General rule #1: If an instruction accepts both i32 and i64, then it > should accept iptr as well. If it only accepts i32, then it can > continue to only accept i32. > General rule #2: It should support operations that are commonly used > with size_t and ptrdiff_t. Ok. Just realize that obscure optimizations like "constant folding" won't be possible without TargetData around. :) > Operations that should work with iptr: > Basic math: add, subtract, multiply, divide, mod. > Bitwise binary operators: shl, ashr, lshr, and, or, xor, etc. > Comparison operations. > alloca - currently doesn't work with i64, should it? Yes, alloca should work with i64. Recently malloc was detangled from alloca, but alloca should definitely support an arbitrary integer size. I don't know anyone planning to do this. In any case, for the first implementation stage of intptr, just converting to an i32 to do the alloca should be fine (no worse than what we have today). When alloca gets generalized, if intptr is around it will be handed as well. > GEP - rules are the same as for using i64 indices. > memcpy intrinsics > bit manipulation intrinsics > overflow arithmetic intrinsics - would be nice > atomic intrinsics - would be very nice (I assume that atomic iptr > works on all platforms that support atomics: That is, on 32-bit > platforms where iptr == i32 I expect atomic i32 to work; on 64-bit > platforms where iptr == i64 I expect atomic i64 to work). This all sounds reasonable. > Operations that don't need to work with iptr - i.e. I don't mind > having to convert to some other int type first: > switch > extractelement / insertelement / shufflevector > extractvalue / insertvalue - not sure about these. > code generator intrinsics (frameaddress, etc.) insert/extractvalue need to work, as does load/store/phi for it to be a useful first class value. switch should "just work". I don't have an opinion about whether intptr should work with vectors, but it seems sensible either way. I agree about frameaddress. > Converting to pointer types: inttoptr and ptrtoint should be no-ops, > effectively. > Converting to other integer types: The issue here is that with other > integer conversions in LLVM, you are required to know whether or not > you are converting to a larger or smaller size - whether to use an > ext or a trunc instruction. When converting to pointers, however, > the choice of trunc or ext is automatic. Ideally, conversion to iptr > would work the same way as conversion to a pointer type. There's > also the issue of signed vs. unsigned extension. > Note that some constant-folding operations would need to be deferred > until the target size is established. Almost *all* constant folding would have to be deferred, which means you'd get big chains of constant exprs. This isn't a problem per-say, but something to be aware of. I don't like reusing existing sext/trunc/zext/inttoptr/ptrtoint casts for intptr. I think we should introduce new operations (hopefully with better names): ptr to intptr intptr to int intptr to signed int signed int to intptr intptr to unsigned int unsigned int to intptr Does that seem reasonable? > Converting to FP types: Either don't support (i.e. require casting > to known-width integer first), or map to i32->FP or i64->FP after > the size is known. I think we should force conversion to a fixed integer type before converting to/from FP (for example pointers can't currently be converted to FP, they have to go through an intermediate integer type). If it is important, we can always add this as a second (or third) extension once the basics work. I'm going to be away on vacation for two weeks so I won't be able to keep up to date with this thread, if you're interested in pursuing this work, please write up something in the form of an 'llvmnote' (e.g. http://nondot.org/sabre/LLVMNotes/IndirectGoto.txt) which explains in prose the problem it is trying to solve, the tradeoffs, and a proposed implementation approach (like you have above). Whether or not you get time to start implementing it, it is a good idea to document the design tradeoffs considered and the effects of various decisions (such as neutering constant folding when TD isn't around). This is also a good way to get others to help out, -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/19ebcd6d/attachment.html From viridia at gmail.com Thu Nov 12 21:35:18 2009 From: viridia at gmail.com (Talin) Date: Thu, 12 Nov 2009 19:35:18 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> Message-ID: On Thu, Nov 12, 2009 at 5:58 PM, Chris Lattner wrote: > On Nov 12, 2009, at 11:29 AM, Talin wrote: > > > Well, as far as intp goes (or iptr if you prefer - the naming convention in > LLVM is i) > > > How about "intptr". > > here's what I would expect: > > - General rule #1: If an instruction accepts both i32 and i64, then it > should accept iptr as well. If it only accepts i32, then it can continue to > only accept i32. > - General rule #2: It should support operations that are commonly used > with size_t and ptrdiff_t. > > Ok. Just realize that obscure optimizations like "constant folding" won't > be possible without TargetData around. :) > There is also the issue of how constants should be represented. For all current processors that I know of, an intptr will be either 32 or 64 bits. However, there may be some future processor which supports 128-bit pointers (although a system containing that much RAM or even virtual address space is hard to imagine.) If we assume that i64 is the upper limit, then intptr constants can be converted to i64 until needed. Some constant folding can occur if the folding wouldn't change the final result. Specifically, for any function f(x, y) where (i32)f(x, y) is the same as (i32)f((i32)x, (i32)y), it's safe to apply that function before the final size of the integer is chosen. Thus, adding two numbers (ignoring overflow), or shifting to the left should be safe to fold. That being said, I am perfectly fine with simply disabling folding, and leaving the partial folding as a future optimization. > > - Operations that should work with iptr: > - Basic math: add, subtract, multiply, divide, mod. > - Bitwise binary operators: shl, ashr, lshr, and, or, xor, etc. > - Comparison operations. > - alloca - currently doesn't work with i64, should it? > > Yes, alloca should work with i64. Recently malloc was detangled from > alloca, but alloca should definitely support an arbitrary integer size. I > don't know anyone planning to do this. In any case, for the first > implementation stage of intptr, just converting to an i32 to do the alloca > should be fine (no worse than what we have today). When alloca gets > generalized, if intptr is around it will be handed as well. > > > - GEP - rules are the same as for using i64 indices. > - memcpy intrinsics > - bit manipulation intrinsics > - overflow arithmetic intrinsics - would be nice > - atomic intrinsics - would be very nice (I assume that atomic iptr > works on all platforms that support atomics: That is, on 32-bit platforms > where iptr == i32 I expect atomic i32 to work; on 64-bit platforms where > iptr == i64 I expect atomic i64 to work). > > This all sounds reasonable. > > > - Operations that don't need to work with iptr - i.e. I don't mind > having to convert to some other int type first: > - switch > - extractelement / insertelement / shufflevector > - extractvalue / insertvalue - not sure about these. > - code generator intrinsics (frameaddress, etc.) > > insert/extractvalue need to work, as does load/store/phi for it to be a > useful first class value. switch should "just work". I don't have an > opinion about whether intptr should work with vectors, but it seems sensible > either way. I agree about frameaddress. > There is also the question of whether intptrs should be allowed as *members* of vectors. I have no opinion on this, except to say that it probably only makes sense in situations where you can also have vectors of pointers. > > - Converting to pointer types: inttoptr and ptrtoint should be no-ops, > effectively. > - Converting to other integer types: The issue here is that with other > integer conversions in LLVM, you are required to know whether or not you are > converting to a larger or smaller size - whether to use an ext or a trunc > instruction. When converting to pointers, however, the choice of trunc or > ext is automatic. Ideally, conversion to iptr would work the same way as > conversion to a pointer type. There's also the issue of signed vs. unsigned > extension. > - Note that some constant-folding operations would need to be > deferred until the target size is established. > > Almost *all* constant folding would have to be deferred, which means you'd > get big chains of constant exprs. This isn't a problem per-say, but > something to be aware of. > > I don't like reusing existing sext/trunc/zext/inttoptr/ptrtoint casts for > intptr. I think we should introduce new operations (hopefully with better > names): > > ptr to intptr > intptr to int > intptr to signed int > signed int to intptr > intptr to unsigned int > unsigned int to intptr > > Does that seem reasonable? > Sure. Another option is to do away with sext/trunc/etc. and just have two cast operations for ints: sicast and uicast. sicast converts any int size to any other (with sign extension if the destination type is bigger), and uicast is the same but with zero extension. That leaves just ptrtoint and inttoptr - which incidentally have the same semantics as sicast and uicast. > > - Converting to FP types: Either don't support (i.e. require casting to > known-width integer first), or map to i32->FP or i64->FP after the size is > known. > > I think we should force conversion to a fixed integer type before > converting to/from FP (for example pointers can't currently be converted to > FP, they have to go through an intermediate integer type). If it is > important, we can always add this as a second (or third) extension once the > basics work. > > I'm going to be away on vacation for two weeks so I won't be able to keep > up to date with this thread, if you're interested in pursuing this work, > please write up something in the form of an 'llvmnote' (e.g. > http://nondot.org/sabre/LLVMNotes/IndirectGoto.txt) which explains in > prose the problem it is trying to solve, the tradeoffs, and a proposed > implementation approach (like you have above). Whether or not you get time > to start implementing it, it is a good idea to document the design tradeoffs > considered and the effects of various decisions (such as neutering constant > folding when TD isn't around). This is also a good way to get others to > help out, > > -Chris > -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/056c9073/attachment.html From nicholas at mxc.ca Thu Nov 12 22:16:48 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 12 Nov 2009 20:16:48 -0800 Subject: [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter In-Reply-To: <4AFBCFD8.2070908@hanshq.net> References: <4AF19306.20803@hanshq.net> <4D39951A-5792-4BBC-9BEF-92540CE91349@apple.com> <4AF938D6.3030706@hanshq.net> <4AFBCFD8.2070908@hanshq.net> Message-ID: <4AFCDDB0.5010406@mxc.ca> Hans Wennborg wrote: > After discussing with Nick Lewycky in the IRC channel, here comes a less > aggressive patch. > > We were worried that a constant pointer could alias with a GlobalValue. > Also, if one pointer could be a GlobalValue and the other a GlobalAlias > with the GlobalValue as aliasee. > However, I was not able to produce a test where this happens wihout the > getUnderlyingObject() returning the same value. > > It would be nice if someone could produce such a test case, or dismiss > the possibility of this happening. My bad, it seems that while I wasn't looking, someone taught getUnderlyingObject to look through GlobalAliases and return what they point to! However the previous patch was wrong given code like: @gv = global i32 0 define void @test() { store i16 1, i16* inttoptr(i64 add(i64 ptrtoint(i32* @gv to i64), i64 1) to i16*) ; ; Not dead store i32 2, i32* @gv ret void } > Anyway, saying that a Constant does not alias with a non-const > isIdentifiedObject object seems safe. Yup! Please remove the tailing ; on the lines where they aren't needed in your tests. Besides that, your patch looks great! Thanks! Nick > / Hans > > > Hans Wennborg wrote: >> Dan Gohman wrote: >>> On Nov 4, 2009, at 6:43 AM, Hans Wennborg wrote: >>> >>>> Here is another change I'd like to suggest to the BasicAliasAnalysis. >>>> >>>> LLVM fails to remove the dead store in the following code: >>>> >>>> %t = type { i32 } >>>> >>>> define void @f(%t* noalias nocapture %stuff ) { >>>> %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 >>>> >>>> store i32 1, i32* %p; <-- This store is dead >>>> >>>> %x = load i32* inttoptr (i32 12345 to i32*) >>>> store i32 %x, i32* %p >>>> ret void >>>> } >>>> >>>> >>>> when run through >>>> ./llvm-as -o - test2.ll | ./opt -O3 -o - | ./llvm-dis -o - >>>> >>>> >>>> The problem is that the alias analysis is unsure about whether %p >>>> and 12345 may alias. But since %p is derived from %stuff, which has >>>> the noalias attribute, and 12345 is a constant and therefore cannot >>>> be derived from %stuff, they cannot alias. >>> >>> This sounds right. And actually, it's not limited to noalias; >>> isIdentifiedObject objects don't alias inttoptr-casted integer >>> literals either. I have a few comments on the patch below. >>> >>>> I'm attaching a patch which implements this. Please comment on >>>> whether this is sane, and if my code is the right way of doing it. >>>> >>>> >>>> / Hans >>>> Index: lib/Analysis/BasicAliasAnalysis.cpp >>>> =================================================================== >>>> --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) >>>> +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) >>>> @@ -643,6 +643,23 @@ >>>> if (!isa(V1->getType()) || >>>> !isa(V2->getType())) >>>> return NoAlias; // Scalars cannot alias each other >>>> >>>> + // Constant ptr cannot alias with a noalias attribute >>>> + if (isa(V1) && isa(V2->getType())) { >>>> + while (const GEPOperator *g = dyn_cast(V2)) >>>> + V2 = g->getOperand(0); >>>> + >>>> + if (const Argument *A = dyn_cast(V2)) >>>> + if (A->hasNoAliasAttr()) >>>> + return NoAlias; >>>> + } else if (isa(V2) && isa(V1->getType())) { >>>> + while (const GEPOperator *g = dyn_cast(V1)) >>>> + V1 = g->getOperand(0); >>>> + >>>> + if (const Argument *A = dyn_cast(V1)) >>>> + if (A->hasNoAliasAttr()) >>>> + return NoAlias; >>>> + } >>> >>> The GEP logic here is effectively doing (a subset of) what >>> getUnderlyingObject does. It would be better to move these checks >>> below the getUnderlyingObject calls just below so that they can >>> use the results from those calls instead. >>> >>> And instead of checking for a no-alias argument, this code could >>> use isIdentifiedObject instead, following my comment above. >> >> Thank you for the input, this certainly made things nicer. I have >> attached a patch that does this together with a test case. >> >> / Hans >> >>> >>> Dan >>> >>>> // Figure out what objects these things are pointing to if we can. >>>> const Value *O1 = V1->getUnderlyingObject(); >>>> const Value *O2 = V2->getUnderlyingObject(); >>>> _______________________________________________ >>>> LLVM Developers mailing list >>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > ------------------------------------------------------------------------ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From clattner at apple.com Thu Nov 12 22:48:06 2009 From: clattner at apple.com (Chris Lattner) Date: Thu, 12 Nov 2009 20:48:06 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> Message-ID: <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> On Nov 12, 2009, at 7:35 PM, Talin wrote: > On Thu, Nov 12, 2009 at 5:58 PM, Chris Lattner > wrote: > > There is also the issue of how constants should be represented. > > For all current processors that I know of, an intptr will be either > 32 or 64 bits. However, there may be some future processor which > supports 128-bit pointers (although a system containing that much > RAM or even virtual address space is hard to imagine.) 8, 16, and 24-bit address spaces are also popular. > If we assume that i64 is the upper limit, then intptr constants can > be converted to i64 until needed. > > Some constant folding can occur if the folding wouldn't change the > final result. Specifically, for any function f(x, y) where (i32)f(x, > y) is the same as (i32)f((i32)x, (i32)y), it's safe to apply that > function before the final size of the integer is chosen. Thus, > adding two numbers (ignoring overflow), or shifting to the left > should be safe to fold. > > That being said, I am perfectly fine with simply disabling folding, > and leaving the partial folding as a future optimization. How should immediates be formed? Is it valid for a ConstantInt to have intptr type? How wide would the contained APInt be? I think it would be safe to represent all constants as (signed_int_to_intptr (constantint 42)) or something. > > There is also the question of whether intptrs should be allowed as > *members* of vectors. I have no opinion on this, except to say that > it probably only makes sense in situations where you can also have > vectors of pointers. Vectors of pointers are not allowed. I think disallowing intptr in vectors makes perfect sense. > Almost *all* constant folding would have to be deferred, which means > you'd get big chains of constant exprs. This isn't a problem per- > say, but something to be aware of. > > I don't like reusing existing sext/trunc/zext/inttoptr/ptrtoint > casts for intptr. I think we should introduce new operations > (hopefully with better names): > > ptr to intptr > intptr to ptr > intptr to signed int > signed int to intptr > intptr to unsigned int > unsigned int to intptr > > Does that seem reasonable? > > Sure. Another option is to do away with sext/trunc/etc. and just > have two cast operations for ints: sicast and uicast. sicast > converts any int size to any other (with sign extension if the > destination type is bigger), and uicast is the same but with zero > extension. sext/zext/trunc are very nice for the optimizer, we should keep them. It means that the optimizer doesn't have to check that the input to a sext is bigger or smaller than the result, for example. Code that cares (e.g. instcombine) really likes this. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/d11bdd0f/attachment.html From davidterei at gmail.com Thu Nov 12 22:57:43 2009 From: davidterei at gmail.com (David Terei) Date: Fri, 13 Nov 2009 15:57:43 +1100 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <9430ad070911112246m77326a85uc321136da304fd9a@mail.gmail.com> References: <200911120458.27521.jon@ffconsultancy.com> <1ef034530911112233h1331b6e5r18afde5f03171320@mail.gmail.com> <9430ad070911112246m77326a85uc321136da304fd9a@mail.gmail.com> Message-ID: <150b8f420911122057s7f98b4a7u3b304f52cf1e631a@mail.gmail.com> I've run into some issues with tail calls in the past, make sure you are doing the following: 1. Call should be marked with tail (obviously) 2. Next statement after tail call should be 'return void' 3. Use fast call convention for tail calls 4. Make sure the function you are calling doesn't use the 'noreturn' attribute. 5. Turn on tail calls in llc (if using the static compiler), with '-tailcallopt' option. Point 4 is the one that caused me trouble for some time. Unfortunately it causes a bad interaction with the optimiser, specifically the 'simplifycfg' pass. What seems to happen is that since the function you are calling is marked with 'noreturn', the simplifycfg pass will then put a 'unreachable' statement after the tail call to that function. This stuffs up the tail call though as the llc compiler requires tail calls be followed by a 'return void' statement. In my case this caused my compiled programs to segfault if the llvm optimiser was run on them. I haven't fully investigated this yet so not really sure if it is specific to my case or applies universally but it sure did cause me some pains for a while. 2009/11/12 Paul Davey : > tail calls are only implemented for fastcall calling convention if i remeber > right from my inquiries. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > From shreyas76 at gmail.com Fri Nov 13 00:29:33 2009 From: shreyas76 at gmail.com (shreyas krishnan) Date: Thu, 12 Nov 2009 22:29:33 -0800 Subject: [LLVMdev] legalize dag problem In-Reply-To: <24389fb30911121713q6fc33e7bwd80b9b5924d180af@mail.gmail.com> References: <24389fb30911121612u41c86f44m58e341f2ceeaf53d@mail.gmail.com> <24389fb30911121713q6fc33e7bwd80b9b5924d180af@mail.gmail.com> Message-ID: <24389fb30911122229w5b101591j4c5cbd530f8c88b5@mail.gmail.com> think I found my mistake - seems to work SDValue Ops[] = { load->getChain(), load->getBasePtr(), des }; DAG.getNode(CustomOpc,dl, NodeTys, Ops, 3) Nodetys is the return VTlist thanks Shrey On Thu, Nov 12, 2009 at 5:13 PM, shreyas krishnan wrote: > thanks for the help ..I do add the chain and the result. > > My code is like this ... > > SDValue Ops[] = { load->getChain(), load->getOperand(1), > load->getBasePtr(), des }; > DAG.getNode(CustomOpc, NodeTys, Ops, 4); > > > thanks again! > shrey > > > > > > > On Thu, Nov 12, 2009 at 4:41 PM, Anton Korobeynikov > wrote: >>> My problem is that the second call asserts inside legalize ops at >>> ResultVals[Op.getResNo()]; b'cos ResultVals has only 1 element and >>> Op.resno is 0. >> Looks like you lowered the load improperly. It should return 2 values: >> the value loaded and a chain. >> >> -- >> With best regards, Anton Korobeynikov >> Faculty of Mathematics and Mechanics, Saint Petersburg State University >> > From rjmccall at apple.com Fri Nov 13 01:29:01 2009 From: rjmccall at apple.com (John McCall) Date: Thu, 12 Nov 2009 23:29:01 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> Message-ID: <4AFD0ABD.2070604@apple.com> Chris Lattner wrote: > On Nov 12, 2009, at 7:35 PM, Talin wrote: >> On Thu, Nov 12, 2009 at 5:58 PM, Chris Lattner > > wrote: >> >> >> There is also the issue of how constants should be represented. >> >> For all current processors that I know of, an intptr will be either >> 32 or 64 bits. However, there may be some future processor which >> supports 128-bit pointers (although a system containing that much RAM >> or even virtual address space is hard to imagine.) > > 8, 16, and 24-bit address spaces are also popular. To be really pedantic, a single platform may have multiple pointer widths; I assume intptr would correspond to the width of a generic pointer, but non-generic address spaces are not constrained in any direction by the size of the generic address space. Of course, non-generic address spaces have no place in portable bitcode anyway, but I wanted to insert a note of pedantry into the conversation. :) >> Almost *all* constant folding would have to be deferred, which >> means you'd get big chains of constant exprs. This isn't a >> problem per-say, but something to be aware of. >> >> I don't like reusing existing sext/trunc/zext/inttoptr/ptrtoint >> casts for intptr. I think we should introduce new operations >> (hopefully with better names): >> >> ptr to intptr >> intptr to ptr >> intptr to signed int >> signed int to intptr >> intptr to unsigned int >> unsigned int to intptr >> >> Does that seem reasonable? >> >> >> Sure. Another option is to do away with sext/trunc/etc. and just have >> two cast operations for ints: sicast and uicast. sicast converts any >> int size to any other (with sign extension if the destination type is >> bigger), and uicast is the same but with zero extension. > > sext/zext/trunc are very nice for the optimizer, we should keep them. > It means that the optimizer doesn't have to check that the input to a > sext is bigger or smaller than the result, for example. Code that > cares (e.g. instcombine) really likes this. We could just say that code has undefined behavior or is invalid if the 'sext', 'zext', or 'trunc' is inappropriate for the actual size of intptr. I think this is reasonable; if the frontend emits a zext intptr to i32, and the pointer side is i64, that *should* be invalid. This way the optimizer gets to keep its assumptions and it becomes the client's responsibility to ensure that its "target-neutral" bitcode really is neutral for the range of platforms it actually cares about. Portable code can't be truncating arbitrary pointers to some smaller type anyway; if the client just wants to munge the bottom bits, it can zext and trunc to and from i8/i12/whatever. John. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091112/d7391b64/attachment-0001.html From hans at hanshq.net Fri Nov 13 01:36:46 2009 From: hans at hanshq.net (Hans Wennborg) Date: Fri, 13 Nov 2009 08:36:46 +0100 Subject: [LLVMdev] BasicAliasAnalysis: constant does not alias with noalias parameter In-Reply-To: <4AFCDDB0.5010406@mxc.ca> References: <4AF19306.20803@hanshq.net> <4D39951A-5792-4BBC-9BEF-92540CE91349@apple.com> <4AF938D6.3030706@hanshq.net> <4AFBCFD8.2070908@hanshq.net> <4AFCDDB0.5010406@mxc.ca> Message-ID: <4AFD0C8E.4080801@hanshq.net> Attaching patch with unnecessary trailing ; removed from test case. Thank you both for helping to straighten this out, and sorry about the confusion. Hans Nick Lewycky wrote: > Hans Wennborg wrote: >> After discussing with Nick Lewycky in the IRC channel, here comes a >> less aggressive patch. >> >> We were worried that a constant pointer could alias with a GlobalValue. >> Also, if one pointer could be a GlobalValue and the other a >> GlobalAlias with the GlobalValue as aliasee. >> However, I was not able to produce a test where this happens wihout >> the getUnderlyingObject() returning the same value. >> >> It would be nice if someone could produce such a test case, or dismiss >> the possibility of this happening. > > My bad, it seems that while I wasn't looking, someone taught > getUnderlyingObject to look through GlobalAliases and return what they > point to! > > However the previous patch was wrong given code like: > > @gv = global i32 0 > define void @test() { > store i16 1, i16* inttoptr(i64 add(i64 ptrtoint(i32* @gv to i64), > i64 1) to i16*) ; ; Not dead > store i32 2, i32* @gv > ret void > } > >> Anyway, saying that a Constant does not alias with a non-const >> isIdentifiedObject object seems safe. > > Yup! > > Please remove the tailing ; on the lines where they aren't needed in > your tests. Besides that, your patch looks great! Thanks! > > Nick > >> / Hans >> >> >> Hans Wennborg wrote: >>> Dan Gohman wrote: >>>> On Nov 4, 2009, at 6:43 AM, Hans Wennborg wrote: >>>> >>>>> Here is another change I'd like to suggest to the BasicAliasAnalysis. >>>>> >>>>> LLVM fails to remove the dead store in the following code: >>>>> >>>>> %t = type { i32 } >>>>> >>>>> define void @f(%t* noalias nocapture %stuff ) { >>>>> %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 >>>>> >>>>> store i32 1, i32* %p; <-- This store is dead >>>>> >>>>> %x = load i32* inttoptr (i32 12345 to i32*) >>>>> store i32 %x, i32* %p >>>>> ret void >>>>> } >>>>> >>>>> >>>>> when run through >>>>> ./llvm-as -o - test2.ll | ./opt -O3 -o - | ./llvm-dis -o - >>>>> >>>>> >>>>> The problem is that the alias analysis is unsure about whether %p >>>>> and 12345 may alias. But since %p is derived from %stuff, which has >>>>> the noalias attribute, and 12345 is a constant and therefore cannot >>>>> be derived from %stuff, they cannot alias. >>>> >>>> This sounds right. And actually, it's not limited to noalias; >>>> isIdentifiedObject objects don't alias inttoptr-casted integer >>>> literals either. I have a few comments on the patch below. >>>> >>>>> I'm attaching a patch which implements this. Please comment on >>>>> whether this is sane, and if my code is the right way of doing it. >>>>> >>>>> >>>>> / Hans >>>>> Index: lib/Analysis/BasicAliasAnalysis.cpp >>>>> =================================================================== >>>>> --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) >>>>> +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) >>>>> @@ -643,6 +643,23 @@ >>>>> if (!isa(V1->getType()) || >>>>> !isa(V2->getType())) >>>>> return NoAlias; // Scalars cannot alias each other >>>>> >>>>> + // Constant ptr cannot alias with a noalias attribute >>>>> + if (isa(V1) && isa(V2->getType())) { >>>>> + while (const GEPOperator *g = dyn_cast(V2)) >>>>> + V2 = g->getOperand(0); >>>>> + >>>>> + if (const Argument *A = dyn_cast(V2)) >>>>> + if (A->hasNoAliasAttr()) >>>>> + return NoAlias; >>>>> + } else if (isa(V2) && isa(V1->getType())) { >>>>> + while (const GEPOperator *g = dyn_cast(V1)) >>>>> + V1 = g->getOperand(0); >>>>> + >>>>> + if (const Argument *A = dyn_cast(V1)) >>>>> + if (A->hasNoAliasAttr()) >>>>> + return NoAlias; >>>>> + } >>>> >>>> The GEP logic here is effectively doing (a subset of) what >>>> getUnderlyingObject does. It would be better to move these checks >>>> below the getUnderlyingObject calls just below so that they can >>>> use the results from those calls instead. >>>> >>>> And instead of checking for a no-alias argument, this code could >>>> use isIdentifiedObject instead, following my comment above. >>> >>> Thank you for the input, this certainly made things nicer. I have >>> attached a patch that does this together with a test case. >>> >>> / Hans >>> >>>> >>>> Dan >>>> >>>>> // Figure out what objects these things are pointing to if we can. >>>>> const Value *O1 = V1->getUnderlyingObject(); >>>>> const Value *O2 = V2->getUnderlyingObject(); >>>>> _______________________________________________ >>>>> LLVM Developers mailing list >>>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > -------------- next part -------------- A non-text attachment was scrubbed... Name: BasicAliasAnalysis3.patch Type: text/x-patch Size: 1993 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091113/c5e63f56/attachment.bin From overminddl1 at gmail.com Fri Nov 13 03:40:02 2009 From: overminddl1 at gmail.com (OvermindDL1) Date: Fri, 13 Nov 2009 02:40:02 -0700 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <3f49a9f40911130139o7df0b865yf91e669145ea7d46@mail.gmail.com> References: <200911120458.27521.jon@ffconsultancy.com> <1ef034530911112233h1331b6e5r18afde5f03171320@mail.gmail.com> <9430ad070911112246m77326a85uc321136da304fd9a@mail.gmail.com> <150b8f420911122057s7f98b4a7u3b304f52cf1e631a@mail.gmail.com> <3f49a9f40911130139o7df0b865yf91e669145ea7d46@mail.gmail.com> Message-ID: <3f49a9f40911130140m4b65d187y38ce4f4590f1c2ca@mail.gmail.com> Resent, to the list this time instead of David (sorry for the duplicate)... On Thu, Nov 12, 2009 at 9:57 PM, David Terei wrote: > I've run into some issues with tail calls in the past, make sure you > are doing the following: > > 1. Call should be marked with tail (obviously) > 2. Next statement after tail call should be 'return void' > 3. Use fast call convention for tail calls > 4. Make sure the function you are calling doesn't use the 'noreturn' attribute. > 5. Turn on tail calls in llc (if using the static compiler), with > '-tailcallopt' option. > > Point 4 is the one that caused me trouble for some time. Unfortunately > it causes a bad interaction with the optimiser, specifically the > 'simplifycfg' pass. What seems to happen is that since the function > you are calling is marked with 'noreturn', the simplifycfg pass will > then put a 'unreachable' statement after the tail call to that > function. This stuffs up the tail call though as the llc compiler > requires tail calls be followed by a 'return void' statement. In my > case this caused my compiled programs to segfault if the llvm > optimiser was run on them. Just to make sure, but if a tail call function returns a value, can you not just return that value directly by your function and have tail calls still work? From rodolph.perfetta at arm.com Fri Nov 13 05:27:39 2009 From: rodolph.perfetta at arm.com (Rodolph Perfetta) Date: Fri, 13 Nov 2009 11:27:39 -0000 Subject: [LLVMdev] speed up memcpy intrinsic using ARM Neon registers In-Reply-To: References: <503ab6d60911091634n2360b086g1935924bc27fd3c4@mail.gmail.com> <000001ca62c2$05dbf880$1193e980$%perfetta@arm.com> Message-ID: <000001ca6454$4ef5c300$ece14900$@perfetta@arm.com> > Can you comment on David Conrad's message in this thread regarding > a ~20 cycle penalty for an ARM store following a NEON store to the > same 16-byte block? It is correct for A8: a NEON store followed by an ARM store in the same 16 bytes block will incur a penalty (20 cycles sounds about right) as the CPU ensures there are no data hazards. A9 does not have this penalty. > If the memcpy size is not a multiple of 8, we need some ARM load/store > instructions to copy the tail end of it.?The context here is LLVM > generating inline code for small copies, so if there is a penalty > like that, it is probably not worthwhile to use NEON unless the > alignment shows that the tail will be in a separate 16-byte block. I agree it is probably not worthwhile (though I assume using NEON releases pressure on your register allocator), it is usually not recommended to mix ARM/NEON memory operation. Also the NEON engines tend to have a deeper pipeline than the ARM integer cores, so the delay to store the first bytes is likely to be higher using NEON (although it should be faster afterwards). So for very small memcpy (20 bytes or less) ARM will be faster. For best performance remember to use PLD. For A9 you have more to take into account: A9 is a superscalar, dual issue, out of order and speculative CPU but this only applies to the ARM integer core, NEON and VFP are single issue in order. However an ARM instruction can be issued with a NEON or VFP instruction. So if you have some VFP/NEON code before the memcpy, by the time the CPU reaches the inline NEON memcpy it might not have finished the previous NEON/VFP instruction and you'll have to wait ... > (And what's up with the 16-byte divisions??I thought the cache > lines are 64 bytes....) Cache line is 64 bytes on A8 and 32 bytes on A9. 16 bytes is the size of an internal buffer use by the load/store unit. Cheers, Rodolph. From jon at ffconsultancy.com Fri Nov 13 05:34:28 2009 From: jon at ffconsultancy.com (Jon Harrop) Date: Fri, 13 Nov 2009 11:34:28 +0000 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <3f49a9f40911130140m4b65d187y38ce4f4590f1c2ca@mail.gmail.com> References: <200911120458.27521.jon@ffconsultancy.com> <3f49a9f40911130139o7df0b865yf91e669145ea7d46@mail.gmail.com> <3f49a9f40911130140m4b65d187y38ce4f4590f1c2ca@mail.gmail.com> Message-ID: <200911131134.29373.jon@ffconsultancy.com> On Friday 13 November 2009 09:40:02 OvermindDL1 wrote: > Just to make sure, but if a tail call function returns a value, can > you not just return that value directly by your function and have tail > calls still work? Yes, that is correct. You may like to look at the implementation in HLVM which handles struct return types as well: http://hlvm.forge.ocamlcore.org/ -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e From jon at ffconsultancy.com Fri Nov 13 05:34:48 2009 From: jon at ffconsultancy.com (Jon Harrop) Date: Fri, 13 Nov 2009 11:34:48 +0000 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <150b8f420911122057s7f98b4a7u3b304f52cf1e631a@mail.gmail.com> References: <200911120458.27521.jon@ffconsultancy.com> <9430ad070911112246m77326a85uc321136da304fd9a@mail.gmail.com> <150b8f420911122057s7f98b4a7u3b304f52cf1e631a@mail.gmail.com> Message-ID: <200911131134.48394.jon@ffconsultancy.com> On Friday 13 November 2009 04:57:43 David Terei wrote: > I've run into some issues with tail calls in the past, make sure you > are doing the following: > > 1. Call should be marked with tail (obviously) > 2. Next statement after tail call should be 'return void' > 3. Use fast call convention for tail calls > 4. Make sure the function you are calling doesn't use the 'noreturn' > attribute. 5. Turn on tail calls in llc (if using the static compiler), > with > '-tailcallopt' option. > > Point 4 is the one that caused me trouble for some time. Unfortunately > it causes a bad interaction with the optimiser, specifically the > 'simplifycfg' pass. What seems to happen is that since the function > you are calling is marked with 'noreturn', the simplifycfg pass will > then put a 'unreachable' statement after the tail call to that > function. This stuffs up the tail call though as the llc compiler > requires tail calls be followed by a 'return void' statement. In my > case this caused my compiled programs to segfault if the llvm > optimiser was run on them. Isn't that a bug in LLVM? > I haven't fully investigated this yet so not really sure if it is > specific to my case or applies universally but it sure did cause me > some pains for a while. HLVM is certainly abiding by the requirements for tail calls or they wouldn't be working with the JIT and unoptimized static compilation. The problem only appears when the code is run through "opt". However, I am assuming that this segmentation fault is the result of a broken tail call. Perhaps it is something else... -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e From j.prasanth.j at gmail.com Fri Nov 13 06:35:39 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Fri, 13 Nov 2009 18:05:39 +0530 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue In-Reply-To: <4AF80219.6090809@zafena.se> References: <4AF80219.6090809@zafena.se> Message-ID: Hi all, with reference to the reply below, I downloaded toolchain from codesourcery (arm-2009q1-203-arm-none-linux-gnueabi) with gcc 4.3.3... when i compile llvm+clang with this toolchain i am getting the following error make[4]: Entering directory `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools/c-index-test' llvm[4]: Linking Release executable c-index-test (without symbols) /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/Release/bin/c-index-test: hidden symbol `__sync_val_compare_and_swap_4' in /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(linux-atomic.o) is referenced by DSO /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: final link failed: Nonrepresentable section on output collect2: ld returned 1 exit status make[4]: *** [/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/Release/bin/c-index-test] Error 1 make[4]: Leaving directory `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools/c-index-test' make[3]: *** [all] Error 1 make[3]: Leaving directory `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools' make[2]: *** [all] Error 1 make[2]: Leaving directory `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang' make[1]: *** [clang/.makeall] Error 2 make[1]: Leaving directory `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools' make: *** [all] Error 1 can anyone please tell me why am i getting this error and how can i resolve this? Thanks and Regards, Prasanth J On Mon, Nov 9, 2009 at 5:20 PM, Xerxes R?nby wrote: > Prasanth J skrev: > > Hi, > > > > i am a newbie to llvm architecture. i have been trying to port llvm on > > ARM target. i am using the following configuration for cross compiling > > llvm. > > > > ../llvm/configure --host=arm-linux --target=arm-linux > > --build=i686-linux --prefix=/opt/llvm-arm/ --enable-optimized > > --disable-debug \ > > --disable-expensive-checks --disable-doxygen \ > > --disable-threads --enable-targets=cbe,cpp,arm > > > > using this configuration i am facing the following compilation error. > > pls help me how to resolve this error.. > > > > /make[1]: Entering directory > > `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System' > > llvm[1]: Compiling Alarm.cpp for Release build > > llvm[1]: Compiling Atomic.cpp for Release build > > llvm[1]: Compiling Disassembler.cpp for Release build > > llvm[1]: Compiling DynamicLibrary.cpp for Release build > > llvm[1]: Compiling Errno.cpp for Release build > > llvm[1]: Compiling Host.cpp for Release build > > llvm[1]: Compiling IncludeFile.cpp for Release build > > llvm[1]: Compiling Memory.cpp for Release build > > /home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp: In > > static member function ?static void > > llvm::sys::Memory::InvalidateInstructionCache(const void*, size_t)?: > > /home/prasanth/LLVM_ARM/llvm-target/llvm/lib/System/Memory.cpp:67: > > error: ?__clear_cache? was not declared in this scope > > make[1]: *** > > [/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System/Release/Memory.o] > > Error 1 > > make[1]: Leaving directory > > `/home/prasanth/LLVM_ARM/llvm-target/obj-new/lib/System' > > make: *** [all] Error 1// > > > > /i can able to compile by commenting the line in Memory.cpp but i am > > not sure whether it will affect anything while running llvm on target. > > After cross-compilation i copied the binaries to target and i tried to > > compile and run a simple helloworld.c application. As clang requires a > > working gcc on target i used to "-ccc-clang-archs" options to skip the > > need for gcc on target. But still i am getting the following error. > > By commenting out that line will make your llvm version crash > sporadically since you would recreate llvm PR4960 if using the llvm JIT. > http://llvm.org/bugs/show_bug.cgi?id=4960 > > __clear_cache are needed to clear the instructioncache after jitting a > function and this gcc builtin are found in gcc 4.3.3 and later or > CodeSourcery's 2007Q3/2008Q1 compiler releases and later. > > Try updating you cross compiler! > > Cheers > Xerxes > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091113/3e3c4945/attachment.html From martijn at martijnrutten.com Fri Nov 13 06:52:28 2009 From: martijn at martijnrutten.com (Martijn) Date: Fri, 13 Nov 2009 13:52:28 +0100 Subject: [LLVMdev] llvm-gcc: missing dbg.declare/dbg.stoppoint at optimization level > O0 Message-ID: Hello, I use llvm and llvm-gcc as a C-to-C transformation tool using a modified version of the c backend, and rely on llvm debug instructions to link back to the original source code. Does anyone know how to get detailed line number and variable debug information at optimization levels beyond O0? Currently, I extract this debug information by compiling with -g. This works fine with "llvm-gcc -g -O0 --emit-llvm", i.e. no optimizations, but when I enable optimizations, e.g. "llvm-gcc -g -O2 --emit-llvm", most of the dbg.stoppoint and dbg.declare instructions dissapear. I tried to enable at least debug.declare instructions by removing the "if(optimize) return" statement in gcc/llvm-debug.cpp, DebugInfo::EmitDeclare(), but I still do not get any dbg.declare instructions. Is there a way to keep all debug information with optimizations enabled in llvm-gcc? If I have to disable some specific optimizations to keep the debug info correct that is fine. Thanks! Martijn ------------- Martijn Rutten martijn at martijnrutten.com From jay.foad at gmail.com Fri Nov 13 07:07:36 2009 From: jay.foad at gmail.com (Jay Foad) Date: Fri, 13 Nov 2009 13:07:36 +0000 Subject: [LLVMdev] dodgy use of c_str() Message-ID: >From llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp: void DebugInfo::EmitGlobalVariable(GlobalVariable *GV, tree decl) { // Gather location information. expanded_location Loc = expand_location(DECL_SOURCE_LOCATION(decl)); DIType TyD = getOrCreateType(TREE_TYPE(decl)); const char *DispName = GV->getNameStr().c_str(); Isn't this use of c_str() dodgy, because the temporary string returned by Gv->getNameStr() will be destroyed at the end of the expression, so it's no longer valid to use the memory pointed to by DispName? Thanks, Jay. From xerxes at zafena.se Fri Nov 13 08:09:49 2009 From: xerxes at zafena.se (=?windows-1252?Q?Xerxes_R=E5nby?=) Date: Fri, 13 Nov 2009 15:09:49 +0100 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue - now the __sync_val_compare_and_swap issue In-Reply-To: References: <4AF80219.6090809@zafena.se> Message-ID: <4AFD68AD.9080200@zafena.se> Prasanth J wrote: > > Hi all, > with reference to the reply below, I downloaded toolchain from > codesourcery (arm-2009q1-203-arm-none-linux-gnueabi) with gcc 4.3.3... > when i compile llvm+clang with this toolchain i am getting the > following error > > make[4]: Entering directory > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools/c-index-test' > llvm[4]: Linking Release executable c-index-test (without symbols) > /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/Release/bin/c-index-test: > hidden symbol `__sync_val_compare_and_swap_4' in > /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(linux-atomic.o) > is referenced by DSO > /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: > final link failed: Nonrepresentable section on output > collect2: ld returned 1 exit status > make[4]: *** > [/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/Release/bin/c-index-test] > Error 1 > make[4]: Leaving directory > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools/c-index-test' > make[3]: *** [all] Error 1 > make[3]: Leaving directory > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools' > make[2]: *** [all] Error 1 > make[2]: Leaving directory > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang' > make[1]: *** [clang/.makeall] Error 2 > make[1]: Leaving directory > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools' > make: *** [all] Error 1 > > can anyone please tell me why am i getting this error and how can i > resolve this? > > Thanks and Regards, > Prasanth J > > You get this linking error because the code contains a gcc atomic intrinsic calls using __sync_val_compare_and_swap . These are GCC built-ins and have only been implemented on ARM using GCC 4.4. http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Atomic-Builtins.html If you want to use GCC 4.3.3 then you have to implement the __sync_val_compare_and_swap_4 function yourself. Ubuntu Jaunty ARM toolchains have been patched to contains the atomic intrinsics support in GCC 4.3.3 So to solve this issue do one of the following: a) update your code sourcery cross compiler to arm-2009q3 that are using GCC 4.4 b) use the Ubuntu gcc 4.3.3 provided toolchain (i use this when compiling llvm natively on a arm machine without cross compilation) c) implement the __sync_val_compare_and_swap_4 function and patch llvm to enable compilation using older toolchains. Cheers Xerxes From dag at cray.com Fri Nov 13 08:44:26 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 08:44:26 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> Message-ID: <200911130844.26373.dag@cray.com> On Thursday 12 November 2009 19:58, Chris Lattner wrote: > On Nov 12, 2009, at 11:29 AM, Talin wrote: > > Well, as far as intp goes (or iptr if you prefer - the naming > > convention in LLVM is i) > > How about "intptr". I read this as "pointer to integer." iptr is slightly better because it follows the i convention. -Dave From etherzhhb at gmail.com Fri Nov 13 08:45:40 2009 From: etherzhhb at gmail.com (ether zhhb) Date: Fri, 13 Nov 2009 22:45:40 +0800 Subject: [LLVMdev] how to define a 24-bits register class Message-ID: <5f72161f0911130645p4cd7e103w4ec4459ca32dd192@mail.gmail.com> hi every one, i have a very strange cpu that have 24-bits reigsters, but i cant see i24 in machine value type? and if defining it as MVT others will be ok? thank you very much From dag at cray.com Fri Nov 13 08:45:44 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 08:45:44 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> Message-ID: <200911130845.45000.dag@cray.com> On Thursday 12 November 2009 21:35, Talin wrote: > There is also the question of whether intptrs should be allowed as > *members* of vectors. I have no opinion on this, except to say that it > probably only makes sense in situations where you can also have vectors of > pointers. We definitely want this for gather-scatter. It's going to become much more important shortly. -Dave From dag at cray.com Fri Nov 13 08:46:58 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 08:46:58 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> Message-ID: <200911130846.58588.dag@cray.com> On Thursday 12 November 2009 22:48, Chris Lattner wrote: > > There is also the question of whether intptrs should be allowed as > > *members* of vectors. I have no opinion on this, except to say that > > it probably only makes sense in situations where you can also have > > vectors of pointers. > > Vectors of pointers are not allowed. I think disallowing intptr in > vectors makes perfect sense. Then we're going to need to fix this in the IR fairly soon. We won't be able to support architectures like Larrabee nicely until we do. -Dave From jay.foad at gmail.com Fri Nov 13 08:52:53 2009 From: jay.foad at gmail.com (Jay Foad) Date: Fri, 13 Nov 2009 14:52:53 +0000 Subject: [LLVMdev] 2.6 release notes In-Reply-To: <65A36C84-B33A-49A0-94F0-B333FDA2CF11@apple.com> References: <65A36C84-B33A-49A0-94F0-B333FDA2CF11@apple.com> Message-ID: > Please feel free to directly edit the file or send improvements. I'm sure it's too late to do anything about the 2.6 release notes now, but I've just noticed they say: Major Changes and Removed Features * All LLVM tools now default to overwriting their output file, behaving more like standard unix tools. Previously, this only happened with the '-f' option. However, I'm pretty sure this change is only on trunk, not on the 2.6 branch, as described here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-August/025145.html Thanks, Jay. From jay.foad at gmail.com Fri Nov 13 09:27:36 2009 From: jay.foad at gmail.com (Jay Foad) Date: Fri, 13 Nov 2009 15:27:36 +0000 Subject: [LLVMdev] values with no name in 2.6 Message-ID: Hi, I've been upgrading some custom LLVM passes to work with LLVM 2.6 instead of LLVM 2.5. I've noticed that in 2.6, some functions seem to have several local values with no name (where getName() returns an empty string). I never saw this in 2.5. Is this a known change in behaviour? Is there some handy way to get unique, deterministic names assigned to all values in a function? Thanks, Jay. From clattner at apple.com Fri Nov 13 10:22:24 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 13 Nov 2009 08:22:24 -0800 Subject: [LLVMdev] values with no name in 2.6 In-Reply-To: References: Message-ID: <6906228D-0F30-48E9-99D8-6CC287A90AEE@apple.com> On Nov 13, 2009, at 7:27 AM, Jay Foad wrote: > Hi, > > I've been upgrading some custom LLVM passes to work with LLVM 2.6 > instead of LLVM 2.5. I've noticed that in 2.6, some functions seem to > have several local values with no name (where getName() returns an > empty string). I never saw this in 2.5. Is this a known change in > behaviour? Is there some handy way to get unique, deterministic names > assigned to all values in a function? llvm 1.0 didn't require names, so this isn't new behavior :). What is new is that the frontends aren't as consistent about naming new values. If you want to get names assigned to things, run the bc file through "opt -instnamer". -Chris From clattner at apple.com Fri Nov 13 10:23:02 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 13 Nov 2009 08:23:02 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <200911130846.58588.dag@cray.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> <200911130846.58588.dag@cray.com> Message-ID: <9BED03A1-8939-44D6-BDAE-22451550CCFE@apple.com> On Nov 13, 2009, at 6:46 AM, David Greene wrote: > On Thursday 12 November 2009 22:48, Chris Lattner wrote: > >>> There is also the question of whether intptrs should be allowed as >>> *members* of vectors. I have no opinion on this, except to say that >>> it probably only makes sense in situations where you can also have >>> vectors of pointers. >> >> Vectors of pointers are not allowed. I think disallowing intptr in >> vectors makes perfect sense. > > Then we're going to need to fix this in the IR fairly soon. We > won't be > able to support architectures like Larrabee nicely until we do. Let me rephrase: I think it is fine to ignore vectors in the first iteration, we can always add support for them later. -Chris From clattner at apple.com Fri Nov 13 10:24:27 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 13 Nov 2009 08:24:27 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <4AFD0ABD.2070604@apple.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> <4AFD0ABD.2070604@apple.com> Message-ID: On Nov 12, 2009, at 11:29 PM, John McCall wrote: >> sext/zext/trunc are very nice for the optimizer, we should keep >> them. It means that the optimizer doesn't have to check that the >> input to a sext is bigger or smaller than the result, for example. >> Code that cares (e.g. instcombine) really likes this. > > We could just say that code has undefined behavior or is invalid if > the 'sext', 'zext', or 'trunc' is inappropriate for the actual size > of intptr. I think this is reasonable; if the frontend emits a > zext intptr to i32, and the pointer side is i64, that *should* be > invalid. This way the optimizer gets to keep its assumptions and it > becomes the client's responsibility to ensure that its "target- > neutral" bitcode really is neutral for the range of platforms it > actually cares about. Portable code can't be truncating arbitrary > pointers to some smaller type anyway; if the client just wants to > munge the bottom bits, it can zext and trunc to and from i8/i12/ > whatever. The optimizer assumes that the input and output of (e.g.) zext are both IntegerType's (which intptr won't be) and that the input is smaller (and thus non-equal to) the result type. We really don't want to break these invariants, -Chris From clattner at apple.com Fri Nov 13 10:26:01 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 13 Nov 2009 08:26:01 -0800 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <200911131134.48394.jon@ffconsultancy.com> References: <200911120458.27521.jon@ffconsultancy.com> <9430ad070911112246m77326a85uc321136da304fd9a@mail.gmail.com> <150b8f420911122057s7f98b4a7u3b304f52cf1e631a@mail.gmail.com> <200911131134.48394.jon@ffconsultancy.com> Message-ID: <96B81C05-0BFD-470D-868D-231C202CF19A@apple.com> On Nov 13, 2009, at 3:34 AM, Jon Harrop wrote: >> Point 4 is the one that caused me trouble for some time. >> Unfortunately >> it causes a bad interaction with the optimiser, specifically the >> 'simplifycfg' pass. What seems to happen is that since the function >> you are calling is marked with 'noreturn', the simplifycfg pass will >> then put a 'unreachable' statement after the tail call to that >> function. This stuffs up the tail call though as the llc compiler >> requires tail calls be followed by a 'return void' statement. In my >> case this caused my compiled programs to segfault if the llvm >> optimiser was run on them. > > Isn't that a bug in LLVM? Yes, please file a bugzilla with a small example. -Chris From clattner at apple.com Fri Nov 13 10:26:55 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 13 Nov 2009 08:26:55 -0800 Subject: [LLVMdev] dodgy use of c_str() In-Reply-To: References: Message-ID: <1F949099-A362-455B-BF33-EB1EFBEE84A0@apple.com> On Nov 13, 2009, at 5:07 AM, Jay Foad wrote: >> From llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp: > > void DebugInfo::EmitGlobalVariable(GlobalVariable *GV, tree decl) { > // Gather location information. > expanded_location Loc = expand_location(DECL_SOURCE_LOCATION(decl)); > DIType TyD = getOrCreateType(TREE_TYPE(decl)); > const char *DispName = GV->getNameStr().c_str(); > > Isn't this use of c_str() dodgy, because the temporary string returned > by Gv->getNameStr() will be destroyed at the end of the expression, so > it's no longer valid to use the memory pointed to by DispName? Yes, absolutely. Devang, please take a look when you get a chance. This should use getName() with StringRef. -Chris From resistor at mac.com Fri Nov 13 10:26:58 2009 From: resistor at mac.com (Owen Anderson) Date: Fri, 13 Nov 2009 08:26:58 -0800 Subject: [LLVMdev] values with no name in 2.6 In-Reply-To: References: Message-ID: <7EB27F03-15DF-46B5-971D-83BA43797510@mac.com> On Nov 13, 2009, at 7:27 AM, Jay Foad wrote: > Hi, > > I've been upgrading some custom LLVM passes to work with LLVM 2.6 > instead of LLVM 2.5. I've noticed that in 2.6, some functions seem to > have several local values with no name (where getName() returns an > empty string). I never saw this in 2.5. Is this a known change in > behaviour? Is there some handy way to get unique, deterministic names > assigned to all values in a function? Run the -instnamer pass. --Owen -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2620 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091113/98058f99/attachment.bin From clattner at apple.com Fri Nov 13 10:28:43 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 13 Nov 2009 08:28:43 -0800 Subject: [LLVMdev] how to define a 24-bits register class In-Reply-To: <5f72161f0911130645p4cd7e103w4ec4459ca32dd192@mail.gmail.com> References: <5f72161f0911130645p4cd7e103w4ec4459ca32dd192@mail.gmail.com> Message-ID: On Nov 13, 2009, at 6:45 AM, ether zhhb wrote: > hi every one, > > i have a very strange cpu that have 24-bits reigsters, but i cant see > i24 in machine value type? and if defining it as MVT others will be > ok? You'd want to add a new i24 MVT enum. -Chris From jay.foad at gmail.com Fri Nov 13 10:35:28 2009 From: jay.foad at gmail.com (Jay Foad) Date: Fri, 13 Nov 2009 16:35:28 +0000 Subject: [LLVMdev] values with no name in 2.6 In-Reply-To: <7EB27F03-15DF-46B5-971D-83BA43797510@mac.com> References: <7EB27F03-15DF-46B5-971D-83BA43797510@mac.com> Message-ID: > run the bc file through "opt -instnamer" > Run the -instnamer pass. Thanks to both of you - that does the trick! Jay. From jon at ffconsultancy.com Fri Nov 13 11:07:08 2009 From: jon at ffconsultancy.com (Jon Harrop) Date: Fri, 13 Nov 2009 17:07:08 +0000 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <96B81C05-0BFD-470D-868D-231C202CF19A@apple.com> References: <200911120458.27521.jon@ffconsultancy.com> <200911131134.48394.jon@ffconsultancy.com> <96B81C05-0BFD-470D-868D-231C202CF19A@apple.com> Message-ID: <200911131707.09139.jon@ffconsultancy.com> On Friday 13 November 2009 16:26:01 Chris Lattner wrote: > On Nov 13, 2009, at 3:34 AM, Jon Harrop wrote: > >> Point 4 is the one that caused me trouble for some time. > >> Unfortunately > >> it causes a bad interaction with the optimiser, specifically the > >> 'simplifycfg' pass. What seems to happen is that since the function > >> you are calling is marked with 'noreturn', the simplifycfg pass will > >> then put a 'unreachable' statement after the tail call to that > >> function. This stuffs up the tail call though as the llc compiler > >> requires tail calls be followed by a 'return void' statement. In my > >> case this caused my compiled programs to segfault if the llvm > >> optimiser was run on them. > > > > Isn't that a bug in LLVM? > > Yes, please file a bugzilla with a small example. I think I may be having a similar problem, albeit with with noalias rather than noreturn. This is my tail recursive function: define fastcc noalias i8* @fold_aux(%2*, i32, i8* (%2*, %2, double)*, %2, %0) { entry: %5 = load i32* @shadow_stack_depth ; [#uses=4] %6 = alloca %2, align 8 ; <%2*> [#uses=2] %7 = load %0* @shadow_stack ; <%0> [#uses=1] %8 = extractvalue %0 %7, 2 ; [#uses=1] %9 = bitcast i8* %8 to %0* ; <%0*> [#uses=1] %10 = sext i32 %5 to i64 ; [#uses=1] %11 = getelementptr %0* %9, i64 %10 ; <%0*> [#uses=1] store %0 %4, %0* %11 %12 = add i32 %5, 1 ; [#uses=1] store i32 %12, i32* @shadow_stack_depth %13 = load i32* @n_allocated ; [#uses=1] %14 = load i32* @quota ; [#uses=1] %15 = icmp sgt i32 %13, %14 ; [#uses=1] br i1 %15, label %fail, label %cont fail: ; preds = %entry %16 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @buf16, i64 0, i64 0)) ; [#uses=0] %17 = load double ()** @hlvm_time ; [#uses=1] %18 = call double %17() ; [#uses=1] %19 = call fastcc i8* @gc_mark(i32 0) ; [#uses=0] %20 = load double* @mark_time ; [#uses=1] %21 = load double ()** @hlvm_time ; [#uses=1] %22 = call double %21() ; [#uses=1] %23 = fadd double %20, %22 ; [#uses=1] %24 = fsub double %23, %18 ; [#uses=1] store double %24, double* @mark_time %25 = load double ()** @hlvm_time ; [#uses=1] %26 = call double %25() ; [#uses=1] %27 = call fastcc i8* @gc_sweep(i32 0) ; [#uses=0] %28 = load double* @sweep_time ; [#uses=1] %29 = load double ()** @hlvm_time ; [#uses=1] %30 = call double %29() ; [#uses=1] %31 = fadd double %28, %30 ; [#uses=1] %32 = fsub double %31, %26 ; [#uses=1] store double %32, double* @sweep_time %33 = load i32* @n_allocated ; [#uses=1] %34 = shl i32 %33, 2 ; [#uses=1] %35 = add i32 %34, 256 ; [#uses=1] store i32 %35, i32* @quota br label %cont cont: ; preds = %fail, %entry %36 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @buf17, i64 0, i64 0)) ; [#uses=0] %37 = extractvalue %0 %4, 1 ; [#uses=1] %38 = icmp sgt i32 %37, %1 ; [#uses=1] br i1 %38, label %pass2, label %fail1 fail1: ; preds = %cont store i32 %5, i32* @shadow_stack_depth store %2 %3, %2* %0 ret i8* undef pass2: ; preds = %cont %39 = add i32 %1, 1 ; [#uses=1] %40 = icmp slt i32 %1, 0 ; [#uses=1] br i1 %40, label %fail6, label %pass4 pass4: ; preds = %pass2 %41 = extractvalue %0 %4, 1 ; [#uses=1] %42 = icmp sgt i32 %41, %1 ; [#uses=1] br i1 %42, label %cont8, label %fail6 fail6: ; preds = %pass4, %pass2 %43 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([27 x i8]* @buf5, i64 0, i64 0)) ; [#uses=0] call void @exit(i32 1) br label %cont8 cont8: ; preds = %fail6, %pass4 %44 = extractvalue %0 %4, 2 ; [#uses=1] %45 = bitcast i8* %44 to double* ; [#uses=1] %46 = sext i32 %1 to i64 ; [#uses=1] %47 = getelementptr double* %45, i64 %46 ; [#uses=1] %48 = load double* %47 ; [#uses=1] %49 = call fastcc i8* %2(%2* %6, %2 %3, double %48) ; [#uses=0] %50 = load %2* %6 ; <%2> [#uses=1] store i32 %5, i32* @shadow_stack_depth %51 = tail call fastcc i8* @fold_aux(%2* %0, i32 %39, i8* (%2*, %2, double)* %2, %2 %50, %0 %4) ; [#uses=1] ret i8* %51 } That last call is the critical tail call and AFAICT it is stack overflowing. Anyone seen any problems like this before? I'll try removing the noalias and seeing if that fixes it. If so, I'll file a bug report. Which part of LLVM would this be a bug in if things like noalias and noreturn inhibit TCO when they shouldn't? -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e From samuraileumas at yahoo.com Fri Nov 13 12:16:24 2009 From: samuraileumas at yahoo.com (Samuel Crow) Date: Fri, 13 Nov 2009 10:16:24 -0800 (PST) Subject: [LLVMdev] AsmParser is not robust Message-ID: <580423.11648.qm@web62007.mail.re1.yahoo.com> Hello all, My partner was just debugging a project that had tried to call a function without arguments in the code but the declaration wasn't declared with a void parameter list. It failed with an assertion that something was trying to ++ past the end of an ilist. I seem to remember Chris Lattner saying when he made the hand written AsmParser that it wasn't intended to be very robust but, searching the list, I can't find the post where he said it. That being said, is this worthy of a bug report? An error message from the AsmParser would be preferred over a seemingly unrelated assert. Cheers, --Sam Crow From grosbach at apple.com Fri Nov 13 12:20:54 2009 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 13 Nov 2009 10:20:54 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <4AFD0ABD.2070604@apple.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> <4AFD0ABD.2070604@apple.com> Message-ID: <9E176D02-86B3-4AB2-9C96-7B6ED623413C@apple.com> On Nov 12, 2009, at 11:29 PM, John McCall wrote: > Chris Lattner wrote: >> On Nov 12, 2009, at 7:35 PM, Talin wrote: >>> On Thu, Nov 12, 2009 at 5:58 PM, Chris Lattner >>> wrote: >>> >>> There is also the issue of how constants should be represented. >>> >>> For all current processors that I know of, an intptr will be >>> either 32 or 64 bits. However, there may be some future processor >>> which supports 128-bit pointers (although a system containing that >>> much RAM or even virtual address space is hard to imagine.) >> >> 8, 16, and 24-bit address spaces are also popular. > > To be really pedantic, a single platform may have multiple pointer > widths; I assume intptr would correspond to the width of a generic > pointer, but non-generic address spaces are not constrained in any > direction by the size of the generic address space. Of course, non- > generic address spaces have no place in portable bitcode anyway, but > I wanted to insert a note of pedantry into the conversation. :) > That's not all that uncommon a situation in the embedded world. Definitely something to keep in mind. -Jim >>> Almost *all* constant folding would have to be deferred, which >>> means you'd get big chains of constant exprs. This isn't a >>> problem per-say, but something to be aware of. >>> >>> I don't like reusing existing sext/trunc/zext/inttoptr/ptrtoint >>> casts for intptr. I think we should introduce new operations >>> (hopefully with better names): >>> >>> ptr to intptr >>> intptr to ptr >>> intptr to signed int >>> signed int to intptr >>> intptr to unsigned int >>> unsigned int to intptr >>> >>> Does that seem reasonable? >>> >>> Sure. Another option is to do away with sext/trunc/etc. and just >>> have two cast operations for ints: sicast and uicast. sicast >>> converts any int size to any other (with sign extension if the >>> destination type is bigger), and uicast is the same but with zero >>> extension. >> >> sext/zext/trunc are very nice for the optimizer, we should keep >> them. It means that the optimizer doesn't have to check that the >> input to a sext is bigger or smaller than the result, for example. >> Code that cares (e.g. instcombine) really likes this. > > We could just say that code has undefined behavior or is invalid if > the 'sext', 'zext', or 'trunc' is inappropriate for the actual size > of intptr. I think this is reasonable; if the frontend emits a > zext intptr to i32, and the pointer side is i64, that *should* be > invalid. This way the optimizer gets to keep its assumptions and it > becomes the client's responsibility to ensure that its "target- > neutral" bitcode really is neutral for the range of platforms it > actually cares about. Portable code can't be truncating arbitrary > pointers to some smaller type anyway; if the client just wants to > munge the bottom bits, it can zext and trunc to and from i8/i12/ > whatever. > > John. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From clattner at apple.com Fri Nov 13 12:40:35 2009 From: clattner at apple.com (Chris Lattner) Date: Fri, 13 Nov 2009 10:40:35 -0800 Subject: [LLVMdev] AsmParser is not robust In-Reply-To: <580423.11648.qm@web62007.mail.re1.yahoo.com> References: <580423.11648.qm@web62007.mail.re1.yahoo.com> Message-ID: On Nov 13, 2009, at 10:16 AM, Samuel Crow wrote: > Hello all, > > My partner was just debugging a project that had tried to call a > function without arguments in the code but the declaration wasn't > declared with a void parameter list. It failed with an assertion > that something was trying to ++ past the end of an ilist. > > I seem to remember Chris Lattner saying when he made the hand > written AsmParser that it wasn't intended to be very robust but, > searching the list, I can't find the post where he said it. That > being said, is this worthy of a bug report? An error message from > the AsmParser would be preferred over a seemingly unrelated assert. Please file a bug, it certainly should be "robust". Switching it to a hand written parser is intended to improve the robustness, not reduce it. In any case, this doesn't have anything to do with the parser, it sounds like the code is grammatically correct but semantically invalid. -Chris From gohman at apple.com Fri Nov 13 13:00:12 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 13 Nov 2009 11:00:12 -0800 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <200911131707.09139.jon@ffconsultancy.com> References: <200911120458.27521.jon@ffconsultancy.com> <200911131134.48394.jon@ffconsultancy.com> <96B81C05-0BFD-470D-868D-231C202CF19A@apple.com> <200911131707.09139.jon@ffconsultancy.com> Message-ID: <6CFA52EF-E484-47D0-94E9-019B90F55940@apple.com> On Nov 13, 2009, at 9:07 AM, Jon Harrop wrote: > > I'll try removing the noalias and seeing if that fixes it. If so, I'll file a > bug report. Which part of LLVM would this be a bug in if things like noalias > and noreturn inhibit TCO when they shouldn't? CodeGen. I looked at noalias, and it was indeed a bug. This is now fixed on trunk in r88672. Noreturn is a different issue. Dan From jon at ffconsultancy.com Fri Nov 13 13:09:53 2009 From: jon at ffconsultancy.com (Jon Harrop) Date: Fri, 13 Nov 2009 19:09:53 +0000 Subject: [LLVMdev] opt -std-compile-opts breaks tail calls In-Reply-To: <6CFA52EF-E484-47D0-94E9-019B90F55940@apple.com> References: <200911120458.27521.jon@ffconsultancy.com> <200911131707.09139.jon@ffconsultancy.com> <6CFA52EF-E484-47D0-94E9-019B90F55940@apple.com> Message-ID: <200911131909.53227.jon@ffconsultancy.com> On Friday 13 November 2009 19:00:12 Dan Gohman wrote: > On Nov 13, 2009, at 9:07 AM, Jon Harrop wrote: > > I'll try removing the noalias and seeing if that fixes it. If so, I'll > > file a bug report. Which part of LLVM would this be a bug in if things > > like noalias and noreturn inhibit TCO when they shouldn't? > > CodeGen. I looked at noalias, and it was indeed a bug. This is now > fixed on trunk in r88672. Noreturn is a different issue. Thanks: I tested it and removing noalias did indeed fix that stack overflow. Unfortunately, the generated code is still broken in some other way that is causing a segfault. I'll keep digging... -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e From anton at korobeynikov.info Fri Nov 13 13:09:07 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Fri, 13 Nov 2009 22:09:07 +0300 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> Message-ID: > 8, 16, and 24-bit address spaces are also popular. MSP430 can have either 16 or 20 bit pointers :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From viridia at gmail.com Fri Nov 13 13:12:08 2009 From: viridia at gmail.com (Talin) Date: Fri, 13 Nov 2009 11:12:08 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> Message-ID: On Fri, Nov 13, 2009 at 11:09 AM, Anton Korobeynikov < anton at korobeynikov.info> wrote: > > 8, 16, and 24-bit address spaces are also popular. > MSP430 can have either 16 or 20 bit pointers :) > I'm more interested in knowing whether there is an upper bound on pointer width. If there is, then it becomes relatively simple to store intptr constants - just represent them using integers whose size is the upper bound, and then truncate them later when the size becomes known. > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University > -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091113/33fbaff2/attachment.html From rjmccall at apple.com Fri Nov 13 13:13:23 2009 From: rjmccall at apple.com (John McCall) Date: Fri, 13 Nov 2009 11:13:23 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> <4AFD0ABD.2070604@apple.com> Message-ID: <4AFDAFD3.6060901@apple.com> Chris Lattner wrote: > On Nov 12, 2009, at 11:29 PM, John McCall wrote: >>> sext/zext/trunc are very nice for the optimizer, we should keep >>> them. It means that the optimizer doesn't have to check that the >>> input to a sext is bigger or smaller than the result, for example. >>> Code that cares (e.g. instcombine) really likes this. >> >> We could just say that code has undefined behavior or is invalid if >> the 'sext', 'zext', or 'trunc' is inappropriate for the actual size >> of intptr. I think this is reasonable; if the frontend emits a zext >> intptr to i32, and the pointer side is i64, that *should* be >> invalid. This way the optimizer gets to keep its assumptions and it >> becomes the client's responsibility to ensure that its >> "target-neutral" bitcode really is neutral for the range of platforms >> it actually cares about. Portable code can't be truncating arbitrary >> pointers to some smaller type anyway; if the client just wants to >> munge the bottom bits, it can zext and trunc to and from >> i8/i12/whatever. > > The optimizer assumes that the input and output of (e.g.) zext are > both IntegerType's (which intptr won't be) and that the input is > smaller (and thus non-equal to) the result type. We really don't want > to break these invariants, I didn't realize that an identity zext was actually invalid IR. That seems like it probably causes more trouble than it's worth. Anyway, I suspect the question is whether you would rather break these invariants (which are probably not critical for most optimizations) or slowly accumulate duplicate code paths in every pass that looks at zexts and truncs. John. From rjmccall at apple.com Fri Nov 13 13:31:19 2009 From: rjmccall at apple.com (John McCall) Date: Fri, 13 Nov 2009 11:31:19 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <4AFDAFD3.6060901@apple.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> <4AFD0ABD.2070604@apple.com> <4AFDAFD3.6060901@apple.com> Message-ID: <4AFDB407.6080109@apple.com> John McCall wrote: > I didn't realize that an identity zext was actually invalid IR. That > seems like it probably causes more trouble than it's worth. > > Anyway, I suspect the question is whether you would rather break these > invariants (which are probably not critical for most optimizations) or > slowly accumulate duplicate code paths in every pass that looks at zexts > and truncs. > Actually, I take this back; there are definitely common optimizations that are going to be much more complicated if they have to deal with intptrs, most obviously instcombining trunc/zext/sext. John. From kennethuil at gmail.com Fri Nov 13 13:37:18 2009 From: kennethuil at gmail.com (Kenneth Uildriks) Date: Fri, 13 Nov 2009 13:37:18 -0600 Subject: [LLVMdev] Proposal: intp type In-Reply-To: <4AFDB407.6080109@apple.com> References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> <13F1ABA0-413E-4E6C-8BAB-08DE8EB9A838@apple.com> <4AFD0ABD.2070604@apple.com> <4AFDAFD3.6060901@apple.com> <4AFDB407.6080109@apple.com> Message-ID: <400d33ea0911131137u4ebfe461t103354daa1e79f67@mail.gmail.com> On Fri, Nov 13, 2009 at 1:31 PM, John McCall wrote: > John McCall wrote: >> I didn't realize that an identity zext was actually invalid IR. ?That >> seems like it probably causes more trouble than it's worth. >> >> Anyway, I suspect the question is whether you would rather break these >> invariants (which are probably not critical for most optimizations) or >> slowly accumulate duplicate code paths in every pass that looks at zexts >> and truncs. >> > > Actually, I take this back; ?there are definitely common optimizations > that are going to be much more complicated if they have to deal with > intptrs, most obviously instcombining trunc/zext/sext. If you're leaving out target data, you're clearly going to miss target-specific optimization opportunities. That's the breaks when you're doing target-independent optimizations. But you can always optimize again with target data once you've selected a target. If there is target data, then intptr reduces to a plain int of the appropriate size, and conversion instructions involving intptr can resolve to the integer trunc/zext/sext equivalent, and instcombining can proceed as normal with all sizes known. From david_goodwin at apple.com Fri Nov 13 14:41:56 2009 From: david_goodwin at apple.com (David Goodwin) Date: Fri, 13 Nov 2009 12:41:56 -0800 Subject: [LLVMdev] -debug and -print-machineinstrs broken Message-ID: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> Are these known to be broken right now? I get failure when using either. $ llc -march=arm -print-machineinstrs hw.bc ... BB#0: derived from LLVM BB %entry Live Ins: %LR %R7 %SP = SUBri %SP, 8, 14, %reg0, %reg0 STR %LR, %SP, %reg0, 4, 14, %reg0; mem:ST4[0 llc 0x008b3304 PrintStackTrace(void*) + 45 1 llc 0x008b390c SignalHandler(int) + 410 2 libSystem.B.dylib 0x93130b9b _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1827468431 4 llc 0x0078d74b createSlotTracker(llvm::Value const*) + 114 5 llc 0x00790c21 WriteAsOperandInternal (llvm::raw_ostream&, llvm::Value const*, llvm::TypePrinting*, (anonymous namespace)::SlotTracker*) + 799 6 llc 0x00794089 llvm::WriteAsOperand (llvm::raw_ostream&, llvm::Value const*, bool, llvm::Module const*) + 126 7 llc 0x005dce23 llvm::operator<<(llvm::raw_ostream&, llvm::MachineMemOperand const&) + 358 8 llc 0x005de0c4 llvm::MachineInstr::print (llvm::raw_ostream&, llvm::TargetMachine const*) const + 1166 9 llc 0x005c9242 llvm::MachineBasicBlock::print (llvm::raw_ostream&) const + 910 10 llc 0x005d2cd5 llvm::MachineFunction::print (llvm::raw_ostream&) const + 1033 11 llc 0x005d2dcf (anonymous namespace)::Printer::runOnMachineFunction(llvm::MachineFunction&) + 97 12 llc 0x005d8e33 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 77 13 llc 0x00835d21 llvm::FPPassManager::runOnFunction (llvm::Function&) + 271 14 llc 0x00837a24 llvm::FunctionPassManagerImpl::run (llvm::Function&) + 112 15 llc 0x00837bf0 llvm::FunctionPassManager::run (llvm::Function&) + 130 16 llc 0x0002b343 main + 3448 17 llc 0x00029e21 start + 53 Stack dump: 0. Program arguments: llc -march=arm -print-machineinstrs hw.bc 1. Running pass 'MachineFunction Printer' on function '@main' Bus error From hvdspek at liacs.nl Fri Nov 13 15:02:07 2009 From: hvdspek at liacs.nl (Harmen van der Spek) Date: Fri, 13 Nov 2009 22:02:07 +0100 Subject: [LLVMdev] Poolalloc asserts when passing in pool descriptors Message-ID: Hi, The poolalloc library fails in TransformFunctionBody.cpp, line 746 --- Value *ArgVal = ConstantAggregateZero::get(PoolAllocate::PoolDescPtrTy); --- opt -load /path_to_lib/libpoolalloc.dylib -poolalloc constaggr.bc -o opt.bc -f triggers the problem (bc file attached). Assertion failed: ((isa(Ty) || isa(Ty) || isa(Ty)) && "Cannot create an aggregate zero of non-aggregate type!"), function get, file lib/VMCore/Constants.cpp, line 859. Changing it to Value *ArgVal = Constant::getNullValue(PoolAllocate::PoolDescPtrTy); which was used in revision 72001, fixes the problem. Harmen -------------- next part -------------- A non-text attachment was scrubbed... Name: constaggr.bc Type: application/octet-stream Size: 704 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091113/65b3e730/attachment.obj From criswell at uiuc.edu Fri Nov 13 15:12:20 2009 From: criswell at uiuc.edu (John Criswell) Date: Fri, 13 Nov 2009 15:12:20 -0600 Subject: [LLVMdev] Poolalloc asserts when passing in pool descriptors In-Reply-To: References: Message-ID: <4AFDCBB4.30309@uiuc.edu> Dear Harmen, You're correct. I've applied the fix. Thanks! -- John T. Harmen van der Spek wrote: > Hi, > > The poolalloc library fails in TransformFunctionBody.cpp, line 746 > > --- > Value *ArgVal = ConstantAggregateZero::get(PoolAllocate::PoolDescPtrTy); > --- > > opt -load /path_to_lib/libpoolalloc.dylib -poolalloc constaggr.bc -o > opt.bc -f > > triggers the problem (bc file attached). > > Assertion failed: ((isa(Ty) || isa(Ty) || > isa(Ty)) && "Cannot create an aggregate zero of > non-aggregate type!"), function get, file lib/VMCore/Constants.cpp, line > 859. > > Changing it to > Value *ArgVal = Constant::getNullValue(PoolAllocate::PoolDescPtrTy); > > which was used in revision 72001, fixes the problem. > > > Harmen > From anton at korobeynikov.info Fri Nov 13 15:17:48 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Sat, 14 Nov 2009 00:17:48 +0300 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> Message-ID: > Are these known to be broken right now? I get failure when using either. > > $ llc -march=arm -print-machineinstrs hw.bc Seems due to David's patches. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From dag at cray.com Fri Nov 13 15:36:42 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 15:36:42 -0600 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> Message-ID: <200911131536.42987.dag@cray.com> On Friday 13 November 2009 15:17, Anton Korobeynikov wrote: > > Are these known to be broken right now? I get failure when using either. > > > > $ llc -march=arm -print-machineinstrs hw.bc > > Seems due to David's patches. Ok. Send me a testcase and I will fix. This should be put into the testbase. -Dave From david_goodwin at apple.com Fri Nov 13 15:38:34 2009 From: david_goodwin at apple.com (David Goodwin) Date: Fri, 13 Nov 2009 13:38:34 -0800 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: <200911131536.42987.dag@cray.com> References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> <200911131536.42987.dag@cray.com> Message-ID: <59B9107F-C9AF-4BC8-8FF0-49968BE718E3@apple.com> Many files seem to fail. I've attached a small one... -------------- next part -------------- A non-text attachment was scrubbed... Name: hw.bc Type: application/octet-stream Size: 608 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091113/ab07a412/attachment.obj -------------- next part -------------- On Nov 13, 2009, at 1:36 PM, David Greene wrote: > On Friday 13 November 2009 15:17, Anton Korobeynikov wrote: >>> Are these known to be broken right now? I get failure when using >>> either. >>> >>> $ llc -march=arm -print-machineinstrs hw.bc >> >> Seems due to David's patches. > > Ok. Send me a testcase and I will fix. This should be put into > the testbase. > > -Dave From dag at cray.com Fri Nov 13 15:49:52 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 15:49:52 -0600 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> Message-ID: <200911131549.52528.dag@cray.com> On Friday 13 November 2009 15:17, you wrote: > > Are these known to be broken right now? I get failure when using either. > > > > $ llc -march=arm -print-machineinstrs hw.bc > > Seems due to David's patches. Ok, it's faulting in SlotTracker with what looks like a bad Function. One of the Argument values is corrupted. I'm not abdicating responsibility, but at the moment I don't see the connection to my patches. Anton, are you seeing something specific as to the cause? I will keep investigating. -Dave From dag at cray.com Fri Nov 13 16:23:53 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 16:23:53 -0600 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: <200911131549.52528.dag@cray.com> References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> <200911131549.52528.dag@cray.com> Message-ID: <200911131623.54193.dag@cray.com> On Friday 13 November 2009 15:49, David Greene wrote: > On Friday 13 November 2009 15:17, you wrote: > > > Are these known to be broken right now? I get failure when using > > > either. > > > > > > $ llc -march=arm -print-machineinstrs hw.bc > > > > Seems due to David's patches. > > Ok, it's faulting in SlotTracker with what looks like a bad Function. One > of the Argument values is corrupted. > > I'm not abdicating responsibility, but at the moment I don't see the > connection to my patches. Anton, are you seeing something specific > as to the cause? > > I will keep investigating. Somehow a MachineIntr memoperand is pointing to an Instruction. That's not supposed to happen, is it? I saw the symptom change after updating to ToT so I suspect this is a rather subtle memory corruption problem. -Dave From gohman at apple.com Fri Nov 13 16:28:27 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 13 Nov 2009 14:28:27 -0800 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: <200911131549.52528.dag@cray.com> References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> <200911131549.52528.dag@cray.com> Message-ID: <540286C6-9B63-4E87-9CA6-DC80BB510D22@apple.com> On Nov 13, 2009, at 1:49 PM, David Greene wrote: > On Friday 13 November 2009 15:17, you wrote: >>> Are these known to be broken right now? I get failure when using either. >>> >>> $ llc -march=arm -print-machineinstrs hw.bc >> >> Seems due to David's patches. > > Ok, it's faulting in SlotTracker with what looks like a bad Function. One of > the Argument values is corrupted. > > I'm not abdicating responsibility, but at the moment I don't see the > connection to my patches. Anton, are you seeing something specific > as to the cause? > > I will keep investigating. The cause was isa was returning true for the new FixedStackPseudoSourceValue values. I fixed it on trunk, and added a comment to hopefully protect against others making this mistake in the future. Dan From samuraileumas at yahoo.com Fri Nov 13 16:30:06 2009 From: samuraileumas at yahoo.com (Samuel Crow) Date: Fri, 13 Nov 2009 14:30:06 -0800 (PST) Subject: [LLVMdev] Fw: AsmParser is not robust In-Reply-To: References: <580423.11648.qm@web62007.mail.re1.yahoo.com> Message-ID: <793739.62179.qm@web62002.mail.re1.yahoo.com> ...and forwarded to list. :-/ ----- Forwarded Message ---- > From: Samuel Crow > To: Chris Lattner > Sent: Fri, November 13, 2009 4:28:59 PM > Subject: Re: [LLVMdev] AsmParser is not robust > > Bug report #5486 filed. > > > > ----- Original Message ---- > > From: Chris Lattner > > To: Samuel Crow > > Cc: LLVM Developers Mailing List > > Sent: Fri, November 13, 2009 12:40:35 PM > > Subject: Re: [LLVMdev] AsmParser is not robust > > > > On Nov 13, 2009, at 10:16 AM, Samuel Crow wrote: > > > Hello all, > > > > > > My partner was just debugging a project that had tried to call a function > > without arguments in the code but the declaration wasn't declared with a void > > parameter list. It failed with an assertion that something was trying to ++ > > past the end of an ilist. > > > > > > I seem to remember Chris Lattner saying when he made the hand written > > AsmParser that it wasn't intended to be very robust but, searching the list, I > > > can't find the post where he said it. That being said, is this worthy of a > bug > > report? An error message from the AsmParser would be preferred over a > seemingly > > unrelated assert. > > > > Please file a bug, it certainly should be "robust". Switching it to a hand > > written parser is intended to improve the robustness, not reduce it. In any > > case, this doesn't have anything to do with the parser, it sounds like the > code > > is grammatically correct but semantically invalid. > > > > -Chris From dag at cray.com Fri Nov 13 16:30:03 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 16:30:03 -0600 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: <200911131549.52528.dag@cray.com> References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> <200911131549.52528.dag@cray.com> Message-ID: <200911131630.03751.dag@cray.com> On Friday 13 November 2009 15:49, David Greene wrote: > On Friday 13 November 2009 15:17, you wrote: > > > Are these known to be broken right now? I get failure when using > > > either. > > > > > > $ llc -march=arm -print-machineinstrs hw.bc > > > > Seems due to David's patches. > > Ok, it's faulting in SlotTracker with what looks like a bad Function. One > of the Argument values is corrupted. > > I'm not abdicating responsibility, but at the moment I don't see the > connection to my patches. Anton, are you seeing something specific > as to the cause? > > I will keep investigating. Dan just fixed it. I was just about to the same point he got to. :) -Dave From dag at cray.com Fri Nov 13 16:46:21 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 16:46:21 -0600 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: <540286C6-9B63-4E87-9CA6-DC80BB510D22@apple.com> References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> <200911131549.52528.dag@cray.com> <540286C6-9B63-4E87-9CA6-DC80BB510D22@apple.com> Message-ID: <200911131646.21514.dag@cray.com> On Friday 13 November 2009 16:28, Dan Gohman wrote: > On Nov 13, 2009, at 1:49 PM, David Greene wrote: > > On Friday 13 November 2009 15:17, you wrote: > >>> Are these known to be broken right now? I get failure when using > >>> either. > >>> > >>> $ llc -march=arm -print-machineinstrs hw.bc > >> > >> Seems due to David's patches. > > > > Ok, it's faulting in SlotTracker with what looks like a bad Function. > > One of the Argument values is corrupted. > > > > I'm not abdicating responsibility, but at the moment I don't see the > > connection to my patches. Anton, are you seeing something specific > > as to the cause? > > > > I will keep investigating. > > The cause was isa was returning true for the new > FixedStackPseudoSourceValue values. I fixed it on trunk, and > added a comment to hopefully protect against others making > this mistake in the future. Is there any value is making isa<>, cast<> and friends a full dynamic_cast<> in paranoid build mode? It could help identify problems like this. -Dave From dag at cray.com Fri Nov 13 16:47:47 2009 From: dag at cray.com (David Greene) Date: Fri, 13 Nov 2009 16:47:47 -0600 Subject: [LLVMdev] -debug and -print-machineinstrs broken In-Reply-To: <200911131646.21514.dag@cray.com> References: <733E4269-9A06-4BBE-BE63-CDCA8BAEB191@apple.com> <540286C6-9B63-4E87-9CA6-DC80BB510D22@apple.com> <200911131646.21514.dag@cray.com> Message-ID: <200911131647.48127.dag@cray.com> On Friday 13 November 2009 16:46, David Greene wrote: > Is there any value is making isa<>, cast<> and friends a full > dynamic_cast<> in paranoid build mode? It could help identify problems > like this. Sorry, I used my own lingo there. By "paranoid" I mean --enable-expensive-checks. Another option would be to check cast<>, isa<>, etc. against dynamic_cast<> with --enable-expensive-checks. -Dave From criswell at uiuc.edu Fri Nov 13 16:57:31 2009 From: criswell at uiuc.edu (John Criswell) Date: Fri, 13 Nov 2009 16:57:31 -0600 Subject: [LLVMdev] SAFECode Source Code Released Message-ID: <4AFDE45B.4090807@uiuc.edu> Dear LLVMers, We are happy to announce an alpha release of the SAFECode compiler. It is now available for download from the LLVM public Subversion repository. SAFECode uses a set of analysis passes and program transformations to provide strong memory safety guarantees to C/C++ programs. Specifically, the safety guarantees are: o Array bounds checking (prevents pointers from overflowing from one memory object into another) o Loads and stores only access valid memory objects o Type safety for a subset of memory objects o Dangling pointer errors are harmless (i.e., all safety guarantees hold even when dangling pointers are dereferenced) o Sound operational semantics in the face of dangling pointer errors o Optional dangling pointer detection (induces more overhead) We have currently built a Valgrind-like debugging tool using SAFECode that prints debugging information when a memory safety error is detected at run-time. While the debugging tool doesn't use all of the fancy tricks we developed in our research, transformed programs still run 2.8x faster on average than Valgrind's memcheck tool (on Mac OS X) and 24x faster on average than Valgrind's ptrcheck tool (on Linux). Currently, the debugging tool does not utilize all of the results from the SAFECode research. Features such as Automatic Pool Allocation and Inter-procedural static array bounds checking are either buggy or disabled. We're working on improving the quality of the code, and we hope to release a "production-speed" version of SAFECode in the near future. More information on SAFECode can be found here: http://safecode.cs.illinois.edu/index.html SAFECode can be checked out from SVN using the following command: svn co http://llvm.org/svn/llvm-project/safecode/trunk safecode Once checked out from SVN, you can find the documentation in safecode/docs. See the README file in the distribution for more details on documentation. -- John T. From j.prasanth.j at gmail.com Fri Nov 13 23:46:58 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Sat, 14 Nov 2009 11:16:58 +0530 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue - now the __sync_val_compare_and_swap issue In-Reply-To: <4AFD68AD.9080200@zafena.se> References: <4AF80219.6090809@zafena.se> <4AFD68AD.9080200@zafena.se> Message-ID: Hi, As you said i downloaded arm toolchain from codesourcery(2009q3 with gcc 4.4.1 version).. if i use this toolchain i am getting the following error.. make[2]: Entering directory `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis' llvm[2]: Compiling LoopPass.cpp for Release build if arm-none-linux-gnueabi-g++ -I/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/include -I/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis -I/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/include -I/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2 -fomit-frame-pointer -fno-exceptions -fPIC -Woverloaded-virtual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp" -MT "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o" -MT "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d" /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp -o /home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o ; \ then /bin/mv -f "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp" "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d"; else /bin/rm "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp"; exit 1; fi /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp: In member function 'void llvm::LPPassManager::deleteLoopFromQueue(llvm::Loop*)': /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp:100: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. /bin/rm: cannot remove `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp': No such file or directory make[2]: *** [/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o] Error 1 make[2]: Leaving directory `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis' make[1]: *** [Analysis/.makeall] Error 2 make[1]: Leaving directory `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib' make: *** [all] Error 1 please let me know how should i resolve this error... Thanks and Regards, Prasanth J On Fri, Nov 13, 2009 at 7:39 PM, Xerxes R?nby wrote: > Prasanth J wrote: > > > > Hi all, > > with reference to the reply below, I downloaded toolchain from > > codesourcery (arm-2009q1-203-arm-none-linux-gnueabi) with gcc 4.3.3... > > when i compile llvm+clang with this toolchain i am getting the > > following error > > > > make[4]: Entering directory > > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools/c-index-test' > > llvm[4]: Linking Release executable c-index-test (without symbols) > > > /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: > > > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/Release/bin/c-index-test: > > hidden symbol `__sync_val_compare_and_swap_4' in > > > /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(linux-atomic.o) > > is referenced by DSO > > > /home/prasanth/arm-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: > > final link failed: Nonrepresentable section on output > > collect2: ld returned 1 exit status > > make[4]: *** > > > [/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/Release/bin/c-index-test] > > Error 1 > > make[4]: Leaving directory > > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools/c-index-test' > > make[3]: *** [all] Error 1 > > make[3]: Leaving directory > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang/tools' > > make[2]: *** [all] Error 1 > > make[2]: Leaving directory > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools/clang' > > make[1]: *** [clang/.makeall] Error 2 > > make[1]: Leaving directory > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm-obj/tools' > > make: *** [all] Error 1 > > > > can anyone please tell me why am i getting this error and how can i > > resolve this? > > > > Thanks and Regards, > > Prasanth J > > > > > You get this linking error because the code contains a gcc atomic > intrinsic calls using __sync_val_compare_and_swap . These are GCC > built-ins and have only been implemented on ARM using GCC 4.4. > http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Atomic-Builtins.html > If you want to use GCC 4.3.3 then you have to implement the > __sync_val_compare_and_swap_4 function yourself. > > Ubuntu Jaunty ARM toolchains have been patched to contains the atomic > intrinsics support in GCC 4.3.3 > > So to solve this issue do one of the following: > a) update your code sourcery cross compiler to arm-2009q3 that are using > GCC 4.4 > b) use the Ubuntu gcc 4.3.3 provided toolchain (i use this when > compiling llvm natively on a arm machine without cross compilation) > c) implement the __sync_val_compare_and_swap_4 function and patch llvm > to enable compilation using older toolchains. > > Cheers > Xerxes > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091114/b7113b6a/attachment-0001.html From j.prasanth.j at gmail.com Sat Nov 14 06:21:03 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Sat, 14 Nov 2009 17:51:03 +0530 Subject: [LLVMdev] Very slow performance of lli on x86 Message-ID: Hi all, I am trying to compare the performance of gcc , llvm-gcc , clang and lli(with JIT) on x86. i have attached the performance comparision spreadsheet as well as the source which i used for performing these test. i ran this code for 10000 iterations and the time of execution is as follows for -O3 results refer attachment. *clang (-O0) * real 0m10.247s user 0m2.644s sys 0m5.949s *llvm-gcc(-O0)* real 0m11.324s user 0m2.478s sys 0m6.000s * gcc(-O0)* real 0m10.963s user 0m2.365s sys 0m5.953s *llvm-jit * i used clang-cc -O0 -emit-llvm-bc to emit llvm bytecode and then passed it to opt tool and then linked all bytecode files to single bytecode using llvm-ld, i used lli tool to run this single bytecode file and noticed the following output real 6m33.786s user 5m12.612s sys 1m1.205s why is lli taking such a loooong time to execute this particular piece of code.?? Thanks and Regards, Prasanth J -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091114/4e5aca94/attachment-0001.html -------------- next part -------------- #include //#include //#include //#include #define ACC_SIZE 1024 /* * Definitions */ typedef union { struct { unsigned short b; unsigned short g; unsigned short r; unsigned short a; } RGB; struct { unsigned short u; unsigned short v; unsigned short y; unsigned short a; } YUV; } GenefxAccumulator; extern void Xacc_blend_invsrccolor( int , GenefxAccumulator* , GenefxAccumulator , GenefxAccumulator* ); extern void Dacc_premultiply( int , GenefxAccumulator* ); GenefxAccumulator D[ACC_SIZE] = { { 0x0, 0x1, 0x2, 0x4 }, { 0x1, 0x2, 0x3, 0x5 }, { 0x2, 0x3, 0x4, 0x6 }, { 0x3, 0x4, 0x5, 0x7 }, { 0x4, 0x5, 0x6, 0x8 }, { 0x5, 0x6, 0x7, 0x9 }, { 0x6, 0x7, 0x8, 0xa }, { 0x7, 0x8, 0x9, 0xb }, { 0x8, 0x9, 0xa, 0xc }, { 0x9, 0xa, 0xb, 0xd }, { 0xa, 0xb, 0xc, 0xe }, { 0xb, 0xc, 0xd, 0xf }, { 0xc, 0xd, 0xe, 0x10 }, { 0xd, 0xe, 0xf, 0x11 }, { 0xe, 0xf, 0x10, 0x12 }, { 0xf, 0x10, 0x11, 0x13 }, { 0x10, 0x11, 0x12, 0x14 }, { 0x11, 0x12, 0x13, 0x15 }, { 0x12, 0x13, 0x14, 0x16 }, { 0x13, 0x14, 0x15, 0x17 }, { 0x14, 0x15, 0x16, 0x18 }, { 0x15, 0x16, 0x17, 0x19 }, { 0x16, 0x17, 0x18, 0x1a }, { 0x17, 0x18, 0x19, 0x1b }, { 0x18, 0x19, 0x1a, 0x1c }, { 0x19, 0x1a, 0x1b, 0x1d }, { 0x1a, 0x1b, 0x1c, 0x1e }, { 0x1b, 0x1c, 0x1d, 0x1f }, { 0x1c, 0x1d, 0x1e, 0x20 }, { 0x1d, 0x1e, 0x1f, 0x21 }, { 0x1e, 0x1f, 0x20, 0x22 }, { 0x1f, 0x20, 0x21, 0x23 }, { 0x20, 0x21, 0x22, 0x24 }, { 0x21, 0x22, 0x23, 0x25 }, { 0x22, 0x23, 0x24, 0x26 }, { 0x23, 0x24, 0x25, 0x27 }, { 0x24, 0x25, 0x26, 0x28 }, { 0x25, 0x26, 0x27, 0x29 }, { 0x26, 0x27, 0x28, 0x2a }, { 0x27, 0x28, 0x29, 0x2b }, { 0x28, 0x29, 0x2a, 0x2c }, { 0x29, 0x2a, 0x2b, 0x2d }, { 0x2a, 0x2b, 0x2c, 0x2e }, { 0x2b, 0x2c, 0x2d, 0x2f }, { 0x2c, 0x2d, 0x2e, 0x30 }, { 0x2d, 0x2e, 0x2f, 0x31 }, { 0x2e, 0x2f, 0x30, 0x32 }, { 0x2f, 0x30, 0x31, 0x33 }, { 0x30, 0x31, 0x32, 0x34 }, { 0x31, 0x32, 0x33, 0x35 }, { 0x32, 0x33, 0x34, 0x36 }, { 0x33, 0x34, 0x35, 0x37 }, { 0x34, 0x35, 0x36, 0x38 }, { 0x35, 0x36, 0x37, 0x39 }, { 0x36, 0x37, 0x38, 0x3a }, { 0x37, 0x38, 0x39, 0x3b }, { 0x38, 0x39, 0x3a, 0x3c }, { 0x39, 0x3a, 0x3b, 0x3d }, { 0x3a, 0x3b, 0x3c, 0x3e }, { 0x3b, 0x3c, 0x3d, 0x3f }, { 0x3c, 0x3d, 0x3e, 0x40 }, { 0x3d, 0x3e, 0x3f, 0x41 }, { 0x3e, 0x3f, 0x40, 0x42 }, { 0x3f, 0x40, 0x41, 0x43 }, { 0x40, 0x41, 0x42, 0x44 }, { 0x41, 0x42, 0x43, 0x45 }, { 0x42, 0x43, 0x44, 0x46 }, { 0x43, 0x44, 0x45, 0x47 }, { 0x44, 0x45, 0x46, 0x48 }, { 0x45, 0x46, 0x47, 0x49 }, { 0x46, 0x47, 0x48, 0x4a }, { 0x47, 0x48, 0x49, 0x4b }, { 0x48, 0x49, 0x4a, 0x4c }, { 0x49, 0x4a, 0x4b, 0x4d }, { 0x4a, 0x4b, 0x4c, 0x4e }, { 0x4b, 0x4c, 0x4d, 0x4f }, { 0x4c, 0x4d, 0x4e, 0x50 }, { 0x4d, 0x4e, 0x4f, 0x51 }, { 0x4e, 0x4f, 0x50, 0x52 }, { 0x4f, 0x50, 0x51, 0x53 }, { 0x50, 0x51, 0x52, 0x54 }, { 0x51, 0x52, 0x53, 0x55 }, { 0x52, 0x53, 0x54, 0x56 }, { 0x53, 0x54, 0x55, 0x57 }, { 0x54, 0x55, 0x56, 0x58 }, { 0x55, 0x56, 0x57, 0x59 }, { 0x56, 0x57, 0x58, 0x5a }, { 0x57, 0x58, 0x59, 0x5b }, { 0x58, 0x59, 0x5a, 0x5c }, { 0x59, 0x5a, 0x5b, 0x5d }, { 0x5a, 0x5b, 0x5c, 0x5e }, { 0x5b, 0x5c, 0x5d, 0x5f }, { 0x5c, 0x5d, 0x5e, 0x60 }, { 0x5d, 0x5e, 0x5f, 0x61 }, { 0x5e, 0x5f, 0x60, 0x62 }, { 0x5f, 0x60, 0x61, 0x63 }, { 0x60, 0x61, 0x62, 0x64 }, { 0x61, 0x62, 0x63, 0x65 }, { 0x62, 0x63, 0x64, 0x66 }, { 0x63, 0x64, 0x65, 0x67 }, { 0x64, 0x65, 0x66, 0x68 }, { 0x65, 0x66, 0x67, 0x69 }, { 0x66, 0x67, 0x68, 0x6a }, { 0x67, 0x68, 0x69, 0x6b }, { 0x68, 0x69, 0x6a, 0x6c }, { 0x69, 0x6a, 0x6b, 0x6d }, { 0x6a, 0x6b, 0x6c, 0x6e }, { 0x6b, 0x6c, 0x6d, 0x6f }, { 0x6c, 0x6d, 0x6e, 0x70 }, { 0x6d, 0x6e, 0x6f, 0x71 }, { 0x6e, 0x6f, 0x70, 0x72 }, { 0x6f, 0x70, 0x71, 0x73 }, { 0x70, 0x71, 0x72, 0x74 }, { 0x71, 0x72, 0x73, 0x75 }, { 0x72, 0x73, 0x74, 0x76 }, { 0x73, 0x74, 0x75, 0x77 }, { 0x74, 0x75, 0x76, 0x78 }, { 0x75, 0x76, 0x77, 0x79 }, { 0x76, 0x77, 0x78, 0x7a }, { 0x77, 0x78, 0x79, 0x7b }, { 0x78, 0x79, 0x7a, 0x7c }, { 0x79, 0x7a, 0x7b, 0x7d }, { 0x7a, 0x7b, 0x7c, 0x7e }, { 0x7b, 0x7c, 0x7d, 0x7f }, { 0x7c, 0x7d, 0x7e, 0x80 }, { 0x7d, 0x7e, 0x7f, 0x81 }, { 0x7e, 0x7f, 0x80, 0x82 }, { 0x7f, 0x80, 0x81, 0x83 }, { 0x80, 0x81, 0x82, 0x84 }, { 0x81, 0x82, 0x83, 0x85 }, { 0x82, 0x83, 0x84, 0x86 }, { 0x83, 0x84, 0x85, 0x87 }, { 0x84, 0x85, 0x86, 0x88 }, { 0x85, 0x86, 0x87, 0x89 }, { 0x86, 0x87, 0x88, 0x8a }, { 0x87, 0x88, 0x89, 0x8b }, { 0x88, 0x89, 0x8a, 0x8c }, { 0x89, 0x8a, 0x8b, 0x8d }, { 0x8a, 0x8b, 0x8c, 0x8e }, { 0x8b, 0x8c, 0x8d, 0x8f }, { 0x8c, 0x8d, 0x8e, 0x90 }, { 0x8d, 0x8e, 0x8f, 0x91 }, { 0x8e, 0x8f, 0x90, 0x92 }, { 0x8f, 0x90, 0x91, 0x93 }, { 0x90, 0x91, 0x92, 0x94 }, { 0x91, 0x92, 0x93, 0x95 }, { 0x92, 0x93, 0x94, 0x96 }, { 0x93, 0x94, 0x95, 0x97 }, { 0x94, 0x95, 0x96, 0x98 }, { 0x95, 0x96, 0x97, 0x99 }, { 0x96, 0x97, 0x98, 0x9a }, { 0x97, 0x98, 0x99, 0x9b }, { 0x98, 0x99, 0x9a, 0x9c }, { 0x99, 0x9a, 0x9b, 0x9d }, { 0x9a, 0x9b, 0x9c, 0x9e }, { 0x9b, 0x9c, 0x9d, 0x9f }, { 0x9c, 0x9d, 0x9e, 0xa0 }, { 0x9d, 0x9e, 0x9f, 0xa1 }, { 0x9e, 0x9f, 0xa0, 0xa2 }, { 0x9f, 0xa0, 0xa1, 0xa3 }, { 0xa0, 0xa1, 0xa2, 0xa4 }, { 0xa1, 0xa2, 0xa3, 0xa5 }, { 0xa2, 0xa3, 0xa4, 0xa6 }, { 0xa3, 0xa4, 0xa5, 0xa7 }, { 0xa4, 0xa5, 0xa6, 0xa8 }, { 0xa5, 0xa6, 0xa7, 0xa9 }, { 0xa6, 0xa7, 0xa8, 0xaa }, { 0xa7, 0xa8, 0xa9, 0xab }, { 0xa8, 0xa9, 0xaa, 0xac }, { 0xa9, 0xaa, 0xab, 0xad }, { 0xaa, 0xab, 0xac, 0xae }, { 0xab, 0xac, 0xad, 0xaf }, { 0xac, 0xad, 0xae, 0xb0 }, { 0xad, 0xae, 0xaf, 0xb1 }, { 0xae, 0xaf, 0xb0, 0xb2 }, { 0xaf, 0xb0, 0xb1, 0xb3 }, { 0xb0, 0xb1, 0xb2, 0xb4 }, { 0xb1, 0xb2, 0xb3, 0xb5 }, { 0xb2, 0xb3, 0xb4, 0xb6 }, { 0xb3, 0xb4, 0xb5, 0xb7 }, { 0xb4, 0xb5, 0xb6, 0xb8 }, { 0xb5, 0xb6, 0xb7, 0xb9 }, { 0xb6, 0xb7, 0xb8, 0xba }, { 0xb7, 0xb8, 0xb9, 0xbb }, { 0xb8, 0xb9, 0xba, 0xbc }, { 0xb9, 0xba, 0xbb, 0xbd }, { 0xba, 0xbb, 0xbc, 0xbe }, { 0xbb, 0xbc, 0xbd, 0xbf }, { 0xbc, 0xbd, 0xbe, 0xc0 }, { 0xbd, 0xbe, 0xbf, 0xc1 }, { 0xbe, 0xbf, 0xc0, 0xc2 }, { 0xbf, 0xc0, 0xc1, 0xc3 }, { 0xc0, 0xc1, 0xc2, 0xc4 }, { 0xc1, 0xc2, 0xc3, 0xc5 }, { 0xc2, 0xc3, 0xc4, 0xc6 }, { 0xc3, 0xc4, 0xc5, 0xc7 }, { 0xc4, 0xc5, 0xc6, 0xc8 }, { 0xc5, 0xc6, 0xc7, 0xc9 }, { 0xc6, 0xc7, 0xc8, 0xca }, { 0xc7, 0xc8, 0xc9, 0xcb }, { 0xc8, 0xc9, 0xca, 0xcc }, { 0xc9, 0xca, 0xcb, 0xcd }, { 0xca, 0xcb, 0xcc, 0xce }, { 0xcb, 0xcc, 0xcd, 0xcf }, { 0xcc, 0xcd, 0xce, 0xd0 }, { 0xcd, 0xce, 0xcf, 0xd1 }, { 0xce, 0xcf, 0xd0, 0xd2 }, { 0xcf, 0xd0, 0xd1, 0xd3 }, { 0xd0, 0xd1, 0xd2, 0xd4 }, { 0xd1, 0xd2, 0xd3, 0xd5 }, { 0xd2, 0xd3, 0xd4, 0xd6 }, { 0xd3, 0xd4, 0xd5, 0xd7 }, { 0xd4, 0xd5, 0xd6, 0xd8 }, { 0xd5, 0xd6, 0xd7, 0xd9 }, { 0xd6, 0xd7, 0xd8, 0xda }, { 0xd7, 0xd8, 0xd9, 0xdb }, { 0xd8, 0xd9, 0xda, 0xdc }, { 0xd9, 0xda, 0xdb, 0xdd }, { 0xda, 0xdb, 0xdc, 0xde }, { 0xdb, 0xdc, 0xdd, 0xdf }, { 0xdc, 0xdd, 0xde, 0xe0 }, { 0xdd, 0xde, 0xdf, 0xe1 }, { 0xde, 0xdf, 0xe0, 0xe2 }, { 0xdf, 0xe0, 0xe1, 0xe3 }, { 0xe0, 0xe1, 0xe2, 0xe4 }, { 0xe1, 0xe2, 0xe3, 0xe5 }, { 0xe2, 0xe3, 0xe4, 0xe6 }, { 0xe3, 0xe4, 0xe5, 0xe7 }, { 0xe4, 0xe5, 0xe6, 0xe8 }, { 0xe5, 0xe6, 0xe7, 0xe9 }, { 0xe6, 0xe7, 0xe8, 0xea }, { 0xe7, 0xe8, 0xe9, 0xeb }, { 0xe8, 0xe9, 0xea, 0xec }, { 0xe9, 0xea, 0xeb, 0xed }, { 0xea, 0xeb, 0xec, 0xee }, { 0xeb, 0xec, 0xed, 0xef }, { 0xec, 0xed, 0xee, 0xf0 }, { 0xed, 0xee, 0xef, 0xf1 }, { 0xee, 0xef, 0xf0, 0xf2 }, { 0xef, 0xf0, 0xf1, 0xf3 }, { 0xf0, 0xf1, 0xf2, 0xf4 }, { 0xf1, 0xf2, 0xf3, 0xf5 }, { 0xf2, 0xf3, 0xf4, 0xf6 }, { 0xf3, 0xf4, 0xf5, 0xf7 }, { 0xf4, 0xf5, 0xf6, 0xf8 }, { 0xf5, 0xf6, 0xf7, 0xf9 }, { 0xf6, 0xf7, 0xf8, 0xfa }, { 0xf7, 0xf8, 0xf9, 0xfb }, { 0xf8, 0xf9, 0xfa, 0xfc }, { 0xf9, 0xfa, 0xfb, 0xfd }, { 0xfa, 0xfb, 0xfc, 0xfe }, { 0xfb, 0xfc, 0xfd, 0xff }, { 0xfc, 0xfd, 0xfe, 0x00 }, { 0xfd, 0xfe, 0xff, 0x01 }, { 0xfe, 0xff, 0x00, 0x02 }, { 0xff, 0x00, 0x01, 0x03 }, { 0x10, 0x11, 0x02, 0x10 }, { 0x10, 0x12, 0x03, 0x10 }, { 0x10, 0x13, 0x04, 0x10 }, { 0x10, 0x14, 0x05, 0x10 }, { 0x10, 0x15, 0x06, 0x10 }, { 0x10, 0x16, 0x07, 0x10 }, { 0x10, 0x17, 0x08, 0x10 }, { 0x10, 0x18, 0x09, 0x10 }, { 0x10, 0x19, 0x0a, 0x10 }, { 0x10, 0x1a, 0x0b, 0x10 }, { 0x10, 0x1b, 0x0c, 0x10 }, { 0x10, 0x1c, 0x0d, 0x10 }, { 0x10, 0x1d, 0x0e, 0x11 }, { 0x10, 0x1e, 0x0f, 0x11 }, { 0x10, 0x1f, 0x10, 0x11 }, { 0x10, 0x10, 0x11, 0x11 }, { 0x11, 0x11, 0x12, 0x11 }, { 0x11, 0x12, 0x13, 0x11 }, { 0x11, 0x13, 0x14, 0x11 }, { 0x11, 0x14, 0x15, 0x11 }, { 0x11, 0x15, 0x16, 0x11 }, { 0x11, 0x16, 0x17, 0x11 }, { 0x11, 0x17, 0x18, 0x11 }, { 0x11, 0x18, 0x19, 0x11 }, { 0x11, 0x19, 0x1a, 0x11 }, { 0x11, 0x1a, 0x1b, 0x11 }, { 0x11, 0x1b, 0x1c, 0x11 }, { 0x11, 0x1c, 0x1d, 0x11 }, { 0x11, 0x1d, 0x1e, 0x12 }, { 0x11, 0x1e, 0x1f, 0x12 }, { 0x11, 0x1f, 0x20, 0x12 }, { 0x11, 0x10, 0x21, 0x12 }, { 0x12, 0x11, 0x22, 0x12 }, { 0x12, 0x12, 0x23, 0x12 }, { 0x12, 0x13, 0x24, 0x12 }, { 0x12, 0x14, 0x25, 0x12 }, { 0x12, 0x15, 0x26, 0x12 }, { 0x12, 0x16, 0x27, 0x12 }, { 0x12, 0x17, 0x28, 0x12 }, { 0x12, 0x18, 0x29, 0x12 }, { 0x12, 0x19, 0x2a, 0x12 }, { 0x12, 0x1a, 0x2b, 0x12 }, { 0x12, 0x1b, 0x2c, 0x12 }, { 0x12, 0x1c, 0x2d, 0x12 }, { 0x12, 0x1d, 0x2e, 0x13 }, { 0x12, 0x1e, 0x2f, 0x13 }, { 0x12, 0x1f, 0x30, 0x13 }, { 0x12, 0x10, 0x31, 0x13 }, { 0x13, 0x11, 0x32, 0x13 }, { 0x13, 0x12, 0x33, 0x13 }, { 0x13, 0x13, 0x34, 0x13 }, { 0x13, 0x14, 0x35, 0x13 }, { 0x13, 0x15, 0x36, 0x13 }, { 0x13, 0x16, 0x37, 0x13 }, { 0x13, 0x17, 0x38, 0x13 }, { 0x13, 0x18, 0x39, 0x13 }, { 0x13, 0x19, 0x3a, 0x13 }, { 0x13, 0x1a, 0x3b, 0x13 }, { 0x13, 0x1b, 0x3c, 0x13 }, { 0x13, 0x1c, 0x3d, 0x13 }, { 0x13, 0x1d, 0x3e, 0x14 }, { 0x13, 0x1e, 0x3f, 0x14 }, { 0x13, 0x1f, 0x40, 0x14 }, { 0x13, 0x10, 0x41, 0x14 }, { 0x14, 0x11, 0x42, 0x14 }, { 0x14, 0x12, 0x43, 0x14 }, { 0x14, 0x13, 0x44, 0x14 }, { 0x14, 0x14, 0x45, 0x14 }, { 0x14, 0x15, 0x46, 0x14 }, { 0x14, 0x16, 0x47, 0x14 }, { 0x14, 0x17, 0x48, 0x14 }, { 0x14, 0x18, 0x49, 0x14 }, { 0x14, 0x19, 0x4a, 0x14 }, { 0x14, 0x1a, 0x4b, 0x14 }, { 0x14, 0x1b, 0x4c, 0x14 }, { 0x14, 0x1c, 0x4d, 0x14 }, { 0x14, 0x1d, 0x4e, 0x15 }, { 0x14, 0x1e, 0x4f, 0x15 }, { 0x14, 0x1f, 0x50, 0x15 }, { 0x14, 0x10, 0x51, 0x15 }, { 0x15, 0x11, 0x52, 0x15 }, { 0x15, 0x12, 0x53, 0x15 }, { 0x15, 0x13, 0x54, 0x15 }, { 0x15, 0x14, 0x55, 0x15 }, { 0x15, 0x15, 0x56, 0x15 }, { 0x15, 0x16, 0x57, 0x15 }, { 0x15, 0x17, 0x58, 0x15 }, { 0x15, 0x18, 0x59, 0x15 }, { 0x15, 0x19, 0x5a, 0x15 }, { 0x15, 0x1a, 0x5b, 0x15 }, { 0x15, 0x1b, 0x5c, 0x15 }, { 0x15, 0x1c, 0x5d, 0x15 }, { 0x15, 0x1d, 0x5e, 0x16 }, { 0x15, 0x1e, 0x5f, 0x16 }, { 0x15, 0x1f, 0x60, 0x16 }, { 0x15, 0x10, 0x61, 0x16 }, { 0x16, 0x11, 0x62, 0x16 }, { 0x16, 0x12, 0x63, 0x16 }, { 0x16, 0x13, 0x64, 0x16 }, { 0x16, 0x14, 0x65, 0x16 }, { 0x16, 0x15, 0x66, 0x16 }, { 0x16, 0x16, 0x67, 0x16 }, { 0x16, 0x17, 0x68, 0x16 }, { 0x16, 0x18, 0x69, 0x16 }, { 0x16, 0x19, 0x6a, 0x16 }, { 0x16, 0x1a, 0x6b, 0x16 }, { 0x16, 0x1b, 0x6c, 0x16 }, { 0x16, 0x1c, 0x6d, 0x16 }, { 0x16, 0x1d, 0x6e, 0x17 }, { 0x16, 0x1e, 0x6f, 0x17 }, { 0x16, 0x1f, 0x70, 0x17 }, { 0x16, 0x10, 0x71, 0x17 }, { 0x17, 0x11, 0x72, 0x17 }, { 0x17, 0x12, 0x73, 0x17 }, { 0x17, 0x13, 0x74, 0x17 }, { 0x17, 0x14, 0x75, 0x17 }, { 0x17, 0x15, 0x76, 0x17 }, { 0x17, 0x16, 0x77, 0x17 }, { 0x17, 0x17, 0x78, 0x17 }, { 0x17, 0x18, 0x79, 0x17 }, { 0x17, 0x19, 0x7a, 0x17 }, { 0x17, 0x1a, 0x7b, 0x17 }, { 0x17, 0x1b, 0x7c, 0x17 }, { 0x17, 0x1c, 0x7d, 0x17 }, { 0x17, 0x1d, 0x7e, 0x18 }, { 0x17, 0x1e, 0x7f, 0x18 }, { 0x17, 0x1f, 0x80, 0x18 }, { 0x17, 0x10, 0x81, 0x18 }, { 0x18, 0x11, 0x82, 0x18 }, { 0x18, 0x12, 0x83, 0x18 }, { 0x18, 0x13, 0x84, 0x18 }, { 0x18, 0x14, 0x85, 0x18 }, { 0x18, 0x15, 0x86, 0x18 }, { 0x18, 0x16, 0x87, 0x18 }, { 0x18, 0x17, 0x88, 0x18 }, { 0x18, 0x18, 0x89, 0x18 }, { 0x18, 0x19, 0x8a, 0x18 }, { 0x18, 0x1a, 0x8b, 0x18 }, { 0x18, 0x1b, 0x8c, 0x18 }, { 0x18, 0x1c, 0x8d, 0x18 }, { 0x18, 0x1d, 0x8e, 0x19 }, { 0x18, 0x1e, 0x8f, 0x19 }, { 0x18, 0x1f, 0x90, 0x19 }, { 0x18, 0x10, 0x91, 0x19 }, { 0x19, 0x11, 0x92, 0x19 }, { 0x19, 0x12, 0x93, 0x19 }, { 0x19, 0x13, 0x94, 0x19 }, { 0x19, 0x14, 0x95, 0x19 }, { 0x19, 0x15, 0x96, 0x19 }, { 0x19, 0x16, 0x97, 0x19 }, { 0x19, 0x17, 0x98, 0x19 }, { 0x19, 0x18, 0x99, 0x19 }, { 0x19, 0x19, 0x9a, 0x19 }, { 0x19, 0x1a, 0x9b, 0x19 }, { 0x19, 0x1b, 0x9c, 0x19 }, { 0x19, 0x1c, 0x9d, 0x19 }, { 0x19, 0x1d, 0x9e, 0x1a }, { 0x19, 0x1e, 0x9f, 0x1a }, { 0x19, 0x1f, 0xa0, 0x1a }, { 0x19, 0x10, 0xa1, 0x1a }, { 0x1a, 0x11, 0xa2, 0x1a }, { 0x1a, 0x12, 0xa3, 0x1a }, { 0x1a, 0x13, 0xa4, 0x1a }, { 0x1a, 0x14, 0xa5, 0x1a }, { 0x1a, 0x15, 0xa6, 0x1a }, { 0x1a, 0x16, 0xa7, 0x1a }, { 0x1a, 0x17, 0xa8, 0x1a }, { 0x1a, 0x18, 0xa9, 0x1a }, { 0x1a, 0x19, 0xaa, 0x1a }, { 0x1a, 0x1a, 0xab, 0x1a }, { 0x1a, 0x1b, 0xac, 0x1a }, { 0x1a, 0x1c, 0xad, 0x1a }, { 0x1a, 0x1d, 0xae, 0x1b }, { 0x1a, 0x1e, 0xaf, 0x1b }, { 0x1a, 0x1f, 0xb0, 0x1b }, { 0x1a, 0x10, 0xb1, 0x1b }, { 0x1b, 0x11, 0xb2, 0x1b }, { 0x1b, 0x12, 0xb3, 0x1b }, { 0x1b, 0x13, 0xb4, 0x1b }, { 0x1b, 0x14, 0xb5, 0x1b }, { 0x1b, 0x15, 0xb6, 0x1b }, { 0x1b, 0x16, 0xb7, 0x1b }, { 0x1b, 0x17, 0xb8, 0x1b }, { 0x1b, 0x18, 0xb9, 0x1b }, { 0x1b, 0x19, 0xba, 0x1b }, { 0x1b, 0x1a, 0xbb, 0x1b }, { 0x1b, 0x1b, 0xbc, 0x1b }, { 0x1b, 0x1c, 0xbd, 0x1b }, { 0x1b, 0x1d, 0xbe, 0x1c }, { 0x1b, 0x1e, 0xbf, 0x1c }, { 0x1b, 0x1f, 0xc0, 0x1c }, { 0x1b, 0x10, 0xc1, 0x1c }, { 0x1c, 0x11, 0xc2, 0x1c }, { 0x1c, 0x12, 0xc3, 0x1c }, { 0x1c, 0x13, 0xc4, 0x1c }, { 0x1c, 0x14, 0xc5, 0x1c }, { 0x1c, 0x15, 0xc6, 0x1c }, { 0x1c, 0x16, 0xc7, 0x1c }, { 0x1c, 0x17, 0xc8, 0x1c }, { 0x1c, 0x18, 0xc9, 0x1c }, { 0x1c, 0x19, 0xca, 0x1c }, { 0x1c, 0x1a, 0xcb, 0x1c }, { 0x1c, 0x1b, 0xcc, 0x1c }, { 0x1c, 0x1c, 0xcd, 0x1c }, { 0x1c, 0x1d, 0xce, 0x1d }, { 0x1c, 0x1e, 0xcf, 0x1d }, { 0x1c, 0x1f, 0xd0, 0x1d }, { 0x1c, 0x10, 0xd1, 0x1d }, { 0x1d, 0x11, 0xd2, 0x1d }, { 0x1d, 0x12, 0xd3, 0x1d }, { 0x1d, 0x13, 0xd4, 0x1d }, { 0x1d, 0x14, 0xd5, 0x1d }, { 0x1d, 0x15, 0xd6, 0x1d }, { 0x1d, 0x16, 0xd7, 0x1d }, { 0x1d, 0x17, 0xd8, 0x1d }, { 0x1d, 0x18, 0xd9, 0x1d }, { 0x1d, 0x19, 0xda, 0x1d }, { 0x1d, 0x1a, 0xdb, 0x1d }, { 0x1d, 0x1b, 0xdc, 0x1d }, { 0x1d, 0x1c, 0xdd, 0x1d }, { 0x1d, 0x1d, 0xde, 0x1e }, { 0x1d, 0x1e, 0xdf, 0x1e }, { 0x1d, 0x1f, 0xe0, 0x1e }, { 0x1d, 0x10, 0xe1, 0x1e }, { 0x1e, 0x11, 0xe2, 0x1e }, { 0x1e, 0x12, 0xe3, 0x1e }, { 0x1e, 0x13, 0xe4, 0x1e }, { 0x1e, 0x14, 0xe5, 0x1e }, { 0x1e, 0x15, 0xe6, 0x1e }, { 0x1e, 0x16, 0xe7, 0x1e }, { 0x1e, 0x17, 0xe8, 0x1e }, { 0x1e, 0x18, 0xe9, 0x1e }, { 0x1e, 0x19, 0xea, 0x1e }, { 0x1e, 0x1a, 0xeb, 0x1e }, { 0x1e, 0x1b, 0xec, 0x1e }, { 0x1e, 0x1c, 0xed, 0x1e }, { 0x1e, 0x1d, 0xee, 0x1f }, { 0x1e, 0x1e, 0xef, 0x1f }, { 0x1e, 0x1f, 0xf0, 0x1f }, { 0x1e, 0x10, 0xf1, 0x1f }, { 0x1f, 0x11, 0xf2, 0x1f }, { 0x1f, 0x12, 0xf3, 0x1f }, { 0x1f, 0x13, 0xf4, 0x1f }, { 0x1f, 0x14, 0xf5, 0x1f }, { 0x1f, 0x15, 0xf6, 0x1f }, { 0x1f, 0x16, 0xf7, 0x1f }, { 0x1f, 0x17, 0xf8, 0x1f }, { 0x1f, 0x18, 0xf9, 0x1f }, { 0x1f, 0x19, 0xfa, 0x1f }, { 0x1f, 0x1a, 0xfb, 0x1f }, { 0x1f, 0x1b, 0xfc, 0x1f }, { 0x1f, 0x1c, 0xfd, 0x1f }, { 0x1f, 0x1d, 0xfe, 0x20 }, { 0x1f, 0x1e, 0xff, 0x20 }, { 0x1f, 0x1f, 0x00, 0x20 }, { 0x1f, 0x20, 0x01, 0x20 }, { 0x20, 0x21, 0x02, 0x20 }, { 0x20, 0x22, 0x03, 0x20 }, { 0x20, 0x23, 0x04, 0x20 }, { 0x20, 0x24, 0x05, 0x20 }, { 0x20, 0x25, 0x06, 0x20 }, { 0x20, 0x26, 0x07, 0x20 }, { 0x20, 0x27, 0x08, 0x20 }, { 0x20, 0x28, 0x09, 0x20 }, { 0x20, 0x29, 0x0a, 0x20 }, { 0x20, 0x2a, 0x0b, 0x20 }, { 0x20, 0x2b, 0x0c, 0x20 }, { 0x20, 0x2c, 0x0d, 0x20 }, { 0x20, 0x2d, 0x0e, 0x21 }, { 0x20, 0x2e, 0x0f, 0x21 }, { 0x20, 0x2f, 0x10, 0x21 }, { 0x20, 0x20, 0x11, 0x21 }, { 0x21, 0x21, 0x12, 0x21 }, { 0x21, 0x22, 0x13, 0x21 }, { 0x21, 0x23, 0x14, 0x21 }, { 0x21, 0x24, 0x15, 0x21 }, { 0x21, 0x25, 0x16, 0x21 }, { 0x21, 0x26, 0x17, 0x21 }, { 0x21, 0x27, 0x18, 0x21 }, { 0x21, 0x28, 0x19, 0x21 }, { 0x21, 0x29, 0x1a, 0x21 }, { 0x21, 0x2a, 0x1b, 0x21 }, { 0x21, 0x2b, 0x1c, 0x21 }, { 0x21, 0x2c, 0x1d, 0x21 }, { 0x21, 0x2d, 0x1e, 0x22 }, { 0x21, 0x2e, 0x1f, 0x22 }, { 0x21, 0x2f, 0x20, 0x22 }, { 0x21, 0x20, 0x21, 0x22 }, { 0x22, 0x21, 0x22, 0x22 }, { 0x22, 0x22, 0x23, 0x22 }, { 0x22, 0x23, 0x24, 0x22 }, { 0x22, 0x24, 0x25, 0x22 }, { 0x22, 0x25, 0x26, 0x22 }, { 0x22, 0x26, 0x27, 0x22 }, { 0x22, 0x27, 0x28, 0x22 }, { 0x22, 0x28, 0x29, 0x22 }, { 0x22, 0x29, 0x2a, 0x22 }, { 0x22, 0x2a, 0x2b, 0x22 }, { 0x22, 0x2b, 0x2c, 0x22 }, { 0x22, 0x2c, 0x2d, 0x22 }, { 0x22, 0x2d, 0x2e, 0x23 }, { 0x22, 0x2e, 0x2f, 0x23 }, { 0x22, 0x2f, 0x30, 0x23 }, { 0x22, 0x20, 0x31, 0x23 }, { 0x23, 0x21, 0x32, 0x23 }, { 0x23, 0x22, 0x33, 0x23 }, { 0x23, 0x23, 0x34, 0x23 }, { 0x23, 0x24, 0x35, 0x23 }, { 0x23, 0x25, 0x36, 0x23 }, { 0x23, 0x26, 0x37, 0x23 }, { 0x23, 0x27, 0x38, 0x23 }, { 0x23, 0x28, 0x39, 0x23 }, { 0x23, 0x29, 0x3a, 0x23 }, { 0x23, 0x2a, 0x3b, 0x23 }, { 0x23, 0x2b, 0x3c, 0x23 }, { 0x23, 0x2c, 0x3d, 0x23 }, { 0x23, 0x2d, 0x3e, 0x24 }, { 0x23, 0x2e, 0x3f, 0x24 }, { 0x23, 0x2f, 0x40, 0x24 }, { 0x23, 0x20, 0x41, 0x24 }, { 0x24, 0x21, 0x42, 0x24 }, { 0x24, 0x22, 0x43, 0x24 }, { 0x24, 0x23, 0x44, 0x24 }, { 0x24, 0x24, 0x45, 0x24 }, { 0x24, 0x25, 0x46, 0x24 }, { 0x24, 0x26, 0x47, 0x24 }, { 0x24, 0x27, 0x48, 0x24 }, { 0x24, 0x28, 0x49, 0x24 }, { 0x24, 0x29, 0x4a, 0x24 }, { 0x24, 0x2a, 0x4b, 0x24 }, { 0x24, 0x2b, 0x4c, 0x24 }, { 0x24, 0x2c, 0x4d, 0x24 }, { 0x24, 0x2d, 0x4e, 0x25 }, { 0x24, 0x2e, 0x4f, 0x25 }, { 0x24, 0x2f, 0x50, 0x25 }, { 0x24, 0x20, 0x51, 0x25 }, { 0x25, 0x21, 0x52, 0x25 }, { 0x25, 0x22, 0x53, 0x25 }, { 0x25, 0x23, 0x54, 0x25 }, { 0x25, 0x24, 0x55, 0x25 }, { 0x25, 0x25, 0x56, 0x25 }, { 0x25, 0x26, 0x57, 0x25 }, { 0x25, 0x27, 0x58, 0x25 }, { 0x25, 0x28, 0x59, 0x25 }, { 0x25, 0x29, 0x5a, 0x25 }, { 0x25, 0x2a, 0x5b, 0x25 }, { 0x25, 0x2b, 0x5c, 0x25 }, { 0x25, 0x2c, 0x5d, 0x25 }, { 0x25, 0x2d, 0x5e, 0x26 }, { 0x25, 0x2e, 0x5f, 0x26 }, { 0x25, 0x2f, 0x60, 0x26 }, { 0x25, 0x20, 0x61, 0x26 }, { 0x26, 0x21, 0x62, 0x26 }, { 0x26, 0x22, 0x63, 0x26 }, { 0x26, 0x23, 0x64, 0x26 }, { 0x26, 0x24, 0x65, 0x26 }, { 0x26, 0x25, 0x66, 0x26 }, { 0x26, 0x26, 0x67, 0x26 }, { 0x26, 0x27, 0x68, 0x26 }, { 0x26, 0x28, 0x69, 0x26 }, { 0x26, 0x29, 0x6a, 0x26 }, { 0x26, 0x2a, 0x6b, 0x26 }, { 0x26, 0x2b, 0x6c, 0x26 }, { 0x26, 0x2c, 0x6d, 0x26 }, { 0x26, 0x2d, 0x6e, 0x27 }, { 0x26, 0x2e, 0x6f, 0x27 }, { 0x26, 0x2f, 0x70, 0x27 }, { 0x26, 0x20, 0x71, 0x27 }, { 0x27, 0x21, 0x72, 0x27 }, { 0x27, 0x22, 0x73, 0x27 }, { 0x27, 0x23, 0x74, 0x27 }, { 0x27, 0x24, 0x75, 0x27 }, { 0x27, 0x25, 0x76, 0x27 }, { 0x27, 0x26, 0x77, 0x27 }, { 0x27, 0x27, 0x78, 0x27 }, { 0x27, 0x28, 0x79, 0x27 }, { 0x27, 0x29, 0x7a, 0x27 }, { 0x27, 0x2a, 0x7b, 0x27 }, { 0x27, 0x2b, 0x7c, 0x27 }, { 0x27, 0x2c, 0x7d, 0x27 }, { 0x27, 0x2d, 0x7e, 0x28 }, { 0x27, 0x2e, 0x7f, 0x28 }, { 0x27, 0x2f, 0x80, 0x28 }, { 0x27, 0x20, 0x81, 0x28 }, { 0x28, 0x21, 0x82, 0x28 }, { 0x28, 0x22, 0x83, 0x28 }, { 0x28, 0x23, 0x84, 0x28 }, { 0x28, 0x24, 0x85, 0x28 }, { 0x28, 0x25, 0x86, 0x28 }, { 0x28, 0x26, 0x87, 0x28 }, { 0x28, 0x27, 0x88, 0x28 }, { 0x28, 0x28, 0x89, 0x28 }, { 0x28, 0x29, 0x8a, 0x28 }, { 0x28, 0x2a, 0x8b, 0x28 }, { 0x28, 0x2b, 0x8c, 0x28 }, { 0x28, 0x2c, 0x8d, 0x28 }, { 0x28, 0x2d, 0x8e, 0x29 }, { 0x28, 0x2e, 0x8f, 0x29 }, { 0x28, 0x2f, 0x90, 0x29 }, { 0x28, 0x20, 0x91, 0x29 }, { 0x29, 0x21, 0x92, 0x29 }, { 0x29, 0x22, 0x93, 0x29 }, { 0x29, 0x23, 0x94, 0x29 }, { 0x29, 0x24, 0x95, 0x29 }, { 0x29, 0x25, 0x96, 0x29 }, { 0x29, 0x26, 0x97, 0x29 }, { 0x29, 0x27, 0x98, 0x29 }, { 0x29, 0x28, 0x99, 0x29 }, { 0x29, 0x29, 0x9a, 0x29 }, { 0x29, 0x2a, 0x9b, 0x29 }, { 0x29, 0x2b, 0x9c, 0x29 }, { 0x29, 0x2c, 0x9d, 0x29 }, { 0x29, 0x2d, 0x9e, 0x2a }, { 0x29, 0x2e, 0x9f, 0x2a }, { 0x29, 0x2f, 0xa0, 0x2a }, { 0x29, 0x20, 0xa1, 0x2a }, { 0x2a, 0x21, 0xa2, 0x2a }, { 0x2a, 0x22, 0xa3, 0x2a }, { 0x2a, 0x23, 0xa4, 0x2a }, { 0x2a, 0x24, 0xa5, 0x2a }, { 0x2a, 0x25, 0xa6, 0x2a }, { 0x2a, 0x26, 0xa7, 0x2a }, { 0x2a, 0x27, 0xa8, 0x2a }, { 0x2a, 0x28, 0xa9, 0x2a }, { 0x2a, 0x29, 0xaa, 0x2a }, { 0x2a, 0x2a, 0xab, 0x2a }, { 0x2a, 0x2b, 0xac, 0x2a }, { 0x2a, 0x2c, 0xad, 0x2a }, { 0x2a, 0x2d, 0xae, 0x2b }, { 0x2a, 0x2e, 0xaf, 0x2b }, { 0x2a, 0x2f, 0xb0, 0x2b }, { 0x2a, 0x20, 0xb1, 0x2b }, { 0x2b, 0x21, 0xb2, 0x2b }, { 0x2b, 0x22, 0xb3, 0x2b }, { 0x2b, 0x23, 0xb4, 0x2b }, { 0x2b, 0x24, 0xb5, 0x2b }, { 0x2b, 0x25, 0xb6, 0x2b }, { 0x2b, 0x26, 0xb7, 0x2b }, { 0x2b, 0x27, 0xb8, 0x2b }, { 0x2b, 0x28, 0xb9, 0x2b }, { 0x2b, 0x29, 0xba, 0x2b }, { 0x2b, 0x2a, 0xbb, 0x2b }, { 0x2b, 0x2b, 0xbc, 0x2b }, { 0x2b, 0x2c, 0xbd, 0x2b }, { 0x2b, 0x2d, 0xbe, 0x2c }, { 0x2b, 0x2e, 0xbf, 0x2c }, { 0x2b, 0x2f, 0xc0, 0x2c }, { 0x2b, 0x20, 0xc1, 0x2c }, { 0x2c, 0x21, 0xc2, 0x2c }, { 0x2c, 0x22, 0xc3, 0x2c }, { 0x2c, 0x23, 0xc4, 0x2c }, { 0x2c, 0x24, 0xc5, 0x2c }, { 0x2c, 0x25, 0xc6, 0x2c }, { 0x2c, 0x26, 0xc7, 0x2c }, { 0x2c, 0x27, 0xc8, 0x2c }, { 0x2c, 0x28, 0xc9, 0x2c }, { 0x2c, 0x29, 0xca, 0x2c }, { 0x2c, 0x2a, 0xcb, 0x2c }, { 0x2c, 0x2b, 0xcc, 0x2c }, { 0x2c, 0x2c, 0xcd, 0x2c }, { 0x2c, 0x2d, 0xce, 0x2d }, { 0x2c, 0x2e, 0xcf, 0x2d }, { 0x2c, 0x2f, 0xd0, 0x2d }, { 0x2c, 0x20, 0xd1, 0x2d }, { 0x2d, 0x21, 0xd2, 0x2d }, { 0x2d, 0x22, 0xd3, 0x2d }, { 0x2d, 0x23, 0xd4, 0x2d }, { 0x2d, 0x24, 0xd5, 0x2d }, { 0x2d, 0x25, 0xd6, 0x2d }, { 0x2d, 0x26, 0xd7, 0x2d }, { 0x2d, 0x27, 0xd8, 0x2d }, { 0x2d, 0x28, 0xd9, 0x2d }, { 0x2d, 0x29, 0xda, 0x2d }, { 0x2d, 0x2a, 0xdb, 0x2d }, { 0x2d, 0x2b, 0xdc, 0x2d }, { 0x2d, 0x2c, 0xdd, 0x2d }, { 0x2d, 0x2d, 0xde, 0x2e }, { 0x2d, 0x2e, 0xdf, 0x2e }, { 0x2d, 0x2f, 0xe0, 0x2e }, { 0x2d, 0x20, 0xe1, 0x2e }, { 0x2e, 0x21, 0xe2, 0x2e }, { 0x2e, 0x22, 0xe3, 0x2e }, { 0x2e, 0x23, 0xe4, 0x2e }, { 0x2e, 0x24, 0xe5, 0x2e }, { 0x2e, 0x25, 0xe6, 0x2e }, { 0x2e, 0x26, 0xe7, 0x2e }, { 0x2e, 0x27, 0xe8, 0x2e }, { 0x2e, 0x28, 0xe9, 0x2e }, { 0x2e, 0x29, 0xea, 0x2e }, { 0x2e, 0x2a, 0xeb, 0x2e }, { 0x2e, 0x2b, 0xec, 0x2e }, { 0x2e, 0x2c, 0xed, 0x2e }, { 0x2e, 0x2d, 0xee, 0x2f }, { 0x2e, 0x2e, 0xef, 0x2f }, { 0x2e, 0x2f, 0xf0, 0x2f }, { 0x2e, 0x20, 0xf1, 0x2f }, { 0x2f, 0x21, 0xf2, 0x2f }, { 0x2f, 0x22, 0xf3, 0x2f }, { 0x2f, 0x23, 0xf4, 0x2f }, { 0x2f, 0x24, 0xf5, 0x2f }, { 0x2f, 0x25, 0xf6, 0x2f }, { 0x2f, 0x26, 0xf7, 0x2f }, { 0x2f, 0x27, 0xf8, 0x2f }, { 0x2f, 0x28, 0xf9, 0x2f }, { 0x2f, 0x29, 0xfa, 0x2f }, { 0x2f, 0x2a, 0xfb, 0x2f }, { 0x2f, 0x2b, 0xfc, 0x2f }, { 0x2f, 0x2c, 0xfd, 0x2f }, { 0x2f, 0x2d, 0xfe, 0x30 }, { 0x2f, 0x2e, 0xff, 0x30 }, { 0x2f, 0x2f, 0x00, 0x30 }, { 0x2f, 0x30, 0x01, 0x30 }, { 0x30, 0x31, 0x02, 0x30 }, { 0x30, 0x32, 0x03, 0x30 }, { 0x30, 0x33, 0x04, 0x30 }, { 0x30, 0x34, 0x05, 0x30 }, { 0x30, 0x35, 0x06, 0x30 }, { 0x30, 0x36, 0x07, 0x30 }, { 0x30, 0x37, 0x08, 0x30 }, { 0x30, 0x38, 0x09, 0x30 }, { 0x30, 0x39, 0x0a, 0x30 }, { 0x30, 0x3a, 0x0b, 0x30 }, { 0x30, 0x3b, 0x0c, 0x30 }, { 0x30, 0x3c, 0x0d, 0x30 }, { 0x30, 0x3d, 0x0e, 0x31 }, { 0x30, 0x3e, 0x0f, 0x31 }, { 0x30, 0x3f, 0x10, 0x31 }, { 0x30, 0x30, 0x11, 0x31 }, { 0x31, 0x31, 0x12, 0x31 }, { 0x31, 0x32, 0x13, 0x31 }, { 0x31, 0x33, 0x14, 0x31 }, { 0x31, 0x34, 0x15, 0x31 }, { 0x31, 0x35, 0x16, 0x31 }, { 0x31, 0x36, 0x17, 0x31 }, { 0x31, 0x37, 0x18, 0x31 }, { 0x31, 0x38, 0x19, 0x31 }, { 0x31, 0x39, 0x1a, 0x31 }, { 0x31, 0x3a, 0x1b, 0x31 }, { 0x31, 0x3b, 0x1c, 0x31 }, { 0x31, 0x3c, 0x1d, 0x31 }, { 0x31, 0x3d, 0x1e, 0x32 }, { 0x31, 0x3e, 0x1f, 0x32 }, { 0x31, 0x3f, 0x20, 0x32 }, { 0x31, 0x30, 0x21, 0x32 }, { 0x32, 0x31, 0x22, 0x32 }, { 0x32, 0x32, 0x23, 0x32 }, { 0x32, 0x33, 0x24, 0x32 }, { 0x32, 0x34, 0x25, 0x32 }, { 0x32, 0x35, 0x26, 0x32 }, { 0x32, 0x36, 0x27, 0x32 }, { 0x32, 0x37, 0x28, 0x32 }, { 0x32, 0x38, 0x29, 0x32 }, { 0x32, 0x39, 0x2a, 0x32 }, { 0x32, 0x3a, 0x2b, 0x32 }, { 0x32, 0x3b, 0x2c, 0x32 }, { 0x32, 0x3c, 0x2d, 0x32 }, { 0x32, 0x3d, 0x2e, 0x33 }, { 0x32, 0x3e, 0x2f, 0x33 }, { 0x32, 0x3f, 0x30, 0x33 }, { 0x32, 0x30, 0x31, 0x33 }, { 0x33, 0x31, 0x32, 0x33 }, { 0x33, 0x32, 0x33, 0x33 }, { 0x33, 0x33, 0x34, 0x33 }, { 0x33, 0x34, 0x35, 0x33 }, { 0x33, 0x35, 0x36, 0x33 }, { 0x33, 0x36, 0x37, 0x33 }, { 0x33, 0x37, 0x38, 0x33 }, { 0x33, 0x38, 0x39, 0x33 }, { 0x33, 0x39, 0x3a, 0x33 }, { 0x33, 0x3a, 0x3b, 0x33 }, { 0x33, 0x3b, 0x3c, 0x33 }, { 0x33, 0x3c, 0x3d, 0x33 }, { 0x33, 0x3d, 0x3e, 0x34 }, { 0x33, 0x3e, 0x3f, 0x34 }, { 0x33, 0x3f, 0x40, 0x34 }, { 0x33, 0x30, 0x41, 0x34 }, { 0x34, 0x31, 0x42, 0x34 }, { 0x34, 0x32, 0x43, 0x34 }, { 0x34, 0x33, 0x44, 0x34 }, { 0x34, 0x34, 0x45, 0x34 }, { 0x34, 0x35, 0x46, 0x34 }, { 0x34, 0x36, 0x47, 0x34 }, { 0x34, 0x37, 0x48, 0x34 }, { 0x34, 0x38, 0x49, 0x34 }, { 0x34, 0x39, 0x4a, 0x34 }, { 0x34, 0x3a, 0x4b, 0x34 }, { 0x34, 0x3b, 0x4c, 0x34 }, { 0x34, 0x3c, 0x4d, 0x34 }, { 0x34, 0x3d, 0x4e, 0x35 }, { 0x34, 0x3e, 0x4f, 0x35 }, { 0x34, 0x3f, 0x50, 0x35 }, { 0x34, 0x30, 0x51, 0x35 }, { 0x35, 0x31, 0x52, 0x35 }, { 0x35, 0x32, 0x53, 0x35 }, { 0x35, 0x33, 0x54, 0x35 }, { 0x35, 0x34, 0x55, 0x35 }, { 0x35, 0x35, 0x56, 0x35 }, { 0x35, 0x36, 0x57, 0x35 }, { 0x35, 0x37, 0x58, 0x35 }, { 0x35, 0x38, 0x59, 0x35 }, { 0x35, 0x39, 0x5a, 0x35 }, { 0x35, 0x3a, 0x5b, 0x35 }, { 0x35, 0x3b, 0x5c, 0x35 }, { 0x35, 0x3c, 0x5d, 0x35 }, { 0x35, 0x3d, 0x5e, 0x36 }, { 0x35, 0x3e, 0x5f, 0x36 }, { 0x35, 0x3f, 0x60, 0x36 }, { 0x35, 0x30, 0x61, 0x36 }, { 0x36, 0x31, 0x62, 0x36 }, { 0x36, 0x32, 0x63, 0x36 }, { 0x36, 0x33, 0x64, 0x36 }, { 0x36, 0x34, 0x65, 0x36 }, { 0x36, 0x35, 0x66, 0x36 }, { 0x36, 0x36, 0x67, 0x36 }, { 0x36, 0x37, 0x68, 0x36 }, { 0x36, 0x38, 0x69, 0x36 }, { 0x36, 0x39, 0x6a, 0x36 }, { 0x36, 0x3a, 0x6b, 0x36 }, { 0x36, 0x3b, 0x6c, 0x36 }, { 0x36, 0x3c, 0x6d, 0x36 }, { 0x36, 0x3d, 0x6e, 0x37 }, { 0x36, 0x3e, 0x6f, 0x37 }, { 0x36, 0x3f, 0x70, 0x37 }, { 0x36, 0x30, 0x71, 0x37 }, { 0x37, 0x31, 0x72, 0x37 }, { 0x37, 0x32, 0x73, 0x37 }, { 0x37, 0x33, 0x74, 0x37 }, { 0x37, 0x34, 0x75, 0x37 }, { 0x37, 0x35, 0x76, 0x37 }, { 0x37, 0x36, 0x77, 0x37 }, { 0x37, 0x37, 0x78, 0x37 }, { 0x37, 0x38, 0x79, 0x37 }, { 0x37, 0x39, 0x7a, 0x37 }, { 0x37, 0x3a, 0x7b, 0x37 }, { 0x37, 0x3b, 0x7c, 0x37 }, { 0x37, 0x3c, 0x7d, 0x37 }, { 0x37, 0x3d, 0x7e, 0x38 }, { 0x37, 0x3e, 0x7f, 0x38 }, { 0x37, 0x3f, 0x80, 0x38 }, { 0x37, 0x30, 0x81, 0x38 }, { 0x38, 0x31, 0x82, 0x38 }, { 0x38, 0x32, 0x83, 0x38 }, { 0x38, 0x33, 0x84, 0x38 }, { 0x38, 0x34, 0x85, 0x38 }, { 0x38, 0x35, 0x86, 0x38 }, { 0x38, 0x36, 0x87, 0x38 }, { 0x38, 0x37, 0x88, 0x38 }, { 0x38, 0x38, 0x89, 0x38 }, { 0x38, 0x39, 0x8a, 0x38 }, { 0x38, 0x3a, 0x8b, 0x38 }, { 0x38, 0x3b, 0x8c, 0x38 }, { 0x38, 0x3c, 0x8d, 0x38 }, { 0x38, 0x3d, 0x8e, 0x39 }, { 0x38, 0x3e, 0x8f, 0x39 }, { 0x38, 0x3f, 0x90, 0x39 }, { 0x38, 0x30, 0x91, 0x39 }, { 0x39, 0x31, 0x92, 0x39 }, { 0x39, 0x32, 0x93, 0x39 }, { 0x39, 0x33, 0x94, 0x39 }, { 0x39, 0x34, 0x95, 0x39 }, { 0x39, 0x35, 0x96, 0x39 }, { 0x39, 0x36, 0x97, 0x39 }, { 0x39, 0x37, 0x98, 0x39 }, { 0x39, 0x38, 0x99, 0x39 }, { 0x39, 0x39, 0x9a, 0x39 }, { 0x39, 0x3a, 0x9b, 0x39 }, { 0x39, 0x3b, 0x9c, 0x39 }, { 0x39, 0x3c, 0x9d, 0x39 }, { 0x39, 0x3d, 0x9e, 0x3a }, { 0x39, 0x3e, 0x9f, 0x3a }, { 0x39, 0x3f, 0xa0, 0x3a }, { 0x39, 0x30, 0xa1, 0x3a }, { 0x3a, 0x31, 0xa2, 0x3a }, { 0x3a, 0x32, 0xa3, 0x3a }, { 0x3a, 0x33, 0xa4, 0x3a }, { 0x3a, 0x34, 0xa5, 0x3a }, { 0x3a, 0x35, 0xa6, 0x3a }, { 0x3a, 0x36, 0xa7, 0x3a }, { 0x3a, 0x37, 0xa8, 0x3a }, { 0x3a, 0x38, 0xa9, 0x3a }, { 0x3a, 0x39, 0xaa, 0x3a }, { 0x3a, 0x3a, 0xab, 0x3a }, { 0x3a, 0x3b, 0xac, 0x3a }, { 0x3a, 0x3c, 0xad, 0x3a }, { 0x3a, 0x3d, 0xae, 0x3b }, { 0x3a, 0x3e, 0xaf, 0x3b }, { 0x3a, 0x3f, 0xb0, 0x3b }, { 0x3a, 0x30, 0xb1, 0x3b }, { 0x3b, 0x31, 0xb2, 0x3b }, { 0x3b, 0x32, 0xb3, 0x3b }, { 0x3b, 0x33, 0xb4, 0x3b }, { 0x3b, 0x34, 0xb5, 0x3b }, { 0x3b, 0x35, 0xb6, 0x3b }, { 0x3b, 0x36, 0xb7, 0x3b }, { 0x3b, 0x37, 0xb8, 0x3b }, { 0x3b, 0x38, 0xb9, 0x3b }, { 0x3b, 0x39, 0xba, 0x3b }, { 0x3b, 0x3a, 0xbb, 0x3b }, { 0x3b, 0x3b, 0xbc, 0x3b }, { 0x3b, 0x3c, 0xbd, 0x3b }, { 0x3b, 0x3d, 0xbe, 0x3c }, { 0x3b, 0x3e, 0xbf, 0x3c }, { 0x3b, 0x3f, 0xc0, 0x3c }, { 0x3b, 0x30, 0xc1, 0x3c }, { 0x3c, 0x31, 0xc2, 0x3c }, { 0x3c, 0x32, 0xc3, 0x3c }, { 0x3c, 0x33, 0xc4, 0x3c }, { 0x3c, 0x34, 0xc5, 0x3c }, { 0x3c, 0x35, 0xc6, 0x3c }, { 0x3c, 0x36, 0xc7, 0x3c }, { 0x3c, 0x37, 0xc8, 0x3c }, { 0x3c, 0x38, 0xc9, 0x3c }, { 0x3c, 0x39, 0xca, 0x3c }, { 0x3c, 0x3a, 0xcb, 0x3c }, { 0x3c, 0x3b, 0xcc, 0x3c }, { 0x3c, 0x3c, 0xcd, 0x3c }, { 0x3c, 0x3d, 0xce, 0x3d }, { 0x3c, 0x3e, 0xcf, 0x3d }, { 0x3c, 0x3f, 0xd0, 0x3d }, { 0x3c, 0x30, 0xd1, 0x3d }, { 0x3d, 0x31, 0xd2, 0x3d }, { 0x3d, 0x32, 0xd3, 0x3d }, { 0x3d, 0x33, 0xd4, 0x3d }, { 0x3d, 0x34, 0xd5, 0x3d }, { 0x3d, 0x35, 0xd6, 0x3d }, { 0x3d, 0x36, 0xd7, 0x3d }, { 0x3d, 0x37, 0xd8, 0x3d }, { 0x3d, 0x38, 0xd9, 0x3d }, { 0x3d, 0x39, 0xda, 0x3d }, { 0x3d, 0x3a, 0xdb, 0x3d }, { 0x3d, 0x3b, 0xdc, 0x3d }, { 0x3d, 0x3c, 0xdd, 0x3d }, { 0x3d, 0x3d, 0xde, 0x3e }, { 0x3d, 0x3e, 0xdf, 0x3e }, { 0x3d, 0x3f, 0xe0, 0x3e }, { 0x3d, 0x30, 0xe1, 0x3e }, { 0x3e, 0x31, 0xe2, 0x3e }, { 0x3e, 0x32, 0xe3, 0x3e }, { 0x3e, 0x33, 0xe4, 0x3e }, { 0x3e, 0x34, 0xe5, 0x3e }, { 0x3e, 0x35, 0xe6, 0x3e }, { 0x3e, 0x36, 0xe7, 0x3e }, { 0x3e, 0x37, 0xe8, 0x3e }, { 0x3e, 0x38, 0xe9, 0x3e }, { 0x3e, 0x39, 0xea, 0x3e }, { 0x3e, 0x3a, 0xeb, 0x3e }, { 0x3e, 0x3b, 0xec, 0x3e }, { 0x3e, 0x3c, 0xed, 0x3e }, { 0x3e, 0x3d, 0xee, 0x3f }, { 0x3e, 0x3e, 0xef, 0x3f }, { 0x3e, 0x3f, 0xf0, 0x3f }, { 0x3e, 0x30, 0xf1, 0x3f }, { 0x3f, 0x31, 0xf2, 0x3f }, { 0x3f, 0x32, 0xf3, 0x3f }, { 0x3f, 0x33, 0xf4, 0x3f }, { 0x3f, 0x34, 0xf5, 0x3f }, { 0x3f, 0x35, 0xf6, 0x3f }, { 0x3f, 0x36, 0xf7, 0x3f }, { 0x3f, 0x37, 0xf8, 0x3f }, { 0x3f, 0x38, 0xf9, 0x3f }, { 0x3f, 0x39, 0xfa, 0x3f }, { 0x3f, 0x3a, 0xfb, 0x3f }, { 0x3f, 0x3b, 0xfc, 0x3f }, { 0x3f, 0x3c, 0xfd, 0x3f }, { 0x3f, 0x3d, 0xfe, 0x40 }, { 0x3f, 0x3e, 0xff, 0x40 }, { 0x3f, 0x3f, 0x00, 0x40 }, { 0x3f, 0x40, 0x01, 0x40 }, }; GenefxAccumulator S[ACC_SIZE] = { { 0x0, 0x1, 0x2, 0x4 }, { 0x1, 0x2, 0x3, 0x5 }, { 0x2, 0x3, 0x4, 0x6 }, { 0x3, 0x4, 0x5, 0x7 }, { 0x4, 0x5, 0x6, 0x8 }, { 0x5, 0x6, 0x7, 0x9 }, { 0x6, 0x7, 0x8, 0xa }, { 0x7, 0x8, 0x9, 0xb }, { 0x8, 0x9, 0xa, 0xc }, { 0x9, 0xa, 0xb, 0xd }, { 0xa, 0xb, 0xc, 0xe }, { 0xb, 0xc, 0xd, 0xf }, { 0xc, 0xd, 0xe, 0x10 }, { 0xd, 0xe, 0xf, 0x11 }, { 0xe, 0xf, 0x10, 0x12 }, { 0xf, 0x10, 0x11, 0x13 }, { 0x10, 0x11, 0x12, 0x14 }, { 0x11, 0x12, 0x13, 0x15 }, { 0x12, 0x13, 0x14, 0x16 }, { 0x13, 0x14, 0x15, 0x17 }, { 0x14, 0x15, 0x16, 0x18 }, { 0x15, 0x16, 0x17, 0x19 }, { 0x16, 0x17, 0x18, 0x1a }, { 0x17, 0x18, 0x19, 0x1b }, { 0x18, 0x19, 0x1a, 0x1c }, { 0x19, 0x1a, 0x1b, 0x1d }, { 0x1a, 0x1b, 0x1c, 0x1e }, { 0x1b, 0x1c, 0x1d, 0x1f }, { 0x1c, 0x1d, 0x1e, 0x20 }, { 0x1d, 0x1e, 0x1f, 0x21 }, { 0x1e, 0x1f, 0x20, 0x22 }, { 0x1f, 0x20, 0x21, 0x23 }, { 0x20, 0x21, 0x22, 0x24 }, { 0x21, 0x22, 0x23, 0x25 }, { 0x22, 0x23, 0x24, 0x26 }, { 0x23, 0x24, 0x25, 0x27 }, { 0x24, 0x25, 0x26, 0x28 }, { 0x25, 0x26, 0x27, 0x29 }, { 0x26, 0x27, 0x28, 0x2a }, { 0x27, 0x28, 0x29, 0x2b }, { 0x28, 0x29, 0x2a, 0x2c }, { 0x29, 0x2a, 0x2b, 0x2d }, { 0x2a, 0x2b, 0x2c, 0x2e }, { 0x2b, 0x2c, 0x2d, 0x2f }, { 0x2c, 0x2d, 0x2e, 0x30 }, { 0x2d, 0x2e, 0x2f, 0x31 }, { 0x2e, 0x2f, 0x30, 0x32 }, { 0x2f, 0x30, 0x31, 0x33 }, { 0x30, 0x31, 0x32, 0x34 }, { 0x31, 0x32, 0x33, 0x35 }, { 0x32, 0x33, 0x34, 0x36 }, { 0x33, 0x34, 0x35, 0x37 }, { 0x34, 0x35, 0x36, 0x38 }, { 0x35, 0x36, 0x37, 0x39 }, { 0x36, 0x37, 0x38, 0x3a }, { 0x37, 0x38, 0x39, 0x3b }, { 0x38, 0x39, 0x3a, 0x3c }, { 0x39, 0x3a, 0x3b, 0x3d }, { 0x3a, 0x3b, 0x3c, 0x3e }, { 0x3b, 0x3c, 0x3d, 0x3f }, { 0x3c, 0x3d, 0x3e, 0x40 }, { 0x3d, 0x3e, 0x3f, 0x41 }, { 0x3e, 0x3f, 0x40, 0x42 }, { 0x3f, 0x40, 0x41, 0x43 }, { 0x40, 0x41, 0x42, 0x44 }, { 0x41, 0x42, 0x43, 0x45 }, { 0x42, 0x43, 0x44, 0x46 }, { 0x43, 0x44, 0x45, 0x47 }, { 0x44, 0x45, 0x46, 0x48 }, { 0x45, 0x46, 0x47, 0x49 }, { 0x46, 0x47, 0x48, 0x4a }, { 0x47, 0x48, 0x49, 0x4b }, { 0x48, 0x49, 0x4a, 0x4c }, { 0x49, 0x4a, 0x4b, 0x4d }, { 0x4a, 0x4b, 0x4c, 0x4e }, { 0x4b, 0x4c, 0x4d, 0x4f }, { 0x4c, 0x4d, 0x4e, 0x50 }, { 0x4d, 0x4e, 0x4f, 0x51 }, { 0x4e, 0x4f, 0x50, 0x52 }, { 0x4f, 0x50, 0x51, 0x53 }, { 0x50, 0x51, 0x52, 0x54 }, { 0x51, 0x52, 0x53, 0x55 }, { 0x52, 0x53, 0x54, 0x56 }, { 0x53, 0x54, 0x55, 0x57 }, { 0x54, 0x55, 0x56, 0x58 }, { 0x55, 0x56, 0x57, 0x59 }, { 0x56, 0x57, 0x58, 0x5a }, { 0x57, 0x58, 0x59, 0x5b }, { 0x58, 0x59, 0x5a, 0x5c }, { 0x59, 0x5a, 0x5b, 0x5d }, { 0x5a, 0x5b, 0x5c, 0x5e }, { 0x5b, 0x5c, 0x5d, 0x5f }, { 0x5c, 0x5d, 0x5e, 0x60 }, { 0x5d, 0x5e, 0x5f, 0x61 }, { 0x5e, 0x5f, 0x60, 0x62 }, { 0x5f, 0x60, 0x61, 0x63 }, { 0x60, 0x61, 0x62, 0x64 }, { 0x61, 0x62, 0x63, 0x65 }, { 0x62, 0x63, 0x64, 0x66 }, { 0x63, 0x64, 0x65, 0x67 }, { 0x64, 0x65, 0x66, 0x68 }, { 0x65, 0x66, 0x67, 0x69 }, { 0x66, 0x67, 0x68, 0x6a }, { 0x67, 0x68, 0x69, 0x6b }, { 0x68, 0x69, 0x6a, 0x6c }, { 0x69, 0x6a, 0x6b, 0x6d }, { 0x6a, 0x6b, 0x6c, 0x6e }, { 0x6b, 0x6c, 0x6d, 0x6f }, { 0x6c, 0x6d, 0x6e, 0x70 }, { 0x6d, 0x6e, 0x6f, 0x71 }, { 0x6e, 0x6f, 0x70, 0x72 }, { 0x6f, 0x70, 0x71, 0x73 }, { 0x70, 0x71, 0x72, 0x74 }, { 0x71, 0x72, 0x73, 0x75 }, { 0x72, 0x73, 0x74, 0x76 }, { 0x73, 0x74, 0x75, 0x77 }, { 0x74, 0x75, 0x76, 0x78 }, { 0x75, 0x76, 0x77, 0x79 }, { 0x76, 0x77, 0x78, 0x7a }, { 0x77, 0x78, 0x79, 0x7b }, { 0x78, 0x79, 0x7a, 0x7c }, { 0x79, 0x7a, 0x7b, 0x7d }, { 0x7a, 0x7b, 0x7c, 0x7e }, { 0x7b, 0x7c, 0x7d, 0x7f }, { 0x7c, 0x7d, 0x7e, 0x80 }, { 0x7d, 0x7e, 0x7f, 0x81 }, { 0x7e, 0x7f, 0x80, 0x82 }, { 0x7f, 0x80, 0x81, 0x83 }, { 0x80, 0x81, 0x82, 0x84 }, { 0x81, 0x82, 0x83, 0x85 }, { 0x82, 0x83, 0x84, 0x86 }, { 0x83, 0x84, 0x85, 0x87 }, { 0x84, 0x85, 0x86, 0x88 }, { 0x85, 0x86, 0x87, 0x89 }, { 0x86, 0x87, 0x88, 0x8a }, { 0x87, 0x88, 0x89, 0x8b }, { 0x88, 0x89, 0x8a, 0x8c }, { 0x89, 0x8a, 0x8b, 0x8d }, { 0x8a, 0x8b, 0x8c, 0x8e }, { 0x8b, 0x8c, 0x8d, 0x8f }, { 0x8c, 0x8d, 0x8e, 0x90 }, { 0x8d, 0x8e, 0x8f, 0x91 }, { 0x8e, 0x8f, 0x90, 0x92 }, { 0x8f, 0x90, 0x91, 0x93 }, { 0x90, 0x91, 0x92, 0x94 }, { 0x91, 0x92, 0x93, 0x95 }, { 0x92, 0x93, 0x94, 0x96 }, { 0x93, 0x94, 0x95, 0x97 }, { 0x94, 0x95, 0x96, 0x98 }, { 0x95, 0x96, 0x97, 0x99 }, { 0x96, 0x97, 0x98, 0x9a }, { 0x97, 0x98, 0x99, 0x9b }, { 0x98, 0x99, 0x9a, 0x9c }, { 0x99, 0x9a, 0x9b, 0x9d }, { 0x9a, 0x9b, 0x9c, 0x9e }, { 0x9b, 0x9c, 0x9d, 0x9f }, { 0x9c, 0x9d, 0x9e, 0xa0 }, { 0x9d, 0x9e, 0x9f, 0xa1 }, { 0x9e, 0x9f, 0xa0, 0xa2 }, { 0x9f, 0xa0, 0xa1, 0xa3 }, { 0xa0, 0xa1, 0xa2, 0xa4 }, { 0xa1, 0xa2, 0xa3, 0xa5 }, { 0xa2, 0xa3, 0xa4, 0xa6 }, { 0xa3, 0xa4, 0xa5, 0xa7 }, { 0xa4, 0xa5, 0xa6, 0xa8 }, { 0xa5, 0xa6, 0xa7, 0xa9 }, { 0xa6, 0xa7, 0xa8, 0xaa }, { 0xa7, 0xa8, 0xa9, 0xab }, { 0xa8, 0xa9, 0xaa, 0xac }, { 0xa9, 0xaa, 0xab, 0xad }, { 0xaa, 0xab, 0xac, 0xae }, { 0xab, 0xac, 0xad, 0xaf }, { 0xac, 0xad, 0xae, 0xb0 }, { 0xad, 0xae, 0xaf, 0xb1 }, { 0xae, 0xaf, 0xb0, 0xb2 }, { 0xaf, 0xb0, 0xb1, 0xb3 }, { 0xb0, 0xb1, 0xb2, 0xb4 }, { 0xb1, 0xb2, 0xb3, 0xb5 }, { 0xb2, 0xb3, 0xb4, 0xb6 }, { 0xb3, 0xb4, 0xb5, 0xb7 }, { 0xb4, 0xb5, 0xb6, 0xb8 }, { 0xb5, 0xb6, 0xb7, 0xb9 }, { 0xb6, 0xb7, 0xb8, 0xba }, { 0xb7, 0xb8, 0xb9, 0xbb }, { 0xb8, 0xb9, 0xba, 0xbc }, { 0xb9, 0xba, 0xbb, 0xbd }, { 0xba, 0xbb, 0xbc, 0xbe }, { 0xbb, 0xbc, 0xbd, 0xbf }, { 0xbc, 0xbd, 0xbe, 0xc0 }, { 0xbd, 0xbe, 0xbf, 0xc1 }, { 0xbe, 0xbf, 0xc0, 0xc2 }, { 0xbf, 0xc0, 0xc1, 0xc3 }, { 0xc0, 0xc1, 0xc2, 0xc4 }, { 0xc1, 0xc2, 0xc3, 0xc5 }, { 0xc2, 0xc3, 0xc4, 0xc6 }, { 0xc3, 0xc4, 0xc5, 0xc7 }, { 0xc4, 0xc5, 0xc6, 0xc8 }, { 0xc5, 0xc6, 0xc7, 0xc9 }, { 0xc6, 0xc7, 0xc8, 0xca }, { 0xc7, 0xc8, 0xc9, 0xcb }, { 0xc8, 0xc9, 0xca, 0xcc }, { 0xc9, 0xca, 0xcb, 0xcd }, { 0xca, 0xcb, 0xcc, 0xce }, { 0xcb, 0xcc, 0xcd, 0xcf }, { 0xcc, 0xcd, 0xce, 0xd0 }, { 0xcd, 0xce, 0xcf, 0xd1 }, { 0xce, 0xcf, 0xd0, 0xd2 }, { 0xcf, 0xd0, 0xd1, 0xd3 }, { 0xd0, 0xd1, 0xd2, 0xd4 }, { 0xd1, 0xd2, 0xd3, 0xd5 }, { 0xd2, 0xd3, 0xd4, 0xd6 }, { 0xd3, 0xd4, 0xd5, 0xd7 }, { 0xd4, 0xd5, 0xd6, 0xd8 }, { 0xd5, 0xd6, 0xd7, 0xd9 }, { 0xd6, 0xd7, 0xd8, 0xda }, { 0xd7, 0xd8, 0xd9, 0xdb }, { 0xd8, 0xd9, 0xda, 0xdc }, { 0xd9, 0xda, 0xdb, 0xdd }, { 0xda, 0xdb, 0xdc, 0xde }, { 0xdb, 0xdc, 0xdd, 0xdf }, { 0xdc, 0xdd, 0xde, 0xe0 }, { 0xdd, 0xde, 0xdf, 0xe1 }, { 0xde, 0xdf, 0xe0, 0xe2 }, { 0xdf, 0xe0, 0xe1, 0xe3 }, { 0xe0, 0xe1, 0xe2, 0xe4 }, { 0xe1, 0xe2, 0xe3, 0xe5 }, { 0xe2, 0xe3, 0xe4, 0xe6 }, { 0xe3, 0xe4, 0xe5, 0xe7 }, { 0xe4, 0xe5, 0xe6, 0xe8 }, { 0xe5, 0xe6, 0xe7, 0xe9 }, { 0xe6, 0xe7, 0xe8, 0xea }, { 0xe7, 0xe8, 0xe9, 0xeb }, { 0xe8, 0xe9, 0xea, 0xec }, { 0xe9, 0xea, 0xeb, 0xed }, { 0xea, 0xeb, 0xec, 0xee }, { 0xeb, 0xec, 0xed, 0xef }, { 0xec, 0xed, 0xee, 0xf0 }, { 0xed, 0xee, 0xef, 0xf1 }, { 0xee, 0xef, 0xf0, 0xf2 }, { 0xef, 0xf0, 0xf1, 0xf3 }, { 0xf0, 0xf1, 0xf2, 0xf4 }, { 0xf1, 0xf2, 0xf3, 0xf5 }, { 0xf2, 0xf3, 0xf4, 0xf6 }, { 0xf3, 0xf4, 0xf5, 0xf7 }, { 0xf4, 0xf5, 0xf6, 0xf8 }, { 0xf5, 0xf6, 0xf7, 0xf9 }, { 0xf6, 0xf7, 0xf8, 0xfa }, { 0xf7, 0xf8, 0xf9, 0xfb }, { 0xf8, 0xf9, 0xfa, 0xfc }, { 0xf9, 0xfa, 0xfb, 0xfd }, { 0xfa, 0xfb, 0xfc, 0xfe }, { 0xfb, 0xfc, 0xfd, 0xff }, { 0xfc, 0xfd, 0xfe, 0x00 }, { 0xfd, 0xfe, 0xff, 0x01 }, { 0xfe, 0xff, 0x00, 0x02 }, { 0xff, 0x00, 0x01, 0x03 }, { 0x10, 0x11, 0x02, 0x10 }, { 0x10, 0x12, 0x03, 0x10 }, { 0x10, 0x13, 0x04, 0x10 }, { 0x10, 0x14, 0x05, 0x10 }, { 0x10, 0x15, 0x06, 0x10 }, { 0x10, 0x16, 0x07, 0x10 }, { 0x10, 0x17, 0x08, 0x10 }, { 0x10, 0x18, 0x09, 0x10 }, { 0x10, 0x19, 0x0a, 0x10 }, { 0x10, 0x1a, 0x0b, 0x10 }, { 0x10, 0x1b, 0x0c, 0x10 }, { 0x10, 0x1c, 0x0d, 0x10 }, { 0x10, 0x1d, 0x0e, 0x11 }, { 0x10, 0x1e, 0x0f, 0x11 }, { 0x10, 0x1f, 0x10, 0x11 }, { 0x10, 0x10, 0x11, 0x11 }, { 0x11, 0x11, 0x12, 0x11 }, { 0x11, 0x12, 0x13, 0x11 }, { 0x11, 0x13, 0x14, 0x11 }, { 0x11, 0x14, 0x15, 0x11 }, { 0x11, 0x15, 0x16, 0x11 }, { 0x11, 0x16, 0x17, 0x11 }, { 0x11, 0x17, 0x18, 0x11 }, { 0x11, 0x18, 0x19, 0x11 }, { 0x11, 0x19, 0x1a, 0x11 }, { 0x11, 0x1a, 0x1b, 0x11 }, { 0x11, 0x1b, 0x1c, 0x11 }, { 0x11, 0x1c, 0x1d, 0x11 }, { 0x11, 0x1d, 0x1e, 0x12 }, { 0x11, 0x1e, 0x1f, 0x12 }, { 0x11, 0x1f, 0x20, 0x12 }, { 0x11, 0x10, 0x21, 0x12 }, { 0x12, 0x11, 0x22, 0x12 }, { 0x12, 0x12, 0x23, 0x12 }, { 0x12, 0x13, 0x24, 0x12 }, { 0x12, 0x14, 0x25, 0x12 }, { 0x12, 0x15, 0x26, 0x12 }, { 0x12, 0x16, 0x27, 0x12 }, { 0x12, 0x17, 0x28, 0x12 }, { 0x12, 0x18, 0x29, 0x12 }, { 0x12, 0x19, 0x2a, 0x12 }, { 0x12, 0x1a, 0x2b, 0x12 }, { 0x12, 0x1b, 0x2c, 0x12 }, { 0x12, 0x1c, 0x2d, 0x12 }, { 0x12, 0x1d, 0x2e, 0x13 }, { 0x12, 0x1e, 0x2f, 0x13 }, { 0x12, 0x1f, 0x30, 0x13 }, { 0x12, 0x10, 0x31, 0x13 }, { 0x13, 0x11, 0x32, 0x13 }, { 0x13, 0x12, 0x33, 0x13 }, { 0x13, 0x13, 0x34, 0x13 }, { 0x13, 0x14, 0x35, 0x13 }, { 0x13, 0x15, 0x36, 0x13 }, { 0x13, 0x16, 0x37, 0x13 }, { 0x13, 0x17, 0x38, 0x13 }, { 0x13, 0x18, 0x39, 0x13 }, { 0x13, 0x19, 0x3a, 0x13 }, { 0x13, 0x1a, 0x3b, 0x13 }, { 0x13, 0x1b, 0x3c, 0x13 }, { 0x13, 0x1c, 0x3d, 0x13 }, { 0x13, 0x1d, 0x3e, 0x14 }, { 0x13, 0x1e, 0x3f, 0x14 }, { 0x13, 0x1f, 0x40, 0x14 }, { 0x13, 0x10, 0x41, 0x14 }, { 0x14, 0x11, 0x42, 0x14 }, { 0x14, 0x12, 0x43, 0x14 }, { 0x14, 0x13, 0x44, 0x14 }, { 0x14, 0x14, 0x45, 0x14 }, { 0x14, 0x15, 0x46, 0x14 }, { 0x14, 0x16, 0x47, 0x14 }, { 0x14, 0x17, 0x48, 0x14 }, { 0x14, 0x18, 0x49, 0x14 }, { 0x14, 0x19, 0x4a, 0x14 }, { 0x14, 0x1a, 0x4b, 0x14 }, { 0x14, 0x1b, 0x4c, 0x14 }, { 0x14, 0x1c, 0x4d, 0x14 }, { 0x14, 0x1d, 0x4e, 0x15 }, { 0x14, 0x1e, 0x4f, 0x15 }, { 0x14, 0x1f, 0x50, 0x15 }, { 0x14, 0x10, 0x51, 0x15 }, { 0x15, 0x11, 0x52, 0x15 }, { 0x15, 0x12, 0x53, 0x15 }, { 0x15, 0x13, 0x54, 0x15 }, { 0x15, 0x14, 0x55, 0x15 }, { 0x15, 0x15, 0x56, 0x15 }, { 0x15, 0x16, 0x57, 0x15 }, { 0x15, 0x17, 0x58, 0x15 }, { 0x15, 0x18, 0x59, 0x15 }, { 0x15, 0x19, 0x5a, 0x15 }, { 0x15, 0x1a, 0x5b, 0x15 }, { 0x15, 0x1b, 0x5c, 0x15 }, { 0x15, 0x1c, 0x5d, 0x15 }, { 0x15, 0x1d, 0x5e, 0x16 }, { 0x15, 0x1e, 0x5f, 0x16 }, { 0x15, 0x1f, 0x60, 0x16 }, { 0x15, 0x10, 0x61, 0x16 }, { 0x16, 0x11, 0x62, 0x16 }, { 0x16, 0x12, 0x63, 0x16 }, { 0x16, 0x13, 0x64, 0x16 }, { 0x16, 0x14, 0x65, 0x16 }, { 0x16, 0x15, 0x66, 0x16 }, { 0x16, 0x16, 0x67, 0x16 }, { 0x16, 0x17, 0x68, 0x16 }, { 0x16, 0x18, 0x69, 0x16 }, { 0x16, 0x19, 0x6a, 0x16 }, { 0x16, 0x1a, 0x6b, 0x16 }, { 0x16, 0x1b, 0x6c, 0x16 }, { 0x16, 0x1c, 0x6d, 0x16 }, { 0x16, 0x1d, 0x6e, 0x17 }, { 0x16, 0x1e, 0x6f, 0x17 }, { 0x16, 0x1f, 0x70, 0x17 }, { 0x16, 0x10, 0x71, 0x17 }, { 0x17, 0x11, 0x72, 0x17 }, { 0x17, 0x12, 0x73, 0x17 }, { 0x17, 0x13, 0x74, 0x17 }, { 0x17, 0x14, 0x75, 0x17 }, { 0x17, 0x15, 0x76, 0x17 }, { 0x17, 0x16, 0x77, 0x17 }, { 0x17, 0x17, 0x78, 0x17 }, { 0x17, 0x18, 0x79, 0x17 }, { 0x17, 0x19, 0x7a, 0x17 }, { 0x17, 0x1a, 0x7b, 0x17 }, { 0x17, 0x1b, 0x7c, 0x17 }, { 0x17, 0x1c, 0x7d, 0x17 }, { 0x17, 0x1d, 0x7e, 0x18 }, { 0x17, 0x1e, 0x7f, 0x18 }, { 0x17, 0x1f, 0x80, 0x18 }, { 0x17, 0x10, 0x81, 0x18 }, { 0x18, 0x11, 0x82, 0x18 }, { 0x18, 0x12, 0x83, 0x18 }, { 0x18, 0x13, 0x84, 0x18 }, { 0x18, 0x14, 0x85, 0x18 }, { 0x18, 0x15, 0x86, 0x18 }, { 0x18, 0x16, 0x87, 0x18 }, { 0x18, 0x17, 0x88, 0x18 }, { 0x18, 0x18, 0x89, 0x18 }, { 0x18, 0x19, 0x8a, 0x18 }, { 0x18, 0x1a, 0x8b, 0x18 }, { 0x18, 0x1b, 0x8c, 0x18 }, { 0x18, 0x1c, 0x8d, 0x18 }, { 0x18, 0x1d, 0x8e, 0x19 }, { 0x18, 0x1e, 0x8f, 0x19 }, { 0x18, 0x1f, 0x90, 0x19 }, { 0x18, 0x10, 0x91, 0x19 }, { 0x19, 0x11, 0x92, 0x19 }, { 0x19, 0x12, 0x93, 0x19 }, { 0x19, 0x13, 0x94, 0x19 }, { 0x19, 0x14, 0x95, 0x19 }, { 0x19, 0x15, 0x96, 0x19 }, { 0x19, 0x16, 0x97, 0x19 }, { 0x19, 0x17, 0x98, 0x19 }, { 0x19, 0x18, 0x99, 0x19 }, { 0x19, 0x19, 0x9a, 0x19 }, { 0x19, 0x1a, 0x9b, 0x19 }, { 0x19, 0x1b, 0x9c, 0x19 }, { 0x19, 0x1c, 0x9d, 0x19 }, { 0x19, 0x1d, 0x9e, 0x1a }, { 0x19, 0x1e, 0x9f, 0x1a }, { 0x19, 0x1f, 0xa0, 0x1a }, { 0x19, 0x10, 0xa1, 0x1a }, { 0x1a, 0x11, 0xa2, 0x1a }, { 0x1a, 0x12, 0xa3, 0x1a }, { 0x1a, 0x13, 0xa4, 0x1a }, { 0x1a, 0x14, 0xa5, 0x1a }, { 0x1a, 0x15, 0xa6, 0x1a }, { 0x1a, 0x16, 0xa7, 0x1a }, { 0x1a, 0x17, 0xa8, 0x1a }, { 0x1a, 0x18, 0xa9, 0x1a }, { 0x1a, 0x19, 0xaa, 0x1a }, { 0x1a, 0x1a, 0xab, 0x1a }, { 0x1a, 0x1b, 0xac, 0x1a }, { 0x1a, 0x1c, 0xad, 0x1a }, { 0x1a, 0x1d, 0xae, 0x1b }, { 0x1a, 0x1e, 0xaf, 0x1b }, { 0x1a, 0x1f, 0xb0, 0x1b }, { 0x1a, 0x10, 0xb1, 0x1b }, { 0x1b, 0x11, 0xb2, 0x1b }, { 0x1b, 0x12, 0xb3, 0x1b }, { 0x1b, 0x13, 0xb4, 0x1b }, { 0x1b, 0x14, 0xb5, 0x1b }, { 0x1b, 0x15, 0xb6, 0x1b }, { 0x1b, 0x16, 0xb7, 0x1b }, { 0x1b, 0x17, 0xb8, 0x1b }, { 0x1b, 0x18, 0xb9, 0x1b }, { 0x1b, 0x19, 0xba, 0x1b }, { 0x1b, 0x1a, 0xbb, 0x1b }, { 0x1b, 0x1b, 0xbc, 0x1b }, { 0x1b, 0x1c, 0xbd, 0x1b }, { 0x1b, 0x1d, 0xbe, 0x1c }, { 0x1b, 0x1e, 0xbf, 0x1c }, { 0x1b, 0x1f, 0xc0, 0x1c }, { 0x1b, 0x10, 0xc1, 0x1c }, { 0x1c, 0x11, 0xc2, 0x1c }, { 0x1c, 0x12, 0xc3, 0x1c }, { 0x1c, 0x13, 0xc4, 0x1c }, { 0x1c, 0x14, 0xc5, 0x1c }, { 0x1c, 0x15, 0xc6, 0x1c }, { 0x1c, 0x16, 0xc7, 0x1c }, { 0x1c, 0x17, 0xc8, 0x1c }, { 0x1c, 0x18, 0xc9, 0x1c }, { 0x1c, 0x19, 0xca, 0x1c }, { 0x1c, 0x1a, 0xcb, 0x1c }, { 0x1c, 0x1b, 0xcc, 0x1c }, { 0x1c, 0x1c, 0xcd, 0x1c }, { 0x1c, 0x1d, 0xce, 0x1d }, { 0x1c, 0x1e, 0xcf, 0x1d }, { 0x1c, 0x1f, 0xd0, 0x1d }, { 0x1c, 0x10, 0xd1, 0x1d }, { 0x1d, 0x11, 0xd2, 0x1d }, { 0x1d, 0x12, 0xd3, 0x1d }, { 0x1d, 0x13, 0xd4, 0x1d }, { 0x1d, 0x14, 0xd5, 0x1d }, { 0x1d, 0x15, 0xd6, 0x1d }, { 0x1d, 0x16, 0xd7, 0x1d }, { 0x1d, 0x17, 0xd8, 0x1d }, { 0x1d, 0x18, 0xd9, 0x1d }, { 0x1d, 0x19, 0xda, 0x1d }, { 0x1d, 0x1a, 0xdb, 0x1d }, { 0x1d, 0x1b, 0xdc, 0x1d }, { 0x1d, 0x1c, 0xdd, 0x1d }, { 0x1d, 0x1d, 0xde, 0x1e }, { 0x1d, 0x1e, 0xdf, 0x1e }, { 0x1d, 0x1f, 0xe0, 0x1e }, { 0x1d, 0x10, 0xe1, 0x1e }, { 0x1e, 0x11, 0xe2, 0x1e }, { 0x1e, 0x12, 0xe3, 0x1e }, { 0x1e, 0x13, 0xe4, 0x1e }, { 0x1e, 0x14, 0xe5, 0x1e }, { 0x1e, 0x15, 0xe6, 0x1e }, { 0x1e, 0x16, 0xe7, 0x1e }, { 0x1e, 0x17, 0xe8, 0x1e }, { 0x1e, 0x18, 0xe9, 0x1e }, { 0x1e, 0x19, 0xea, 0x1e }, { 0x1e, 0x1a, 0xeb, 0x1e }, { 0x1e, 0x1b, 0xec, 0x1e }, { 0x1e, 0x1c, 0xed, 0x1e }, { 0x1e, 0x1d, 0xee, 0x1f }, { 0x1e, 0x1e, 0xef, 0x1f }, { 0x1e, 0x1f, 0xf0, 0x1f }, { 0x1e, 0x10, 0xf1, 0x1f }, { 0x1f, 0x11, 0xf2, 0x1f }, { 0x1f, 0x12, 0xf3, 0x1f }, { 0x1f, 0x13, 0xf4, 0x1f }, { 0x1f, 0x14, 0xf5, 0x1f }, { 0x1f, 0x15, 0xf6, 0x1f }, { 0x1f, 0x16, 0xf7, 0x1f }, { 0x1f, 0x17, 0xf8, 0x1f }, { 0x1f, 0x18, 0xf9, 0x1f }, { 0x1f, 0x19, 0xfa, 0x1f }, { 0x1f, 0x1a, 0xfb, 0x1f }, { 0x1f, 0x1b, 0xfc, 0x1f }, { 0x1f, 0x1c, 0xfd, 0x1f }, { 0x1f, 0x1d, 0xfe, 0x20 }, { 0x1f, 0x1e, 0xff, 0x20 }, { 0x1f, 0x1f, 0x00, 0x20 }, { 0x1f, 0x20, 0x01, 0x20 }, { 0x20, 0x21, 0x02, 0x20 }, { 0x20, 0x22, 0x03, 0x20 }, { 0x20, 0x23, 0x04, 0x20 }, { 0x20, 0x24, 0x05, 0x20 }, { 0x20, 0x25, 0x06, 0x20 }, { 0x20, 0x26, 0x07, 0x20 }, { 0x20, 0x27, 0x08, 0x20 }, { 0x20, 0x28, 0x09, 0x20 }, { 0x20, 0x29, 0x0a, 0x20 }, { 0x20, 0x2a, 0x0b, 0x20 }, { 0x20, 0x2b, 0x0c, 0x20 }, { 0x20, 0x2c, 0x0d, 0x20 }, { 0x20, 0x2d, 0x0e, 0x21 }, { 0x20, 0x2e, 0x0f, 0x21 }, { 0x20, 0x2f, 0x10, 0x21 }, { 0x20, 0x20, 0x11, 0x21 }, { 0x21, 0x21, 0x12, 0x21 }, { 0x21, 0x22, 0x13, 0x21 }, { 0x21, 0x23, 0x14, 0x21 }, { 0x21, 0x24, 0x15, 0x21 }, { 0x21, 0x25, 0x16, 0x21 }, { 0x21, 0x26, 0x17, 0x21 }, { 0x21, 0x27, 0x18, 0x21 }, { 0x21, 0x28, 0x19, 0x21 }, { 0x21, 0x29, 0x1a, 0x21 }, { 0x21, 0x2a, 0x1b, 0x21 }, { 0x21, 0x2b, 0x1c, 0x21 }, { 0x21, 0x2c, 0x1d, 0x21 }, { 0x21, 0x2d, 0x1e, 0x22 }, { 0x21, 0x2e, 0x1f, 0x22 }, { 0x21, 0x2f, 0x20, 0x22 }, { 0x21, 0x20, 0x21, 0x22 }, { 0x22, 0x21, 0x22, 0x22 }, { 0x22, 0x22, 0x23, 0x22 }, { 0x22, 0x23, 0x24, 0x22 }, { 0x22, 0x24, 0x25, 0x22 }, { 0x22, 0x25, 0x26, 0x22 }, { 0x22, 0x26, 0x27, 0x22 }, { 0x22, 0x27, 0x28, 0x22 }, { 0x22, 0x28, 0x29, 0x22 }, { 0x22, 0x29, 0x2a, 0x22 }, { 0x22, 0x2a, 0x2b, 0x22 }, { 0x22, 0x2b, 0x2c, 0x22 }, { 0x22, 0x2c, 0x2d, 0x22 }, { 0x22, 0x2d, 0x2e, 0x23 }, { 0x22, 0x2e, 0x2f, 0x23 }, { 0x22, 0x2f, 0x30, 0x23 }, { 0x22, 0x20, 0x31, 0x23 }, { 0x23, 0x21, 0x32, 0x23 }, { 0x23, 0x22, 0x33, 0x23 }, { 0x23, 0x23, 0x34, 0x23 }, { 0x23, 0x24, 0x35, 0x23 }, { 0x23, 0x25, 0x36, 0x23 }, { 0x23, 0x26, 0x37, 0x23 }, { 0x23, 0x27, 0x38, 0x23 }, { 0x23, 0x28, 0x39, 0x23 }, { 0x23, 0x29, 0x3a, 0x23 }, { 0x23, 0x2a, 0x3b, 0x23 }, { 0x23, 0x2b, 0x3c, 0x23 }, { 0x23, 0x2c, 0x3d, 0x23 }, { 0x23, 0x2d, 0x3e, 0x24 }, { 0x23, 0x2e, 0x3f, 0x24 }, { 0x23, 0x2f, 0x40, 0x24 }, { 0x23, 0x20, 0x41, 0x24 }, { 0x24, 0x21, 0x42, 0x24 }, { 0x24, 0x22, 0x43, 0x24 }, { 0x24, 0x23, 0x44, 0x24 }, { 0x24, 0x24, 0x45, 0x24 }, { 0x24, 0x25, 0x46, 0x24 }, { 0x24, 0x26, 0x47, 0x24 }, { 0x24, 0x27, 0x48, 0x24 }, { 0x24, 0x28, 0x49, 0x24 }, { 0x24, 0x29, 0x4a, 0x24 }, { 0x24, 0x2a, 0x4b, 0x24 }, { 0x24, 0x2b, 0x4c, 0x24 }, { 0x24, 0x2c, 0x4d, 0x24 }, { 0x24, 0x2d, 0x4e, 0x25 }, { 0x24, 0x2e, 0x4f, 0x25 }, { 0x24, 0x2f, 0x50, 0x25 }, { 0x24, 0x20, 0x51, 0x25 }, { 0x25, 0x21, 0x52, 0x25 }, { 0x25, 0x22, 0x53, 0x25 }, { 0x25, 0x23, 0x54, 0x25 }, { 0x25, 0x24, 0x55, 0x25 }, { 0x25, 0x25, 0x56, 0x25 }, { 0x25, 0x26, 0x57, 0x25 }, { 0x25, 0x27, 0x58, 0x25 }, { 0x25, 0x28, 0x59, 0x25 }, { 0x25, 0x29, 0x5a, 0x25 }, { 0x25, 0x2a, 0x5b, 0x25 }, { 0x25, 0x2b, 0x5c, 0x25 }, { 0x25, 0x2c, 0x5d, 0x25 }, { 0x25, 0x2d, 0x5e, 0x26 }, { 0x25, 0x2e, 0x5f, 0x26 }, { 0x25, 0x2f, 0x60, 0x26 }, { 0x25, 0x20, 0x61, 0x26 }, { 0x26, 0x21, 0x62, 0x26 }, { 0x26, 0x22, 0x63, 0x26 }, { 0x26, 0x23, 0x64, 0x26 }, { 0x26, 0x24, 0x65, 0x26 }, { 0x26, 0x25, 0x66, 0x26 }, { 0x26, 0x26, 0x67, 0x26 }, { 0x26, 0x27, 0x68, 0x26 }, { 0x26, 0x28, 0x69, 0x26 }, { 0x26, 0x29, 0x6a, 0x26 }, { 0x26, 0x2a, 0x6b, 0x26 }, { 0x26, 0x2b, 0x6c, 0x26 }, { 0x26, 0x2c, 0x6d, 0x26 }, { 0x26, 0x2d, 0x6e, 0x27 }, { 0x26, 0x2e, 0x6f, 0x27 }, { 0x26, 0x2f, 0x70, 0x27 }, { 0x26, 0x20, 0x71, 0x27 }, { 0x27, 0x21, 0x72, 0x27 }, { 0x27, 0x22, 0x73, 0x27 }, { 0x27, 0x23, 0x74, 0x27 }, { 0x27, 0x24, 0x75, 0x27 }, { 0x27, 0x25, 0x76, 0x27 }, { 0x27, 0x26, 0x77, 0x27 }, { 0x27, 0x27, 0x78, 0x27 }, { 0x27, 0x28, 0x79, 0x27 }, { 0x27, 0x29, 0x7a, 0x27 }, { 0x27, 0x2a, 0x7b, 0x27 }, { 0x27, 0x2b, 0x7c, 0x27 }, { 0x27, 0x2c, 0x7d, 0x27 }, { 0x27, 0x2d, 0x7e, 0x28 }, { 0x27, 0x2e, 0x7f, 0x28 }, { 0x27, 0x2f, 0x80, 0x28 }, { 0x27, 0x20, 0x81, 0x28 }, { 0x28, 0x21, 0x82, 0x28 }, { 0x28, 0x22, 0x83, 0x28 }, { 0x28, 0x23, 0x84, 0x28 }, { 0x28, 0x24, 0x85, 0x28 }, { 0x28, 0x25, 0x86, 0x28 }, { 0x28, 0x26, 0x87, 0x28 }, { 0x28, 0x27, 0x88, 0x28 }, { 0x28, 0x28, 0x89, 0x28 }, { 0x28, 0x29, 0x8a, 0x28 }, { 0x28, 0x2a, 0x8b, 0x28 }, { 0x28, 0x2b, 0x8c, 0x28 }, { 0x28, 0x2c, 0x8d, 0x28 }, { 0x28, 0x2d, 0x8e, 0x29 }, { 0x28, 0x2e, 0x8f, 0x29 }, { 0x28, 0x2f, 0x90, 0x29 }, { 0x28, 0x20, 0x91, 0x29 }, { 0x29, 0x21, 0x92, 0x29 }, { 0x29, 0x22, 0x93, 0x29 }, { 0x29, 0x23, 0x94, 0x29 }, { 0x29, 0x24, 0x95, 0x29 }, { 0x29, 0x25, 0x96, 0x29 }, { 0x29, 0x26, 0x97, 0x29 }, { 0x29, 0x27, 0x98, 0x29 }, { 0x29, 0x28, 0x99, 0x29 }, { 0x29, 0x29, 0x9a, 0x29 }, { 0x29, 0x2a, 0x9b, 0x29 }, { 0x29, 0x2b, 0x9c, 0x29 }, { 0x29, 0x2c, 0x9d, 0x29 }, { 0x29, 0x2d, 0x9e, 0x2a }, { 0x29, 0x2e, 0x9f, 0x2a }, { 0x29, 0x2f, 0xa0, 0x2a }, { 0x29, 0x20, 0xa1, 0x2a }, { 0x2a, 0x21, 0xa2, 0x2a }, { 0x2a, 0x22, 0xa3, 0x2a }, { 0x2a, 0x23, 0xa4, 0x2a }, { 0x2a, 0x24, 0xa5, 0x2a }, { 0x2a, 0x25, 0xa6, 0x2a }, { 0x2a, 0x26, 0xa7, 0x2a }, { 0x2a, 0x27, 0xa8, 0x2a }, { 0x2a, 0x28, 0xa9, 0x2a }, { 0x2a, 0x29, 0xaa, 0x2a }, { 0x2a, 0x2a, 0xab, 0x2a }, { 0x2a, 0x2b, 0xac, 0x2a }, { 0x2a, 0x2c, 0xad, 0x2a }, { 0x2a, 0x2d, 0xae, 0x2b }, { 0x2a, 0x2e, 0xaf, 0x2b }, { 0x2a, 0x2f, 0xb0, 0x2b }, { 0x2a, 0x20, 0xb1, 0x2b }, { 0x2b, 0x21, 0xb2, 0x2b }, { 0x2b, 0x22, 0xb3, 0x2b }, { 0x2b, 0x23, 0xb4, 0x2b }, { 0x2b, 0x24, 0xb5, 0x2b }, { 0x2b, 0x25, 0xb6, 0x2b }, { 0x2b, 0x26, 0xb7, 0x2b }, { 0x2b, 0x27, 0xb8, 0x2b }, { 0x2b, 0x28, 0xb9, 0x2b }, { 0x2b, 0x29, 0xba, 0x2b }, { 0x2b, 0x2a, 0xbb, 0x2b }, { 0x2b, 0x2b, 0xbc, 0x2b }, { 0x2b, 0x2c, 0xbd, 0x2b }, { 0x2b, 0x2d, 0xbe, 0x2c }, { 0x2b, 0x2e, 0xbf, 0x2c }, { 0x2b, 0x2f, 0xc0, 0x2c }, { 0x2b, 0x20, 0xc1, 0x2c }, { 0x2c, 0x21, 0xc2, 0x2c }, { 0x2c, 0x22, 0xc3, 0x2c }, { 0x2c, 0x23, 0xc4, 0x2c }, { 0x2c, 0x24, 0xc5, 0x2c }, { 0x2c, 0x25, 0xc6, 0x2c }, { 0x2c, 0x26, 0xc7, 0x2c }, { 0x2c, 0x27, 0xc8, 0x2c }, { 0x2c, 0x28, 0xc9, 0x2c }, { 0x2c, 0x29, 0xca, 0x2c }, { 0x2c, 0x2a, 0xcb, 0x2c }, { 0x2c, 0x2b, 0xcc, 0x2c }, { 0x2c, 0x2c, 0xcd, 0x2c }, { 0x2c, 0x2d, 0xce, 0x2d }, { 0x2c, 0x2e, 0xcf, 0x2d }, { 0x2c, 0x2f, 0xd0, 0x2d }, { 0x2c, 0x20, 0xd1, 0x2d }, { 0x2d, 0x21, 0xd2, 0x2d }, { 0x2d, 0x22, 0xd3, 0x2d }, { 0x2d, 0x23, 0xd4, 0x2d }, { 0x2d, 0x24, 0xd5, 0x2d }, { 0x2d, 0x25, 0xd6, 0x2d }, { 0x2d, 0x26, 0xd7, 0x2d }, { 0x2d, 0x27, 0xd8, 0x2d }, { 0x2d, 0x28, 0xd9, 0x2d }, { 0x2d, 0x29, 0xda, 0x2d }, { 0x2d, 0x2a, 0xdb, 0x2d }, { 0x2d, 0x2b, 0xdc, 0x2d }, { 0x2d, 0x2c, 0xdd, 0x2d }, { 0x2d, 0x2d, 0xde, 0x2e }, { 0x2d, 0x2e, 0xdf, 0x2e }, { 0x2d, 0x2f, 0xe0, 0x2e }, { 0x2d, 0x20, 0xe1, 0x2e }, { 0x2e, 0x21, 0xe2, 0x2e }, { 0x2e, 0x22, 0xe3, 0x2e }, { 0x2e, 0x23, 0xe4, 0x2e }, { 0x2e, 0x24, 0xe5, 0x2e }, { 0x2e, 0x25, 0xe6, 0x2e }, { 0x2e, 0x26, 0xe7, 0x2e }, { 0x2e, 0x27, 0xe8, 0x2e }, { 0x2e, 0x28, 0xe9, 0x2e }, { 0x2e, 0x29, 0xea, 0x2e }, { 0x2e, 0x2a, 0xeb, 0x2e }, { 0x2e, 0x2b, 0xec, 0x2e }, { 0x2e, 0x2c, 0xed, 0x2e }, { 0x2e, 0x2d, 0xee, 0x2f }, { 0x2e, 0x2e, 0xef, 0x2f }, { 0x2e, 0x2f, 0xf0, 0x2f }, { 0x2e, 0x20, 0xf1, 0x2f }, { 0x2f, 0x21, 0xf2, 0x2f }, { 0x2f, 0x22, 0xf3, 0x2f }, { 0x2f, 0x23, 0xf4, 0x2f }, { 0x2f, 0x24, 0xf5, 0x2f }, { 0x2f, 0x25, 0xf6, 0x2f }, { 0x2f, 0x26, 0xf7, 0x2f }, { 0x2f, 0x27, 0xf8, 0x2f }, { 0x2f, 0x28, 0xf9, 0x2f }, { 0x2f, 0x29, 0xfa, 0x2f }, { 0x2f, 0x2a, 0xfb, 0x2f }, { 0x2f, 0x2b, 0xfc, 0x2f }, { 0x2f, 0x2c, 0xfd, 0x2f }, { 0x2f, 0x2d, 0xfe, 0x30 }, { 0x2f, 0x2e, 0xff, 0x30 }, { 0x2f, 0x2f, 0x00, 0x30 }, { 0x2f, 0x30, 0x01, 0x30 }, { 0x30, 0x31, 0x02, 0x30 }, { 0x30, 0x32, 0x03, 0x30 }, { 0x30, 0x33, 0x04, 0x30 }, { 0x30, 0x34, 0x05, 0x30 }, { 0x30, 0x35, 0x06, 0x30 }, { 0x30, 0x36, 0x07, 0x30 }, { 0x30, 0x37, 0x08, 0x30 }, { 0x30, 0x38, 0x09, 0x30 }, { 0x30, 0x39, 0x0a, 0x30 }, { 0x30, 0x3a, 0x0b, 0x30 }, { 0x30, 0x3b, 0x0c, 0x30 }, { 0x30, 0x3c, 0x0d, 0x30 }, { 0x30, 0x3d, 0x0e, 0x31 }, { 0x30, 0x3e, 0x0f, 0x31 }, { 0x30, 0x3f, 0x10, 0x31 }, { 0x30, 0x30, 0x11, 0x31 }, { 0x31, 0x31, 0x12, 0x31 }, { 0x31, 0x32, 0x13, 0x31 }, { 0x31, 0x33, 0x14, 0x31 }, { 0x31, 0x34, 0x15, 0x31 }, { 0x31, 0x35, 0x16, 0x31 }, { 0x31, 0x36, 0x17, 0x31 }, { 0x31, 0x37, 0x18, 0x31 }, { 0x31, 0x38, 0x19, 0x31 }, { 0x31, 0x39, 0x1a, 0x31 }, { 0x31, 0x3a, 0x1b, 0x31 }, { 0x31, 0x3b, 0x1c, 0x31 }, { 0x31, 0x3c, 0x1d, 0x31 }, { 0x31, 0x3d, 0x1e, 0x32 }, { 0x31, 0x3e, 0x1f, 0x32 }, { 0x31, 0x3f, 0x20, 0x32 }, { 0x31, 0x30, 0x21, 0x32 }, { 0x32, 0x31, 0x22, 0x32 }, { 0x32, 0x32, 0x23, 0x32 }, { 0x32, 0x33, 0x24, 0x32 }, { 0x32, 0x34, 0x25, 0x32 }, { 0x32, 0x35, 0x26, 0x32 }, { 0x32, 0x36, 0x27, 0x32 }, { 0x32, 0x37, 0x28, 0x32 }, { 0x32, 0x38, 0x29, 0x32 }, { 0x32, 0x39, 0x2a, 0x32 }, { 0x32, 0x3a, 0x2b, 0x32 }, { 0x32, 0x3b, 0x2c, 0x32 }, { 0x32, 0x3c, 0x2d, 0x32 }, { 0x32, 0x3d, 0x2e, 0x33 }, { 0x32, 0x3e, 0x2f, 0x33 }, { 0x32, 0x3f, 0x30, 0x33 }, { 0x32, 0x30, 0x31, 0x33 }, { 0x33, 0x31, 0x32, 0x33 }, { 0x33, 0x32, 0x33, 0x33 }, { 0x33, 0x33, 0x34, 0x33 }, { 0x33, 0x34, 0x35, 0x33 }, { 0x33, 0x35, 0x36, 0x33 }, { 0x33, 0x36, 0x37, 0x33 }, { 0x33, 0x37, 0x38, 0x33 }, { 0x33, 0x38, 0x39, 0x33 }, { 0x33, 0x39, 0x3a, 0x33 }, { 0x33, 0x3a, 0x3b, 0x33 }, { 0x33, 0x3b, 0x3c, 0x33 }, { 0x33, 0x3c, 0x3d, 0x33 }, { 0x33, 0x3d, 0x3e, 0x34 }, { 0x33, 0x3e, 0x3f, 0x34 }, { 0x33, 0x3f, 0x40, 0x34 }, { 0x33, 0x30, 0x41, 0x34 }, { 0x34, 0x31, 0x42, 0x34 }, { 0x34, 0x32, 0x43, 0x34 }, { 0x34, 0x33, 0x44, 0x34 }, { 0x34, 0x34, 0x45, 0x34 }, { 0x34, 0x35, 0x46, 0x34 }, { 0x34, 0x36, 0x47, 0x34 }, { 0x34, 0x37, 0x48, 0x34 }, { 0x34, 0x38, 0x49, 0x34 }, { 0x34, 0x39, 0x4a, 0x34 }, { 0x34, 0x3a, 0x4b, 0x34 }, { 0x34, 0x3b, 0x4c, 0x34 }, { 0x34, 0x3c, 0x4d, 0x34 }, { 0x34, 0x3d, 0x4e, 0x35 }, { 0x34, 0x3e, 0x4f, 0x35 }, { 0x34, 0x3f, 0x50, 0x35 }, { 0x34, 0x30, 0x51, 0x35 }, { 0x35, 0x31, 0x52, 0x35 }, { 0x35, 0x32, 0x53, 0x35 }, { 0x35, 0x33, 0x54, 0x35 }, { 0x35, 0x34, 0x55, 0x35 }, { 0x35, 0x35, 0x56, 0x35 }, { 0x35, 0x36, 0x57, 0x35 }, { 0x35, 0x37, 0x58, 0x35 }, { 0x35, 0x38, 0x59, 0x35 }, { 0x35, 0x39, 0x5a, 0x35 }, { 0x35, 0x3a, 0x5b, 0x35 }, { 0x35, 0x3b, 0x5c, 0x35 }, { 0x35, 0x3c, 0x5d, 0x35 }, { 0x35, 0x3d, 0x5e, 0x36 }, { 0x35, 0x3e, 0x5f, 0x36 }, { 0x35, 0x3f, 0x60, 0x36 }, { 0x35, 0x30, 0x61, 0x36 }, { 0x36, 0x31, 0x62, 0x36 }, { 0x36, 0x32, 0x63, 0x36 }, { 0x36, 0x33, 0x64, 0x36 }, { 0x36, 0x34, 0x65, 0x36 }, { 0x36, 0x35, 0x66, 0x36 }, { 0x36, 0x36, 0x67, 0x36 }, { 0x36, 0x37, 0x68, 0x36 }, { 0x36, 0x38, 0x69, 0x36 }, { 0x36, 0x39, 0x6a, 0x36 }, { 0x36, 0x3a, 0x6b, 0x36 }, { 0x36, 0x3b, 0x6c, 0x36 }, { 0x36, 0x3c, 0x6d, 0x36 }, { 0x36, 0x3d, 0x6e, 0x37 }, { 0x36, 0x3e, 0x6f, 0x37 }, { 0x36, 0x3f, 0x70, 0x37 }, { 0x36, 0x30, 0x71, 0x37 }, { 0x37, 0x31, 0x72, 0x37 }, { 0x37, 0x32, 0x73, 0x37 }, { 0x37, 0x33, 0x74, 0x37 }, { 0x37, 0x34, 0x75, 0x37 }, { 0x37, 0x35, 0x76, 0x37 }, { 0x37, 0x36, 0x77, 0x37 }, { 0x37, 0x37, 0x78, 0x37 }, { 0x37, 0x38, 0x79, 0x37 }, { 0x37, 0x39, 0x7a, 0x37 }, { 0x37, 0x3a, 0x7b, 0x37 }, { 0x37, 0x3b, 0x7c, 0x37 }, { 0x37, 0x3c, 0x7d, 0x37 }, { 0x37, 0x3d, 0x7e, 0x38 }, { 0x37, 0x3e, 0x7f, 0x38 }, { 0x37, 0x3f, 0x80, 0x38 }, { 0x37, 0x30, 0x81, 0x38 }, { 0x38, 0x31, 0x82, 0x38 }, { 0x38, 0x32, 0x83, 0x38 }, { 0x38, 0x33, 0x84, 0x38 }, { 0x38, 0x34, 0x85, 0x38 }, { 0x38, 0x35, 0x86, 0x38 }, { 0x38, 0x36, 0x87, 0x38 }, { 0x38, 0x37, 0x88, 0x38 }, { 0x38, 0x38, 0x89, 0x38 }, { 0x38, 0x39, 0x8a, 0x38 }, { 0x38, 0x3a, 0x8b, 0x38 }, { 0x38, 0x3b, 0x8c, 0x38 }, { 0x38, 0x3c, 0x8d, 0x38 }, { 0x38, 0x3d, 0x8e, 0x39 }, { 0x38, 0x3e, 0x8f, 0x39 }, { 0x38, 0x3f, 0x90, 0x39 }, { 0x38, 0x30, 0x91, 0x39 }, { 0x39, 0x31, 0x92, 0x39 }, { 0x39, 0x32, 0x93, 0x39 }, { 0x39, 0x33, 0x94, 0x39 }, { 0x39, 0x34, 0x95, 0x39 }, { 0x39, 0x35, 0x96, 0x39 }, { 0x39, 0x36, 0x97, 0x39 }, { 0x39, 0x37, 0x98, 0x39 }, { 0x39, 0x38, 0x99, 0x39 }, { 0x39, 0x39, 0x9a, 0x39 }, { 0x39, 0x3a, 0x9b, 0x39 }, { 0x39, 0x3b, 0x9c, 0x39 }, { 0x39, 0x3c, 0x9d, 0x39 }, { 0x39, 0x3d, 0x9e, 0x3a }, { 0x39, 0x3e, 0x9f, 0x3a }, { 0x39, 0x3f, 0xa0, 0x3a }, { 0x39, 0x30, 0xa1, 0x3a }, { 0x3a, 0x31, 0xa2, 0x3a }, { 0x3a, 0x32, 0xa3, 0x3a }, { 0x3a, 0x33, 0xa4, 0x3a }, { 0x3a, 0x34, 0xa5, 0x3a }, { 0x3a, 0x35, 0xa6, 0x3a }, { 0x3a, 0x36, 0xa7, 0x3a }, { 0x3a, 0x37, 0xa8, 0x3a }, { 0x3a, 0x38, 0xa9, 0x3a }, { 0x3a, 0x39, 0xaa, 0x3a }, { 0x3a, 0x3a, 0xab, 0x3a }, { 0x3a, 0x3b, 0xac, 0x3a }, { 0x3a, 0x3c, 0xad, 0x3a }, { 0x3a, 0x3d, 0xae, 0x3b }, { 0x3a, 0x3e, 0xaf, 0x3b }, { 0x3a, 0x3f, 0xb0, 0x3b }, { 0x3a, 0x30, 0xb1, 0x3b }, { 0x3b, 0x31, 0xb2, 0x3b }, { 0x3b, 0x32, 0xb3, 0x3b }, { 0x3b, 0x33, 0xb4, 0x3b }, { 0x3b, 0x34, 0xb5, 0x3b }, { 0x3b, 0x35, 0xb6, 0x3b }, { 0x3b, 0x36, 0xb7, 0x3b }, { 0x3b, 0x37, 0xb8, 0x3b }, { 0x3b, 0x38, 0xb9, 0x3b }, { 0x3b, 0x39, 0xba, 0x3b }, { 0x3b, 0x3a, 0xbb, 0x3b }, { 0x3b, 0x3b, 0xbc, 0x3b }, { 0x3b, 0x3c, 0xbd, 0x3b }, { 0x3b, 0x3d, 0xbe, 0x3c }, { 0x3b, 0x3e, 0xbf, 0x3c }, { 0x3b, 0x3f, 0xc0, 0x3c }, { 0x3b, 0x30, 0xc1, 0x3c }, { 0x3c, 0x31, 0xc2, 0x3c }, { 0x3c, 0x32, 0xc3, 0x3c }, { 0x3c, 0x33, 0xc4, 0x3c }, { 0x3c, 0x34, 0xc5, 0x3c }, { 0x3c, 0x35, 0xc6, 0x3c }, { 0x3c, 0x36, 0xc7, 0x3c }, { 0x3c, 0x37, 0xc8, 0x3c }, { 0x3c, 0x38, 0xc9, 0x3c }, { 0x3c, 0x39, 0xca, 0x3c }, { 0x3c, 0x3a, 0xcb, 0x3c }, { 0x3c, 0x3b, 0xcc, 0x3c }, { 0x3c, 0x3c, 0xcd, 0x3c }, { 0x3c, 0x3d, 0xce, 0x3d }, { 0x3c, 0x3e, 0xcf, 0x3d }, { 0x3c, 0x3f, 0xd0, 0x3d }, { 0x3c, 0x30, 0xd1, 0x3d }, { 0x3d, 0x31, 0xd2, 0x3d }, { 0x3d, 0x32, 0xd3, 0x3d }, { 0x3d, 0x33, 0xd4, 0x3d }, { 0x3d, 0x34, 0xd5, 0x3d }, { 0x3d, 0x35, 0xd6, 0x3d }, { 0x3d, 0x36, 0xd7, 0x3d }, { 0x3d, 0x37, 0xd8, 0x3d }, { 0x3d, 0x38, 0xd9, 0x3d }, { 0x3d, 0x39, 0xda, 0x3d }, { 0x3d, 0x3a, 0xdb, 0x3d }, { 0x3d, 0x3b, 0xdc, 0x3d }, { 0x3d, 0x3c, 0xdd, 0x3d }, { 0x3d, 0x3d, 0xde, 0x3e }, { 0x3d, 0x3e, 0xdf, 0x3e }, { 0x3d, 0x3f, 0xe0, 0x3e }, { 0x3d, 0x30, 0xe1, 0x3e }, { 0x3e, 0x31, 0xe2, 0x3e }, { 0x3e, 0x32, 0xe3, 0x3e }, { 0x3e, 0x33, 0xe4, 0x3e }, { 0x3e, 0x34, 0xe5, 0x3e }, { 0x3e, 0x35, 0xe6, 0x3e }, { 0x3e, 0x36, 0xe7, 0x3e }, { 0x3e, 0x37, 0xe8, 0x3e }, { 0x3e, 0x38, 0xe9, 0x3e }, { 0x3e, 0x39, 0xea, 0x3e }, { 0x3e, 0x3a, 0xeb, 0x3e }, { 0x3e, 0x3b, 0xec, 0x3e }, { 0x3e, 0x3c, 0xed, 0x3e }, { 0x3e, 0x3d, 0xee, 0x3f }, { 0x3e, 0x3e, 0xef, 0x3f }, { 0x3e, 0x3f, 0xf0, 0x3f }, { 0x3e, 0x30, 0xf1, 0x3f }, { 0x3f, 0x31, 0xf2, 0x3f }, { 0x3f, 0x32, 0xf3, 0x3f }, { 0x3f, 0x33, 0xf4, 0x3f }, { 0x3f, 0x34, 0xf5, 0x3f }, { 0x3f, 0x35, 0xf6, 0x3f }, { 0x3f, 0x36, 0xf7, 0x3f }, { 0x3f, 0x37, 0xf8, 0x3f }, { 0x3f, 0x38, 0xf9, 0x3f }, { 0x3f, 0x39, 0xfa, 0x3f }, { 0x3f, 0x3a, 0xfb, 0x3f }, { 0x3f, 0x3b, 0xfc, 0x3f }, { 0x3f, 0x3c, 0xfd, 0x3f }, { 0x3f, 0x3d, 0xfe, 0x40 }, { 0x3f, 0x3e, 0xff, 0x40 }, { 0x3f, 0x3f, 0x00, 0x40 }, { 0x3f, 0x40, 0x01, 0x40 }, }; /* * Utils */ static void dump_Accumulator (GenefxAccumulator* g, int size) { int iter = 0; printf ("\t%3s %3s %3s %3s\n", "A", "R", "G", "B"); for(; iter < size; iter++) { printf ("\t[%4d]: %3x %3x %3x %3x\n", iter, g->RGB.a, g->RGB.r, g->RGB.g, g->RGB.b); g++; } return; } #if 0 /* * Operation_1, to be converted */ static void Xacc_blend_invsrccolor( int w, GenefxAccumulator* S, GenefxAccumulator Cacc, GenefxAccumulator* X) { // int w = gfxs->length; // GenefxAccumulator *X = gfxs->Xacc; if (S) { // GenefxAccumulator *S = gfxs->Sacc; while (w--) { if (!(X->RGB.a & 0xF000)) { X->RGB.r = ((0x100 - S->RGB.r) * X->RGB.r) >> 8; X->RGB.g = ((0x100 - S->RGB.g) * X->RGB.g) >> 8; X->RGB.b = ((0x100 - S->RGB.b) * X->RGB.b) >> 8; X->RGB.a = ((0x100 - S->RGB.a) * X->RGB.a) >> 8; } X++; S++; } } else { // GenefxAccumulator Cacc = gfxs->Cacc; Cacc.RGB.r = 0x100 - Cacc.RGB.r; Cacc.RGB.g = 0x100 - Cacc.RGB.g; Cacc.RGB.b = 0x100 - Cacc.RGB.b; Cacc.RGB.a = 0x100 - Cacc.RGB.a; while (w--) { if (!(X->RGB.a & 0xF000)) { X->RGB.r = (Cacc.RGB.r * X->RGB.r) >> 8; X->RGB.g = (Cacc.RGB.g * X->RGB.g) >> 8; X->RGB.b = (Cacc.RGB.b * X->RGB.b) >> 8; X->RGB.a = (Cacc.RGB.a * X->RGB.a) >> 8; } X++; } } } /* * Operation_2, to be converted */ static void Dacc_premultiply( int w, GenefxAccumulator* D) { // int w = gfxs->length; // GenefxAccumulator *D = gfxs->Dacc; while (w--) { if (!(D->RGB.a & 0xF000)) { register unsigned short Da = D->RGB.a + 1; D->RGB.r = (Da * D->RGB.r) >> 8; D->RGB.g = (Da * D->RGB.g) >> 8; D->RGB.b = (Da * D->RGB.b) >> 8; } D++; } } #endif int main (void) { //time_t t1,t2; //(void) time(&t1); GenefxAccumulator const_color = { .RGB = { .a = 0x80, .r = 0x80, .g = 0x80, .b = 0x80, } }; // printf ("[main] Initial conditions \n"); // dump_Accumulator (D, ACC_SIZE); //// dump_Accumulator (S, ACC_SIZE); // printf ("\n\n\n[main] Operation Dacc_premultiply\n"); Dacc_premultiply( ACC_SIZE, D); // printf ("[main] Results: Dacc_premultiply \n"); // dump_Accumulator (D, ACC_SIZE ); // printf ("\n\n\n[main] Operation Xacc_blend_invsrccolor \n"); Xacc_blend_invsrccolor( ACC_SIZE, S, const_color, D); // printf ("[main] Results: Xacc_blend_invsrccolor \n"); // dump_Accumulator (D, ACC_SIZE ); // printf ("\n\n\n[main] Operation Xacc_blend_invsrccolor_2 \n"); Xacc_blend_invsrccolor( ACC_SIZE, S, const_color, D); //// printf ("[main] Results: Xacc_blend_invsrccolor_2 \n"); // dump_Accumulator (D, ACC_SIZE ); //(void) time(&t2); //printf("\nexecution time : %lf sec \n\n",(float)(t2-t1)); return 0; } -------------- next part -------------- /* * Definitions */ typedef union { struct { unsigned short b; unsigned short g; unsigned short r; unsigned short a; } RGB; struct { unsigned short u; unsigned short v; unsigned short y; unsigned short a; } YUV; } GenefxAccumulator; /* * Operation_2, to be converted */ void Dacc_premultiply( int w, GenefxAccumulator* D) { // int w = gfxs->length; // GenefxAccumulator *D = gfxs->Dacc; while (w--) { if (!(D->RGB.a & 0xF000)) { register unsigned short Da = D->RGB.a + 1; D->RGB.r = (Da * D->RGB.r) >> 8; D->RGB.g = (Da * D->RGB.g) >> 8; D->RGB.b = (Da * D->RGB.b) >> 8; } D++; } } -------------- next part -------------- /* * Definitions */ typedef union { struct { unsigned short b; unsigned short g; unsigned short r; unsigned short a; } RGB; struct { unsigned short u; unsigned short v; unsigned short y; unsigned short a; } YUV; } GenefxAccumulator; /* * Operation_1, to be converted */ void Xacc_blend_invsrccolor( int w, GenefxAccumulator* S, GenefxAccumulator Cacc, GenefxAccumulator* X) { // int w = gfxs->length; // GenefxAccumulator *X = gfxs->Xacc; if (S) { // GenefxAccumulator *S = gfxs->Sacc; while (w--) { if (!(X->RGB.a & 0xF000)) { X->RGB.r = ((0x100 - S->RGB.r) * X->RGB.r) >> 8; X->RGB.g = ((0x100 - S->RGB.g) * X->RGB.g) >> 8; X->RGB.b = ((0x100 - S->RGB.b) * X->RGB.b) >> 8; X->RGB.a = ((0x100 - S->RGB.a) * X->RGB.a) >> 8; } X++; S++; } } else { // GenefxAccumulator Cacc = gfxs->Cacc; Cacc.RGB.r = 0x100 - Cacc.RGB.r; Cacc.RGB.g = 0x100 - Cacc.RGB.g; Cacc.RGB.b = 0x100 - Cacc.RGB.b; Cacc.RGB.a = 0x100 - Cacc.RGB.a; while (w--) { if (!(X->RGB.a & 0xF000)) { X->RGB.r = (Cacc.RGB.r * X->RGB.r) >> 8; X->RGB.g = (Cacc.RGB.g * X->RGB.g) >> 8; X->RGB.b = (Cacc.RGB.b * X->RGB.b) >> 8; X->RGB.a = (Cacc.RGB.a * X->RGB.a) >> 8; } X++; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm comaprisons.xls Type: application/vnd.ms-excel Size: 102400 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091114/4e5aca94/attachment-0001.xls From j.prasanth.j at gmail.com Sat Nov 14 06:31:23 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Sat, 14 Nov 2009 18:01:23 +0530 Subject: [LLVMdev] Very slow performance of lli on x86 In-Reply-To: References: Message-ID: Hi all, I am trying to compare the performance of gcc , llvm-gcc , clang and lli(with JIT) on x86. i have attached the performance comparision spreadsheet as well as the source which i used for performing these test. i ran this code for 10000 iterations and the time of execution is as follows for -O3 results refer attachment. *time clang (-O0) llvm-gcc(-O0) gcc(-O0)* real 0m10.247s 0m11.324s 0m10.963s user 0m2.644s 0m2.478s 0m2.263s sys 0m5.949s 0m6.000s 0m5.953s * llvm-jit * i used clang-cc -O0 -emit-llvm-bc to emit llvm bytecode and then passed it to opt tool and then linked all bytecode files to single bytecode using llvm-ld, i used lli tool to run this single bytecode file and noticed the following output real 6m33.786s user 5m12.612s sys 1m1.205s why is lli taking such a loooong time to execute this particular piece of code.?? Thanks and Regards, Prasanth J -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091114/6a8b2241/attachment-0001.html -------------- next part -------------- #include //#include //#include //#include #define ACC_SIZE 1024 /* * Definitions */ typedef union { struct { unsigned short b; unsigned short g; unsigned short r; unsigned short a; } RGB; struct { unsigned short u; unsigned short v; unsigned short y; unsigned short a; } YUV; } GenefxAccumulator; extern void Xacc_blend_invsrccolor( int , GenefxAccumulator* , GenefxAccumulator , GenefxAccumulator* ); extern void Dacc_premultiply( int , GenefxAccumulator* ); GenefxAccumulator D[ACC_SIZE] = { { 0x0, 0x1, 0x2, 0x4 }, { 0x1, 0x2, 0x3, 0x5 }, { 0x2, 0x3, 0x4, 0x6 }, { 0x3, 0x4, 0x5, 0x7 }, { 0x4, 0x5, 0x6, 0x8 }, { 0x5, 0x6, 0x7, 0x9 }, { 0x6, 0x7, 0x8, 0xa }, { 0x7, 0x8, 0x9, 0xb }, { 0x8, 0x9, 0xa, 0xc }, { 0x9, 0xa, 0xb, 0xd }, { 0xa, 0xb, 0xc, 0xe }, { 0xb, 0xc, 0xd, 0xf }, { 0xc, 0xd, 0xe, 0x10 }, { 0xd, 0xe, 0xf, 0x11 }, { 0xe, 0xf, 0x10, 0x12 }, { 0xf, 0x10, 0x11, 0x13 }, { 0x10, 0x11, 0x12, 0x14 }, { 0x11, 0x12, 0x13, 0x15 }, { 0x12, 0x13, 0x14, 0x16 }, { 0x13, 0x14, 0x15, 0x17 }, { 0x14, 0x15, 0x16, 0x18 }, { 0x15, 0x16, 0x17, 0x19 }, { 0x16, 0x17, 0x18, 0x1a }, { 0x17, 0x18, 0x19, 0x1b }, { 0x18, 0x19, 0x1a, 0x1c }, { 0x19, 0x1a, 0x1b, 0x1d }, { 0x1a, 0x1b, 0x1c, 0x1e }, { 0x1b, 0x1c, 0x1d, 0x1f }, { 0x1c, 0x1d, 0x1e, 0x20 }, { 0x1d, 0x1e, 0x1f, 0x21 }, { 0x1e, 0x1f, 0x20, 0x22 }, { 0x1f, 0x20, 0x21, 0x23 }, { 0x20, 0x21, 0x22, 0x24 }, { 0x21, 0x22, 0x23, 0x25 }, { 0x22, 0x23, 0x24, 0x26 }, { 0x23, 0x24, 0x25, 0x27 }, { 0x24, 0x25, 0x26, 0x28 }, { 0x25, 0x26, 0x27, 0x29 }, { 0x26, 0x27, 0x28, 0x2a }, { 0x27, 0x28, 0x29, 0x2b }, { 0x28, 0x29, 0x2a, 0x2c }, { 0x29, 0x2a, 0x2b, 0x2d }, { 0x2a, 0x2b, 0x2c, 0x2e }, { 0x2b, 0x2c, 0x2d, 0x2f }, { 0x2c, 0x2d, 0x2e, 0x30 }, { 0x2d, 0x2e, 0x2f, 0x31 }, { 0x2e, 0x2f, 0x30, 0x32 }, { 0x2f, 0x30, 0x31, 0x33 }, { 0x30, 0x31, 0x32, 0x34 }, { 0x31, 0x32, 0x33, 0x35 }, { 0x32, 0x33, 0x34, 0x36 }, { 0x33, 0x34, 0x35, 0x37 }, { 0x34, 0x35, 0x36, 0x38 }, { 0x35, 0x36, 0x37, 0x39 }, { 0x36, 0x37, 0x38, 0x3a }, { 0x37, 0x38, 0x39, 0x3b }, { 0x38, 0x39, 0x3a, 0x3c }, { 0x39, 0x3a, 0x3b, 0x3d }, { 0x3a, 0x3b, 0x3c, 0x3e }, { 0x3b, 0x3c, 0x3d, 0x3f }, { 0x3c, 0x3d, 0x3e, 0x40 }, { 0x3d, 0x3e, 0x3f, 0x41 }, { 0x3e, 0x3f, 0x40, 0x42 }, { 0x3f, 0x40, 0x41, 0x43 }, { 0x40, 0x41, 0x42, 0x44 }, { 0x41, 0x42, 0x43, 0x45 }, { 0x42, 0x43, 0x44, 0x46 }, { 0x43, 0x44, 0x45, 0x47 }, { 0x44, 0x45, 0x46, 0x48 }, { 0x45, 0x46, 0x47, 0x49 }, { 0x46, 0x47, 0x48, 0x4a }, { 0x47, 0x48, 0x49, 0x4b }, { 0x48, 0x49, 0x4a, 0x4c }, { 0x49, 0x4a, 0x4b, 0x4d }, { 0x4a, 0x4b, 0x4c, 0x4e }, { 0x4b, 0x4c, 0x4d, 0x4f }, { 0x4c, 0x4d, 0x4e, 0x50 }, { 0x4d, 0x4e, 0x4f, 0x51 }, { 0x4e, 0x4f, 0x50, 0x52 }, { 0x4f, 0x50, 0x51, 0x53 }, { 0x50, 0x51, 0x52, 0x54 }, { 0x51, 0x52, 0x53, 0x55 }, { 0x52, 0x53, 0x54, 0x56 }, { 0x53, 0x54, 0x55, 0x57 }, { 0x54, 0x55, 0x56, 0x58 }, { 0x55, 0x56, 0x57, 0x59 }, { 0x56, 0x57, 0x58, 0x5a }, { 0x57, 0x58, 0x59, 0x5b }, { 0x58, 0x59, 0x5a, 0x5c }, { 0x59, 0x5a, 0x5b, 0x5d }, { 0x5a, 0x5b, 0x5c, 0x5e }, { 0x5b, 0x5c, 0x5d, 0x5f }, { 0x5c, 0x5d, 0x5e, 0x60 }, { 0x5d, 0x5e, 0x5f, 0x61 }, { 0x5e, 0x5f, 0x60, 0x62 }, { 0x5f, 0x60, 0x61, 0x63 }, { 0x60, 0x61, 0x62, 0x64 }, { 0x61, 0x62, 0x63, 0x65 }, { 0x62, 0x63, 0x64, 0x66 }, { 0x63, 0x64, 0x65, 0x67 }, { 0x64, 0x65, 0x66, 0x68 }, { 0x65, 0x66, 0x67, 0x69 }, { 0x66, 0x67, 0x68, 0x6a }, { 0x67, 0x68, 0x69, 0x6b }, { 0x68, 0x69, 0x6a, 0x6c }, { 0x69, 0x6a, 0x6b, 0x6d }, { 0x6a, 0x6b, 0x6c, 0x6e }, { 0x6b, 0x6c, 0x6d, 0x6f }, { 0x6c, 0x6d, 0x6e, 0x70 }, { 0x6d, 0x6e, 0x6f, 0x71 }, { 0x6e, 0x6f, 0x70, 0x72 }, { 0x6f, 0x70, 0x71, 0x73 }, { 0x70, 0x71, 0x72, 0x74 }, { 0x71, 0x72, 0x73, 0x75 }, { 0x72, 0x73, 0x74, 0x76 }, { 0x73, 0x74, 0x75, 0x77 }, { 0x74, 0x75, 0x76, 0x78 }, { 0x75, 0x76, 0x77, 0x79 }, { 0x76, 0x77, 0x78, 0x7a }, { 0x77, 0x78, 0x79, 0x7b }, { 0x78, 0x79, 0x7a, 0x7c }, { 0x79, 0x7a, 0x7b, 0x7d }, { 0x7a, 0x7b, 0x7c, 0x7e }, { 0x7b, 0x7c, 0x7d, 0x7f }, { 0x7c, 0x7d, 0x7e, 0x80 }, { 0x7d, 0x7e, 0x7f, 0x81 }, { 0x7e, 0x7f, 0x80, 0x82 }, { 0x7f, 0x80, 0x81, 0x83 }, { 0x80, 0x81, 0x82, 0x84 }, { 0x81, 0x82, 0x83, 0x85 }, { 0x82, 0x83, 0x84, 0x86 }, { 0x83, 0x84, 0x85, 0x87 }, { 0x84, 0x85, 0x86, 0x88 }, { 0x85, 0x86, 0x87, 0x89 }, { 0x86, 0x87, 0x88, 0x8a }, { 0x87, 0x88, 0x89, 0x8b }, { 0x88, 0x89, 0x8a, 0x8c }, { 0x89, 0x8a, 0x8b, 0x8d }, { 0x8a, 0x8b, 0x8c, 0x8e }, { 0x8b, 0x8c, 0x8d, 0x8f }, { 0x8c, 0x8d, 0x8e, 0x90 }, { 0x8d, 0x8e, 0x8f, 0x91 }, { 0x8e, 0x8f, 0x90, 0x92 }, { 0x8f, 0x90, 0x91, 0x93 }, { 0x90, 0x91, 0x92, 0x94 }, { 0x91, 0x92, 0x93, 0x95 }, { 0x92, 0x93, 0x94, 0x96 }, { 0x93, 0x94, 0x95, 0x97 }, { 0x94, 0x95, 0x96, 0x98 }, { 0x95, 0x96, 0x97, 0x99 }, { 0x96, 0x97, 0x98, 0x9a }, { 0x97, 0x98, 0x99, 0x9b }, { 0x98, 0x99, 0x9a, 0x9c }, { 0x99, 0x9a, 0x9b, 0x9d }, { 0x9a, 0x9b, 0x9c, 0x9e }, { 0x9b, 0x9c, 0x9d, 0x9f }, { 0x9c, 0x9d, 0x9e, 0xa0 }, { 0x9d, 0x9e, 0x9f, 0xa1 }, { 0x9e, 0x9f, 0xa0, 0xa2 }, { 0x9f, 0xa0, 0xa1, 0xa3 }, { 0xa0, 0xa1, 0xa2, 0xa4 }, { 0xa1, 0xa2, 0xa3, 0xa5 }, { 0xa2, 0xa3, 0xa4, 0xa6 }, { 0xa3, 0xa4, 0xa5, 0xa7 }, { 0xa4, 0xa5, 0xa6, 0xa8 }, { 0xa5, 0xa6, 0xa7, 0xa9 }, { 0xa6, 0xa7, 0xa8, 0xaa }, { 0xa7, 0xa8, 0xa9, 0xab }, { 0xa8, 0xa9, 0xaa, 0xac }, { 0xa9, 0xaa, 0xab, 0xad }, { 0xaa, 0xab, 0xac, 0xae }, { 0xab, 0xac, 0xad, 0xaf }, { 0xac, 0xad, 0xae, 0xb0 }, { 0xad, 0xae, 0xaf, 0xb1 }, { 0xae, 0xaf, 0xb0, 0xb2 }, { 0xaf, 0xb0, 0xb1, 0xb3 }, { 0xb0, 0xb1, 0xb2, 0xb4 }, { 0xb1, 0xb2, 0xb3, 0xb5 }, { 0xb2, 0xb3, 0xb4, 0xb6 }, { 0xb3, 0xb4, 0xb5, 0xb7 }, { 0xb4, 0xb5, 0xb6, 0xb8 }, { 0xb5, 0xb6, 0xb7, 0xb9 }, { 0xb6, 0xb7, 0xb8, 0xba }, { 0xb7, 0xb8, 0xb9, 0xbb }, { 0xb8, 0xb9, 0xba, 0xbc }, { 0xb9, 0xba, 0xbb, 0xbd }, { 0xba, 0xbb, 0xbc, 0xbe }, { 0xbb, 0xbc, 0xbd, 0xbf }, { 0xbc, 0xbd, 0xbe, 0xc0 }, { 0xbd, 0xbe, 0xbf, 0xc1 }, { 0xbe, 0xbf, 0xc0, 0xc2 }, { 0xbf, 0xc0, 0xc1, 0xc3 }, { 0xc0, 0xc1, 0xc2, 0xc4 }, { 0xc1, 0xc2, 0xc3, 0xc5 }, { 0xc2, 0xc3, 0xc4, 0xc6 }, { 0xc3, 0xc4, 0xc5, 0xc7 }, { 0xc4, 0xc5, 0xc6, 0xc8 }, { 0xc5, 0xc6, 0xc7, 0xc9 }, { 0xc6, 0xc7, 0xc8, 0xca }, { 0xc7, 0xc8, 0xc9, 0xcb }, { 0xc8, 0xc9, 0xca, 0xcc }, { 0xc9, 0xca, 0xcb, 0xcd }, { 0xca, 0xcb, 0xcc, 0xce }, { 0xcb, 0xcc, 0xcd, 0xcf }, { 0xcc, 0xcd, 0xce, 0xd0 }, { 0xcd, 0xce, 0xcf, 0xd1 }, { 0xce, 0xcf, 0xd0, 0xd2 }, { 0xcf, 0xd0, 0xd1, 0xd3 }, { 0xd0, 0xd1, 0xd2, 0xd4 }, { 0xd1, 0xd2, 0xd3, 0xd5 }, { 0xd2, 0xd3, 0xd4, 0xd6 }, { 0xd3, 0xd4, 0xd5, 0xd7 }, { 0xd4, 0xd5, 0xd6, 0xd8 }, { 0xd5, 0xd6, 0xd7, 0xd9 }, { 0xd6, 0xd7, 0xd8, 0xda }, { 0xd7, 0xd8, 0xd9, 0xdb }, { 0xd8, 0xd9, 0xda, 0xdc }, { 0xd9, 0xda, 0xdb, 0xdd }, { 0xda, 0xdb, 0xdc, 0xde }, { 0xdb, 0xdc, 0xdd, 0xdf }, { 0xdc, 0xdd, 0xde, 0xe0 }, { 0xdd, 0xde, 0xdf, 0xe1 }, { 0xde, 0xdf, 0xe0, 0xe2 }, { 0xdf, 0xe0, 0xe1, 0xe3 }, { 0xe0, 0xe1, 0xe2, 0xe4 }, { 0xe1, 0xe2, 0xe3, 0xe5 }, { 0xe2, 0xe3, 0xe4, 0xe6 }, { 0xe3, 0xe4, 0xe5, 0xe7 }, { 0xe4, 0xe5, 0xe6, 0xe8 }, { 0xe5, 0xe6, 0xe7, 0xe9 }, { 0xe6, 0xe7, 0xe8, 0xea }, { 0xe7, 0xe8, 0xe9, 0xeb }, { 0xe8, 0xe9, 0xea, 0xec }, { 0xe9, 0xea, 0xeb, 0xed }, { 0xea, 0xeb, 0xec, 0xee }, { 0xeb, 0xec, 0xed, 0xef }, { 0xec, 0xed, 0xee, 0xf0 }, { 0xed, 0xee, 0xef, 0xf1 }, { 0xee, 0xef, 0xf0, 0xf2 }, { 0xef, 0xf0, 0xf1, 0xf3 }, { 0xf0, 0xf1, 0xf2, 0xf4 }, { 0xf1, 0xf2, 0xf3, 0xf5 }, { 0xf2, 0xf3, 0xf4, 0xf6 }, { 0xf3, 0xf4, 0xf5, 0xf7 }, { 0xf4, 0xf5, 0xf6, 0xf8 }, { 0xf5, 0xf6, 0xf7, 0xf9 }, { 0xf6, 0xf7, 0xf8, 0xfa }, { 0xf7, 0xf8, 0xf9, 0xfb }, { 0xf8, 0xf9, 0xfa, 0xfc }, { 0xf9, 0xfa, 0xfb, 0xfd }, { 0xfa, 0xfb, 0xfc, 0xfe }, { 0xfb, 0xfc, 0xfd, 0xff }, { 0xfc, 0xfd, 0xfe, 0x00 }, { 0xfd, 0xfe, 0xff, 0x01 }, { 0xfe, 0xff, 0x00, 0x02 }, { 0xff, 0x00, 0x01, 0x03 }, { 0x10, 0x11, 0x02, 0x10 }, { 0x10, 0x12, 0x03, 0x10 }, { 0x10, 0x13, 0x04, 0x10 }, { 0x10, 0x14, 0x05, 0x10 }, { 0x10, 0x15, 0x06, 0x10 }, { 0x10, 0x16, 0x07, 0x10 }, { 0x10, 0x17, 0x08, 0x10 }, { 0x10, 0x18, 0x09, 0x10 }, { 0x10, 0x19, 0x0a, 0x10 }, { 0x10, 0x1a, 0x0b, 0x10 }, { 0x10, 0x1b, 0x0c, 0x10 }, { 0x10, 0x1c, 0x0d, 0x10 }, { 0x10, 0x1d, 0x0e, 0x11 }, { 0x10, 0x1e, 0x0f, 0x11 }, { 0x10, 0x1f, 0x10, 0x11 }, { 0x10, 0x10, 0x11, 0x11 }, { 0x11, 0x11, 0x12, 0x11 }, { 0x11, 0x12, 0x13, 0x11 }, { 0x11, 0x13, 0x14, 0x11 }, { 0x11, 0x14, 0x15, 0x11 }, { 0x11, 0x15, 0x16, 0x11 }, { 0x11, 0x16, 0x17, 0x11 }, { 0x11, 0x17, 0x18, 0x11 }, { 0x11, 0x18, 0x19, 0x11 }, { 0x11, 0x19, 0x1a, 0x11 }, { 0x11, 0x1a, 0x1b, 0x11 }, { 0x11, 0x1b, 0x1c, 0x11 }, { 0x11, 0x1c, 0x1d, 0x11 }, { 0x11, 0x1d, 0x1e, 0x12 }, { 0x11, 0x1e, 0x1f, 0x12 }, { 0x11, 0x1f, 0x20, 0x12 }, { 0x11, 0x10, 0x21, 0x12 }, { 0x12, 0x11, 0x22, 0x12 }, { 0x12, 0x12, 0x23, 0x12 }, { 0x12, 0x13, 0x24, 0x12 }, { 0x12, 0x14, 0x25, 0x12 }, { 0x12, 0x15, 0x26, 0x12 }, { 0x12, 0x16, 0x27, 0x12 }, { 0x12, 0x17, 0x28, 0x12 }, { 0x12, 0x18, 0x29, 0x12 }, { 0x12, 0x19, 0x2a, 0x12 }, { 0x12, 0x1a, 0x2b, 0x12 }, { 0x12, 0x1b, 0x2c, 0x12 }, { 0x12, 0x1c, 0x2d, 0x12 }, { 0x12, 0x1d, 0x2e, 0x13 }, { 0x12, 0x1e, 0x2f, 0x13 }, { 0x12, 0x1f, 0x30, 0x13 }, { 0x12, 0x10, 0x31, 0x13 }, { 0x13, 0x11, 0x32, 0x13 }, { 0x13, 0x12, 0x33, 0x13 }, { 0x13, 0x13, 0x34, 0x13 }, { 0x13, 0x14, 0x35, 0x13 }, { 0x13, 0x15, 0x36, 0x13 }, { 0x13, 0x16, 0x37, 0x13 }, { 0x13, 0x17, 0x38, 0x13 }, { 0x13, 0x18, 0x39, 0x13 }, { 0x13, 0x19, 0x3a, 0x13 }, { 0x13, 0x1a, 0x3b, 0x13 }, { 0x13, 0x1b, 0x3c, 0x13 }, { 0x13, 0x1c, 0x3d, 0x13 }, { 0x13, 0x1d, 0x3e, 0x14 }, { 0x13, 0x1e, 0x3f, 0x14 }, { 0x13, 0x1f, 0x40, 0x14 }, { 0x13, 0x10, 0x41, 0x14 }, { 0x14, 0x11, 0x42, 0x14 }, { 0x14, 0x12, 0x43, 0x14 }, { 0x14, 0x13, 0x44, 0x14 }, { 0x14, 0x14, 0x45, 0x14 }, { 0x14, 0x15, 0x46, 0x14 }, { 0x14, 0x16, 0x47, 0x14 }, { 0x14, 0x17, 0x48, 0x14 }, { 0x14, 0x18, 0x49, 0x14 }, { 0x14, 0x19, 0x4a, 0x14 }, { 0x14, 0x1a, 0x4b, 0x14 }, { 0x14, 0x1b, 0x4c, 0x14 }, { 0x14, 0x1c, 0x4d, 0x14 }, { 0x14, 0x1d, 0x4e, 0x15 }, { 0x14, 0x1e, 0x4f, 0x15 }, { 0x14, 0x1f, 0x50, 0x15 }, { 0x14, 0x10, 0x51, 0x15 }, { 0x15, 0x11, 0x52, 0x15 }, { 0x15, 0x12, 0x53, 0x15 }, { 0x15, 0x13, 0x54, 0x15 }, { 0x15, 0x14, 0x55, 0x15 }, { 0x15, 0x15, 0x56, 0x15 }, { 0x15, 0x16, 0x57, 0x15 }, { 0x15, 0x17, 0x58, 0x15 }, { 0x15, 0x18, 0x59, 0x15 }, { 0x15, 0x19, 0x5a, 0x15 }, { 0x15, 0x1a, 0x5b, 0x15 }, { 0x15, 0x1b, 0x5c, 0x15 }, { 0x15, 0x1c, 0x5d, 0x15 }, { 0x15, 0x1d, 0x5e, 0x16 }, { 0x15, 0x1e, 0x5f, 0x16 }, { 0x15, 0x1f, 0x60, 0x16 }, { 0x15, 0x10, 0x61, 0x16 }, { 0x16, 0x11, 0x62, 0x16 }, { 0x16, 0x12, 0x63, 0x16 }, { 0x16, 0x13, 0x64, 0x16 }, { 0x16, 0x14, 0x65, 0x16 }, { 0x16, 0x15, 0x66, 0x16 }, { 0x16, 0x16, 0x67, 0x16 }, { 0x16, 0x17, 0x68, 0x16 }, { 0x16, 0x18, 0x69, 0x16 }, { 0x16, 0x19, 0x6a, 0x16 }, { 0x16, 0x1a, 0x6b, 0x16 }, { 0x16, 0x1b, 0x6c, 0x16 }, { 0x16, 0x1c, 0x6d, 0x16 }, { 0x16, 0x1d, 0x6e, 0x17 }, { 0x16, 0x1e, 0x6f, 0x17 }, { 0x16, 0x1f, 0x70, 0x17 }, { 0x16, 0x10, 0x71, 0x17 }, { 0x17, 0x11, 0x72, 0x17 }, { 0x17, 0x12, 0x73, 0x17 }, { 0x17, 0x13, 0x74, 0x17 }, { 0x17, 0x14, 0x75, 0x17 }, { 0x17, 0x15, 0x76, 0x17 }, { 0x17, 0x16, 0x77, 0x17 }, { 0x17, 0x17, 0x78, 0x17 }, { 0x17, 0x18, 0x79, 0x17 }, { 0x17, 0x19, 0x7a, 0x17 }, { 0x17, 0x1a, 0x7b, 0x17 }, { 0x17, 0x1b, 0x7c, 0x17 }, { 0x17, 0x1c, 0x7d, 0x17 }, { 0x17, 0x1d, 0x7e, 0x18 }, { 0x17, 0x1e, 0x7f, 0x18 }, { 0x17, 0x1f, 0x80, 0x18 }, { 0x17, 0x10, 0x81, 0x18 }, { 0x18, 0x11, 0x82, 0x18 }, { 0x18, 0x12, 0x83, 0x18 }, { 0x18, 0x13, 0x84, 0x18 }, { 0x18, 0x14, 0x85, 0x18 }, { 0x18, 0x15, 0x86, 0x18 }, { 0x18, 0x16, 0x87, 0x18 }, { 0x18, 0x17, 0x88, 0x18 }, { 0x18, 0x18, 0x89, 0x18 }, { 0x18, 0x19, 0x8a, 0x18 }, { 0x18, 0x1a, 0x8b, 0x18 }, { 0x18, 0x1b, 0x8c, 0x18 }, { 0x18, 0x1c, 0x8d, 0x18 }, { 0x18, 0x1d, 0x8e, 0x19 }, { 0x18, 0x1e, 0x8f, 0x19 }, { 0x18, 0x1f, 0x90, 0x19 }, { 0x18, 0x10, 0x91, 0x19 }, { 0x19, 0x11, 0x92, 0x19 }, { 0x19, 0x12, 0x93, 0x19 }, { 0x19, 0x13, 0x94, 0x19 }, { 0x19, 0x14, 0x95, 0x19 }, { 0x19, 0x15, 0x96, 0x19 }, { 0x19, 0x16, 0x97, 0x19 }, { 0x19, 0x17, 0x98, 0x19 }, { 0x19, 0x18, 0x99, 0x19 }, { 0x19, 0x19, 0x9a, 0x19 }, { 0x19, 0x1a, 0x9b, 0x19 }, { 0x19, 0x1b, 0x9c, 0x19 }, { 0x19, 0x1c, 0x9d, 0x19 }, { 0x19, 0x1d, 0x9e, 0x1a }, { 0x19, 0x1e, 0x9f, 0x1a }, { 0x19, 0x1f, 0xa0, 0x1a }, { 0x19, 0x10, 0xa1, 0x1a }, { 0x1a, 0x11, 0xa2, 0x1a }, { 0x1a, 0x12, 0xa3, 0x1a }, { 0x1a, 0x13, 0xa4, 0x1a }, { 0x1a, 0x14, 0xa5, 0x1a }, { 0x1a, 0x15, 0xa6, 0x1a }, { 0x1a, 0x16, 0xa7, 0x1a }, { 0x1a, 0x17, 0xa8, 0x1a }, { 0x1a, 0x18, 0xa9, 0x1a }, { 0x1a, 0x19, 0xaa, 0x1a }, { 0x1a, 0x1a, 0xab, 0x1a }, { 0x1a, 0x1b, 0xac, 0x1a }, { 0x1a, 0x1c, 0xad, 0x1a }, { 0x1a, 0x1d, 0xae, 0x1b }, { 0x1a, 0x1e, 0xaf, 0x1b }, { 0x1a, 0x1f, 0xb0, 0x1b }, { 0x1a, 0x10, 0xb1, 0x1b }, { 0x1b, 0x11, 0xb2, 0x1b }, { 0x1b, 0x12, 0xb3, 0x1b }, { 0x1b, 0x13, 0xb4, 0x1b }, { 0x1b, 0x14, 0xb5, 0x1b }, { 0x1b, 0x15, 0xb6, 0x1b }, { 0x1b, 0x16, 0xb7, 0x1b }, { 0x1b, 0x17, 0xb8, 0x1b }, { 0x1b, 0x18, 0xb9, 0x1b }, { 0x1b, 0x19, 0xba, 0x1b }, { 0x1b, 0x1a, 0xbb, 0x1b }, { 0x1b, 0x1b, 0xbc, 0x1b }, { 0x1b, 0x1c, 0xbd, 0x1b }, { 0x1b, 0x1d, 0xbe, 0x1c }, { 0x1b, 0x1e, 0xbf, 0x1c }, { 0x1b, 0x1f, 0xc0, 0x1c }, { 0x1b, 0x10, 0xc1, 0x1c }, { 0x1c, 0x11, 0xc2, 0x1c }, { 0x1c, 0x12, 0xc3, 0x1c }, { 0x1c, 0x13, 0xc4, 0x1c }, { 0x1c, 0x14, 0xc5, 0x1c }, { 0x1c, 0x15, 0xc6, 0x1c }, { 0x1c, 0x16, 0xc7, 0x1c }, { 0x1c, 0x17, 0xc8, 0x1c }, { 0x1c, 0x18, 0xc9, 0x1c }, { 0x1c, 0x19, 0xca, 0x1c }, { 0x1c, 0x1a, 0xcb, 0x1c }, { 0x1c, 0x1b, 0xcc, 0x1c }, { 0x1c, 0x1c, 0xcd, 0x1c }, { 0x1c, 0x1d, 0xce, 0x1d }, { 0x1c, 0x1e, 0xcf, 0x1d }, { 0x1c, 0x1f, 0xd0, 0x1d }, { 0x1c, 0x10, 0xd1, 0x1d }, { 0x1d, 0x11, 0xd2, 0x1d }, { 0x1d, 0x12, 0xd3, 0x1d }, { 0x1d, 0x13, 0xd4, 0x1d }, { 0x1d, 0x14, 0xd5, 0x1d }, { 0x1d, 0x15, 0xd6, 0x1d }, { 0x1d, 0x16, 0xd7, 0x1d }, { 0x1d, 0x17, 0xd8, 0x1d }, { 0x1d, 0x18, 0xd9, 0x1d }, { 0x1d, 0x19, 0xda, 0x1d }, { 0x1d, 0x1a, 0xdb, 0x1d }, { 0x1d, 0x1b, 0xdc, 0x1d }, { 0x1d, 0x1c, 0xdd, 0x1d }, { 0x1d, 0x1d, 0xde, 0x1e }, { 0x1d, 0x1e, 0xdf, 0x1e }, { 0x1d, 0x1f, 0xe0, 0x1e }, { 0x1d, 0x10, 0xe1, 0x1e }, { 0x1e, 0x11, 0xe2, 0x1e }, { 0x1e, 0x12, 0xe3, 0x1e }, { 0x1e, 0x13, 0xe4, 0x1e }, { 0x1e, 0x14, 0xe5, 0x1e }, { 0x1e, 0x15, 0xe6, 0x1e }, { 0x1e, 0x16, 0xe7, 0x1e }, { 0x1e, 0x17, 0xe8, 0x1e }, { 0x1e, 0x18, 0xe9, 0x1e }, { 0x1e, 0x19, 0xea, 0x1e }, { 0x1e, 0x1a, 0xeb, 0x1e }, { 0x1e, 0x1b, 0xec, 0x1e }, { 0x1e, 0x1c, 0xed, 0x1e }, { 0x1e, 0x1d, 0xee, 0x1f }, { 0x1e, 0x1e, 0xef, 0x1f }, { 0x1e, 0x1f, 0xf0, 0x1f }, { 0x1e, 0x10, 0xf1, 0x1f }, { 0x1f, 0x11, 0xf2, 0x1f }, { 0x1f, 0x12, 0xf3, 0x1f }, { 0x1f, 0x13, 0xf4, 0x1f }, { 0x1f, 0x14, 0xf5, 0x1f }, { 0x1f, 0x15, 0xf6, 0x1f }, { 0x1f, 0x16, 0xf7, 0x1f }, { 0x1f, 0x17, 0xf8, 0x1f }, { 0x1f, 0x18, 0xf9, 0x1f }, { 0x1f, 0x19, 0xfa, 0x1f }, { 0x1f, 0x1a, 0xfb, 0x1f }, { 0x1f, 0x1b, 0xfc, 0x1f }, { 0x1f, 0x1c, 0xfd, 0x1f }, { 0x1f, 0x1d, 0xfe, 0x20 }, { 0x1f, 0x1e, 0xff, 0x20 }, { 0x1f, 0x1f, 0x00, 0x20 }, { 0x1f, 0x20, 0x01, 0x20 }, { 0x20, 0x21, 0x02, 0x20 }, { 0x20, 0x22, 0x03, 0x20 }, { 0x20, 0x23, 0x04, 0x20 }, { 0x20, 0x24, 0x05, 0x20 }, { 0x20, 0x25, 0x06, 0x20 }, { 0x20, 0x26, 0x07, 0x20 }, { 0x20, 0x27, 0x08, 0x20 }, { 0x20, 0x28, 0x09, 0x20 }, { 0x20, 0x29, 0x0a, 0x20 }, { 0x20, 0x2a, 0x0b, 0x20 }, { 0x20, 0x2b, 0x0c, 0x20 }, { 0x20, 0x2c, 0x0d, 0x20 }, { 0x20, 0x2d, 0x0e, 0x21 }, { 0x20, 0x2e, 0x0f, 0x21 }, { 0x20, 0x2f, 0x10, 0x21 }, { 0x20, 0x20, 0x11, 0x21 }, { 0x21, 0x21, 0x12, 0x21 }, { 0x21, 0x22, 0x13, 0x21 }, { 0x21, 0x23, 0x14, 0x21 }, { 0x21, 0x24, 0x15, 0x21 }, { 0x21, 0x25, 0x16, 0x21 }, { 0x21, 0x26, 0x17, 0x21 }, { 0x21, 0x27, 0x18, 0x21 }, { 0x21, 0x28, 0x19, 0x21 }, { 0x21, 0x29, 0x1a, 0x21 }, { 0x21, 0x2a, 0x1b, 0x21 }, { 0x21, 0x2b, 0x1c, 0x21 }, { 0x21, 0x2c, 0x1d, 0x21 }, { 0x21, 0x2d, 0x1e, 0x22 }, { 0x21, 0x2e, 0x1f, 0x22 }, { 0x21, 0x2f, 0x20, 0x22 }, { 0x21, 0x20, 0x21, 0x22 }, { 0x22, 0x21, 0x22, 0x22 }, { 0x22, 0x22, 0x23, 0x22 }, { 0x22, 0x23, 0x24, 0x22 }, { 0x22, 0x24, 0x25, 0x22 }, { 0x22, 0x25, 0x26, 0x22 }, { 0x22, 0x26, 0x27, 0x22 }, { 0x22, 0x27, 0x28, 0x22 }, { 0x22, 0x28, 0x29, 0x22 }, { 0x22, 0x29, 0x2a, 0x22 }, { 0x22, 0x2a, 0x2b, 0x22 }, { 0x22, 0x2b, 0x2c, 0x22 }, { 0x22, 0x2c, 0x2d, 0x22 }, { 0x22, 0x2d, 0x2e, 0x23 }, { 0x22, 0x2e, 0x2f, 0x23 }, { 0x22, 0x2f, 0x30, 0x23 }, { 0x22, 0x20, 0x31, 0x23 }, { 0x23, 0x21, 0x32, 0x23 }, { 0x23, 0x22, 0x33, 0x23 }, { 0x23, 0x23, 0x34, 0x23 }, { 0x23, 0x24, 0x35, 0x23 }, { 0x23, 0x25, 0x36, 0x23 }, { 0x23, 0x26, 0x37, 0x23 }, { 0x23, 0x27, 0x38, 0x23 }, { 0x23, 0x28, 0x39, 0x23 }, { 0x23, 0x29, 0x3a, 0x23 }, { 0x23, 0x2a, 0x3b, 0x23 }, { 0x23, 0x2b, 0x3c, 0x23 }, { 0x23, 0x2c, 0x3d, 0x23 }, { 0x23, 0x2d, 0x3e, 0x24 }, { 0x23, 0x2e, 0x3f, 0x24 }, { 0x23, 0x2f, 0x40, 0x24 }, { 0x23, 0x20, 0x41, 0x24 }, { 0x24, 0x21, 0x42, 0x24 }, { 0x24, 0x22, 0x43, 0x24 }, { 0x24, 0x23, 0x44, 0x24 }, { 0x24, 0x24, 0x45, 0x24 }, { 0x24, 0x25, 0x46, 0x24 }, { 0x24, 0x26, 0x47, 0x24 }, { 0x24, 0x27, 0x48, 0x24 }, { 0x24, 0x28, 0x49, 0x24 }, { 0x24, 0x29, 0x4a, 0x24 }, { 0x24, 0x2a, 0x4b, 0x24 }, { 0x24, 0x2b, 0x4c, 0x24 }, { 0x24, 0x2c, 0x4d, 0x24 }, { 0x24, 0x2d, 0x4e, 0x25 }, { 0x24, 0x2e, 0x4f, 0x25 }, { 0x24, 0x2f, 0x50, 0x25 }, { 0x24, 0x20, 0x51, 0x25 }, { 0x25, 0x21, 0x52, 0x25 }, { 0x25, 0x22, 0x53, 0x25 }, { 0x25, 0x23, 0x54, 0x25 }, { 0x25, 0x24, 0x55, 0x25 }, { 0x25, 0x25, 0x56, 0x25 }, { 0x25, 0x26, 0x57, 0x25 }, { 0x25, 0x27, 0x58, 0x25 }, { 0x25, 0x28, 0x59, 0x25 }, { 0x25, 0x29, 0x5a, 0x25 }, { 0x25, 0x2a, 0x5b, 0x25 }, { 0x25, 0x2b, 0x5c, 0x25 }, { 0x25, 0x2c, 0x5d, 0x25 }, { 0x25, 0x2d, 0x5e, 0x26 }, { 0x25, 0x2e, 0x5f, 0x26 }, { 0x25, 0x2f, 0x60, 0x26 }, { 0x25, 0x20, 0x61, 0x26 }, { 0x26, 0x21, 0x62, 0x26 }, { 0x26, 0x22, 0x63, 0x26 }, { 0x26, 0x23, 0x64, 0x26 }, { 0x26, 0x24, 0x65, 0x26 }, { 0x26, 0x25, 0x66, 0x26 }, { 0x26, 0x26, 0x67, 0x26 }, { 0x26, 0x27, 0x68, 0x26 }, { 0x26, 0x28, 0x69, 0x26 }, { 0x26, 0x29, 0x6a, 0x26 }, { 0x26, 0x2a, 0x6b, 0x26 }, { 0x26, 0x2b, 0x6c, 0x26 }, { 0x26, 0x2c, 0x6d, 0x26 }, { 0x26, 0x2d, 0x6e, 0x27 }, { 0x26, 0x2e, 0x6f, 0x27 }, { 0x26, 0x2f, 0x70, 0x27 }, { 0x26, 0x20, 0x71, 0x27 }, { 0x27, 0x21, 0x72, 0x27 }, { 0x27, 0x22, 0x73, 0x27 }, { 0x27, 0x23, 0x74, 0x27 }, { 0x27, 0x24, 0x75, 0x27 }, { 0x27, 0x25, 0x76, 0x27 }, { 0x27, 0x26, 0x77, 0x27 }, { 0x27, 0x27, 0x78, 0x27 }, { 0x27, 0x28, 0x79, 0x27 }, { 0x27, 0x29, 0x7a, 0x27 }, { 0x27, 0x2a, 0x7b, 0x27 }, { 0x27, 0x2b, 0x7c, 0x27 }, { 0x27, 0x2c, 0x7d, 0x27 }, { 0x27, 0x2d, 0x7e, 0x28 }, { 0x27, 0x2e, 0x7f, 0x28 }, { 0x27, 0x2f, 0x80, 0x28 }, { 0x27, 0x20, 0x81, 0x28 }, { 0x28, 0x21, 0x82, 0x28 }, { 0x28, 0x22, 0x83, 0x28 }, { 0x28, 0x23, 0x84, 0x28 }, { 0x28, 0x24, 0x85, 0x28 }, { 0x28, 0x25, 0x86, 0x28 }, { 0x28, 0x26, 0x87, 0x28 }, { 0x28, 0x27, 0x88, 0x28 }, { 0x28, 0x28, 0x89, 0x28 }, { 0x28, 0x29, 0x8a, 0x28 }, { 0x28, 0x2a, 0x8b, 0x28 }, { 0x28, 0x2b, 0x8c, 0x28 }, { 0x28, 0x2c, 0x8d, 0x28 }, { 0x28, 0x2d, 0x8e, 0x29 }, { 0x28, 0x2e, 0x8f, 0x29 }, { 0x28, 0x2f, 0x90, 0x29 }, { 0x28, 0x20, 0x91, 0x29 }, { 0x29, 0x21, 0x92, 0x29 }, { 0x29, 0x22, 0x93, 0x29 }, { 0x29, 0x23, 0x94, 0x29 }, { 0x29, 0x24, 0x95, 0x29 }, { 0x29, 0x25, 0x96, 0x29 }, { 0x29, 0x26, 0x97, 0x29 }, { 0x29, 0x27, 0x98, 0x29 }, { 0x29, 0x28, 0x99, 0x29 }, { 0x29, 0x29, 0x9a, 0x29 }, { 0x29, 0x2a, 0x9b, 0x29 }, { 0x29, 0x2b, 0x9c, 0x29 }, { 0x29, 0x2c, 0x9d, 0x29 }, { 0x29, 0x2d, 0x9e, 0x2a }, { 0x29, 0x2e, 0x9f, 0x2a }, { 0x29, 0x2f, 0xa0, 0x2a }, { 0x29, 0x20, 0xa1, 0x2a }, { 0x2a, 0x21, 0xa2, 0x2a }, { 0x2a, 0x22, 0xa3, 0x2a }, { 0x2a, 0x23, 0xa4, 0x2a }, { 0x2a, 0x24, 0xa5, 0x2a }, { 0x2a, 0x25, 0xa6, 0x2a }, { 0x2a, 0x26, 0xa7, 0x2a }, { 0x2a, 0x27, 0xa8, 0x2a }, { 0x2a, 0x28, 0xa9, 0x2a }, { 0x2a, 0x29, 0xaa, 0x2a }, { 0x2a, 0x2a, 0xab, 0x2a }, { 0x2a, 0x2b, 0xac, 0x2a }, { 0x2a, 0x2c, 0xad, 0x2a }, { 0x2a, 0x2d, 0xae, 0x2b }, { 0x2a, 0x2e, 0xaf, 0x2b }, { 0x2a, 0x2f, 0xb0, 0x2b }, { 0x2a, 0x20, 0xb1, 0x2b }, { 0x2b, 0x21, 0xb2, 0x2b }, { 0x2b, 0x22, 0xb3, 0x2b }, { 0x2b, 0x23, 0xb4, 0x2b }, { 0x2b, 0x24, 0xb5, 0x2b }, { 0x2b, 0x25, 0xb6, 0x2b }, { 0x2b, 0x26, 0xb7, 0x2b }, { 0x2b, 0x27, 0xb8, 0x2b }, { 0x2b, 0x28, 0xb9, 0x2b }, { 0x2b, 0x29, 0xba, 0x2b }, { 0x2b, 0x2a, 0xbb, 0x2b }, { 0x2b, 0x2b, 0xbc, 0x2b }, { 0x2b, 0x2c, 0xbd, 0x2b }, { 0x2b, 0x2d, 0xbe, 0x2c }, { 0x2b, 0x2e, 0xbf, 0x2c }, { 0x2b, 0x2f, 0xc0, 0x2c }, { 0x2b, 0x20, 0xc1, 0x2c }, { 0x2c, 0x21, 0xc2, 0x2c }, { 0x2c, 0x22, 0xc3, 0x2c }, { 0x2c, 0x23, 0xc4, 0x2c }, { 0x2c, 0x24, 0xc5, 0x2c }, { 0x2c, 0x25, 0xc6, 0x2c }, { 0x2c, 0x26, 0xc7, 0x2c }, { 0x2c, 0x27, 0xc8, 0x2c }, { 0x2c, 0x28, 0xc9, 0x2c }, { 0x2c, 0x29, 0xca, 0x2c }, { 0x2c, 0x2a, 0xcb, 0x2c }, { 0x2c, 0x2b, 0xcc, 0x2c }, { 0x2c, 0x2c, 0xcd, 0x2c }, { 0x2c, 0x2d, 0xce, 0x2d }, { 0x2c, 0x2e, 0xcf, 0x2d }, { 0x2c, 0x2f, 0xd0, 0x2d }, { 0x2c, 0x20, 0xd1, 0x2d }, { 0x2d, 0x21, 0xd2, 0x2d }, { 0x2d, 0x22, 0xd3, 0x2d }, { 0x2d, 0x23, 0xd4, 0x2d }, { 0x2d, 0x24, 0xd5, 0x2d }, { 0x2d, 0x25, 0xd6, 0x2d }, { 0x2d, 0x26, 0xd7, 0x2d }, { 0x2d, 0x27, 0xd8, 0x2d }, { 0x2d, 0x28, 0xd9, 0x2d }, { 0x2d, 0x29, 0xda, 0x2d }, { 0x2d, 0x2a, 0xdb, 0x2d }, { 0x2d, 0x2b, 0xdc, 0x2d }, { 0x2d, 0x2c, 0xdd, 0x2d }, { 0x2d, 0x2d, 0xde, 0x2e }, { 0x2d, 0x2e, 0xdf, 0x2e }, { 0x2d, 0x2f, 0xe0, 0x2e }, { 0x2d, 0x20, 0xe1, 0x2e }, { 0x2e, 0x21, 0xe2, 0x2e }, { 0x2e, 0x22, 0xe3, 0x2e }, { 0x2e, 0x23, 0xe4, 0x2e }, { 0x2e, 0x24, 0xe5, 0x2e }, { 0x2e, 0x25, 0xe6, 0x2e }, { 0x2e, 0x26, 0xe7, 0x2e }, { 0x2e, 0x27, 0xe8, 0x2e }, { 0x2e, 0x28, 0xe9, 0x2e }, { 0x2e, 0x29, 0xea, 0x2e }, { 0x2e, 0x2a, 0xeb, 0x2e }, { 0x2e, 0x2b, 0xec, 0x2e }, { 0x2e, 0x2c, 0xed, 0x2e }, { 0x2e, 0x2d, 0xee, 0x2f }, { 0x2e, 0x2e, 0xef, 0x2f }, { 0x2e, 0x2f, 0xf0, 0x2f }, { 0x2e, 0x20, 0xf1, 0x2f }, { 0x2f, 0x21, 0xf2, 0x2f }, { 0x2f, 0x22, 0xf3, 0x2f }, { 0x2f, 0x23, 0xf4, 0x2f }, { 0x2f, 0x24, 0xf5, 0x2f }, { 0x2f, 0x25, 0xf6, 0x2f }, { 0x2f, 0x26, 0xf7, 0x2f }, { 0x2f, 0x27, 0xf8, 0x2f }, { 0x2f, 0x28, 0xf9, 0x2f }, { 0x2f, 0x29, 0xfa, 0x2f }, { 0x2f, 0x2a, 0xfb, 0x2f }, { 0x2f, 0x2b, 0xfc, 0x2f }, { 0x2f, 0x2c, 0xfd, 0x2f }, { 0x2f, 0x2d, 0xfe, 0x30 }, { 0x2f, 0x2e, 0xff, 0x30 }, { 0x2f, 0x2f, 0x00, 0x30 }, { 0x2f, 0x30, 0x01, 0x30 }, { 0x30, 0x31, 0x02, 0x30 }, { 0x30, 0x32, 0x03, 0x30 }, { 0x30, 0x33, 0x04, 0x30 }, { 0x30, 0x34, 0x05, 0x30 }, { 0x30, 0x35, 0x06, 0x30 }, { 0x30, 0x36, 0x07, 0x30 }, { 0x30, 0x37, 0x08, 0x30 }, { 0x30, 0x38, 0x09, 0x30 }, { 0x30, 0x39, 0x0a, 0x30 }, { 0x30, 0x3a, 0x0b, 0x30 }, { 0x30, 0x3b, 0x0c, 0x30 }, { 0x30, 0x3c, 0x0d, 0x30 }, { 0x30, 0x3d, 0x0e, 0x31 }, { 0x30, 0x3e, 0x0f, 0x31 }, { 0x30, 0x3f, 0x10, 0x31 }, { 0x30, 0x30, 0x11, 0x31 }, { 0x31, 0x31, 0x12, 0x31 }, { 0x31, 0x32, 0x13, 0x31 }, { 0x31, 0x33, 0x14, 0x31 }, { 0x31, 0x34, 0x15, 0x31 }, { 0x31, 0x35, 0x16, 0x31 }, { 0x31, 0x36, 0x17, 0x31 }, { 0x31, 0x37, 0x18, 0x31 }, { 0x31, 0x38, 0x19, 0x31 }, { 0x31, 0x39, 0x1a, 0x31 }, { 0x31, 0x3a, 0x1b, 0x31 }, { 0x31, 0x3b, 0x1c, 0x31 }, { 0x31, 0x3c, 0x1d, 0x31 }, { 0x31, 0x3d, 0x1e, 0x32 }, { 0x31, 0x3e, 0x1f, 0x32 }, { 0x31, 0x3f, 0x20, 0x32 }, { 0x31, 0x30, 0x21, 0x32 }, { 0x32, 0x31, 0x22, 0x32 }, { 0x32, 0x32, 0x23, 0x32 }, { 0x32, 0x33, 0x24, 0x32 }, { 0x32, 0x34, 0x25, 0x32 }, { 0x32, 0x35, 0x26, 0x32 }, { 0x32, 0x36, 0x27, 0x32 }, { 0x32, 0x37, 0x28, 0x32 }, { 0x32, 0x38, 0x29, 0x32 }, { 0x32, 0x39, 0x2a, 0x32 }, { 0x32, 0x3a, 0x2b, 0x32 }, { 0x32, 0x3b, 0x2c, 0x32 }, { 0x32, 0x3c, 0x2d, 0x32 }, { 0x32, 0x3d, 0x2e, 0x33 }, { 0x32, 0x3e, 0x2f, 0x33 }, { 0x32, 0x3f, 0x30, 0x33 }, { 0x32, 0x30, 0x31, 0x33 }, { 0x33, 0x31, 0x32, 0x33 }, { 0x33, 0x32, 0x33, 0x33 }, { 0x33, 0x33, 0x34, 0x33 }, { 0x33, 0x34, 0x35, 0x33 }, { 0x33, 0x35, 0x36, 0x33 }, { 0x33, 0x36, 0x37, 0x33 }, { 0x33, 0x37, 0x38, 0x33 }, { 0x33, 0x38, 0x39, 0x33 }, { 0x33, 0x39, 0x3a, 0x33 }, { 0x33, 0x3a, 0x3b, 0x33 }, { 0x33, 0x3b, 0x3c, 0x33 }, { 0x33, 0x3c, 0x3d, 0x33 }, { 0x33, 0x3d, 0x3e, 0x34 }, { 0x33, 0x3e, 0x3f, 0x34 }, { 0x33, 0x3f, 0x40, 0x34 }, { 0x33, 0x30, 0x41, 0x34 }, { 0x34, 0x31, 0x42, 0x34 }, { 0x34, 0x32, 0x43, 0x34 }, { 0x34, 0x33, 0x44, 0x34 }, { 0x34, 0x34, 0x45, 0x34 }, { 0x34, 0x35, 0x46, 0x34 }, { 0x34, 0x36, 0x47, 0x34 }, { 0x34, 0x37, 0x48, 0x34 }, { 0x34, 0x38, 0x49, 0x34 }, { 0x34, 0x39, 0x4a, 0x34 }, { 0x34, 0x3a, 0x4b, 0x34 }, { 0x34, 0x3b, 0x4c, 0x34 }, { 0x34, 0x3c, 0x4d, 0x34 }, { 0x34, 0x3d, 0x4e, 0x35 }, { 0x34, 0x3e, 0x4f, 0x35 }, { 0x34, 0x3f, 0x50, 0x35 }, { 0x34, 0x30, 0x51, 0x35 }, { 0x35, 0x31, 0x52, 0x35 }, { 0x35, 0x32, 0x53, 0x35 }, { 0x35, 0x33, 0x54, 0x35 }, { 0x35, 0x34, 0x55, 0x35 }, { 0x35, 0x35, 0x56, 0x35 }, { 0x35, 0x36, 0x57, 0x35 }, { 0x35, 0x37, 0x58, 0x35 }, { 0x35, 0x38, 0x59, 0x35 }, { 0x35, 0x39, 0x5a, 0x35 }, { 0x35, 0x3a, 0x5b, 0x35 }, { 0x35, 0x3b, 0x5c, 0x35 }, { 0x35, 0x3c, 0x5d, 0x35 }, { 0x35, 0x3d, 0x5e, 0x36 }, { 0x35, 0x3e, 0x5f, 0x36 }, { 0x35, 0x3f, 0x60, 0x36 }, { 0x35, 0x30, 0x61, 0x36 }, { 0x36, 0x31, 0x62, 0x36 }, { 0x36, 0x32, 0x63, 0x36 }, { 0x36, 0x33, 0x64, 0x36 }, { 0x36, 0x34, 0x65, 0x36 }, { 0x36, 0x35, 0x66, 0x36 }, { 0x36, 0x36, 0x67, 0x36 }, { 0x36, 0x37, 0x68, 0x36 }, { 0x36, 0x38, 0x69, 0x36 }, { 0x36, 0x39, 0x6a, 0x36 }, { 0x36, 0x3a, 0x6b, 0x36 }, { 0x36, 0x3b, 0x6c, 0x36 }, { 0x36, 0x3c, 0x6d, 0x36 }, { 0x36, 0x3d, 0x6e, 0x37 }, { 0x36, 0x3e, 0x6f, 0x37 }, { 0x36, 0x3f, 0x70, 0x37 }, { 0x36, 0x30, 0x71, 0x37 }, { 0x37, 0x31, 0x72, 0x37 }, { 0x37, 0x32, 0x73, 0x37 }, { 0x37, 0x33, 0x74, 0x37 }, { 0x37, 0x34, 0x75, 0x37 }, { 0x37, 0x35, 0x76, 0x37 }, { 0x37, 0x36, 0x77, 0x37 }, { 0x37, 0x37, 0x78, 0x37 }, { 0x37, 0x38, 0x79, 0x37 }, { 0x37, 0x39, 0x7a, 0x37 }, { 0x37, 0x3a, 0x7b, 0x37 }, { 0x37, 0x3b, 0x7c, 0x37 }, { 0x37, 0x3c, 0x7d, 0x37 }, { 0x37, 0x3d, 0x7e, 0x38 }, { 0x37, 0x3e, 0x7f, 0x38 }, { 0x37, 0x3f, 0x80, 0x38 }, { 0x37, 0x30, 0x81, 0x38 }, { 0x38, 0x31, 0x82, 0x38 }, { 0x38, 0x32, 0x83, 0x38 }, { 0x38, 0x33, 0x84, 0x38 }, { 0x38, 0x34, 0x85, 0x38 }, { 0x38, 0x35, 0x86, 0x38 }, { 0x38, 0x36, 0x87, 0x38 }, { 0x38, 0x37, 0x88, 0x38 }, { 0x38, 0x38, 0x89, 0x38 }, { 0x38, 0x39, 0x8a, 0x38 }, { 0x38, 0x3a, 0x8b, 0x38 }, { 0x38, 0x3b, 0x8c, 0x38 }, { 0x38, 0x3c, 0x8d, 0x38 }, { 0x38, 0x3d, 0x8e, 0x39 }, { 0x38, 0x3e, 0x8f, 0x39 }, { 0x38, 0x3f, 0x90, 0x39 }, { 0x38, 0x30, 0x91, 0x39 }, { 0x39, 0x31, 0x92, 0x39 }, { 0x39, 0x32, 0x93, 0x39 }, { 0x39, 0x33, 0x94, 0x39 }, { 0x39, 0x34, 0x95, 0x39 }, { 0x39, 0x35, 0x96, 0x39 }, { 0x39, 0x36, 0x97, 0x39 }, { 0x39, 0x37, 0x98, 0x39 }, { 0x39, 0x38, 0x99, 0x39 }, { 0x39, 0x39, 0x9a, 0x39 }, { 0x39, 0x3a, 0x9b, 0x39 }, { 0x39, 0x3b, 0x9c, 0x39 }, { 0x39, 0x3c, 0x9d, 0x39 }, { 0x39, 0x3d, 0x9e, 0x3a }, { 0x39, 0x3e, 0x9f, 0x3a }, { 0x39, 0x3f, 0xa0, 0x3a }, { 0x39, 0x30, 0xa1, 0x3a }, { 0x3a, 0x31, 0xa2, 0x3a }, { 0x3a, 0x32, 0xa3, 0x3a }, { 0x3a, 0x33, 0xa4, 0x3a }, { 0x3a, 0x34, 0xa5, 0x3a }, { 0x3a, 0x35, 0xa6, 0x3a }, { 0x3a, 0x36, 0xa7, 0x3a }, { 0x3a, 0x37, 0xa8, 0x3a }, { 0x3a, 0x38, 0xa9, 0x3a }, { 0x3a, 0x39, 0xaa, 0x3a }, { 0x3a, 0x3a, 0xab, 0x3a }, { 0x3a, 0x3b, 0xac, 0x3a }, { 0x3a, 0x3c, 0xad, 0x3a }, { 0x3a, 0x3d, 0xae, 0x3b }, { 0x3a, 0x3e, 0xaf, 0x3b }, { 0x3a, 0x3f, 0xb0, 0x3b }, { 0x3a, 0x30, 0xb1, 0x3b }, { 0x3b, 0x31, 0xb2, 0x3b }, { 0x3b, 0x32, 0xb3, 0x3b }, { 0x3b, 0x33, 0xb4, 0x3b }, { 0x3b, 0x34, 0xb5, 0x3b }, { 0x3b, 0x35, 0xb6, 0x3b }, { 0x3b, 0x36, 0xb7, 0x3b }, { 0x3b, 0x37, 0xb8, 0x3b }, { 0x3b, 0x38, 0xb9, 0x3b }, { 0x3b, 0x39, 0xba, 0x3b }, { 0x3b, 0x3a, 0xbb, 0x3b }, { 0x3b, 0x3b, 0xbc, 0x3b }, { 0x3b, 0x3c, 0xbd, 0x3b }, { 0x3b, 0x3d, 0xbe, 0x3c }, { 0x3b, 0x3e, 0xbf, 0x3c }, { 0x3b, 0x3f, 0xc0, 0x3c }, { 0x3b, 0x30, 0xc1, 0x3c }, { 0x3c, 0x31, 0xc2, 0x3c }, { 0x3c, 0x32, 0xc3, 0x3c }, { 0x3c, 0x33, 0xc4, 0x3c }, { 0x3c, 0x34, 0xc5, 0x3c }, { 0x3c, 0x35, 0xc6, 0x3c }, { 0x3c, 0x36, 0xc7, 0x3c }, { 0x3c, 0x37, 0xc8, 0x3c }, { 0x3c, 0x38, 0xc9, 0x3c }, { 0x3c, 0x39, 0xca, 0x3c }, { 0x3c, 0x3a, 0xcb, 0x3c }, { 0x3c, 0x3b, 0xcc, 0x3c }, { 0x3c, 0x3c, 0xcd, 0x3c }, { 0x3c, 0x3d, 0xce, 0x3d }, { 0x3c, 0x3e, 0xcf, 0x3d }, { 0x3c, 0x3f, 0xd0, 0x3d }, { 0x3c, 0x30, 0xd1, 0x3d }, { 0x3d, 0x31, 0xd2, 0x3d }, { 0x3d, 0x32, 0xd3, 0x3d }, { 0x3d, 0x33, 0xd4, 0x3d }, { 0x3d, 0x34, 0xd5, 0x3d }, { 0x3d, 0x35, 0xd6, 0x3d }, { 0x3d, 0x36, 0xd7, 0x3d }, { 0x3d, 0x37, 0xd8, 0x3d }, { 0x3d, 0x38, 0xd9, 0x3d }, { 0x3d, 0x39, 0xda, 0x3d }, { 0x3d, 0x3a, 0xdb, 0x3d }, { 0x3d, 0x3b, 0xdc, 0x3d }, { 0x3d, 0x3c, 0xdd, 0x3d }, { 0x3d, 0x3d, 0xde, 0x3e }, { 0x3d, 0x3e, 0xdf, 0x3e }, { 0x3d, 0x3f, 0xe0, 0x3e }, { 0x3d, 0x30, 0xe1, 0x3e }, { 0x3e, 0x31, 0xe2, 0x3e }, { 0x3e, 0x32, 0xe3, 0x3e }, { 0x3e, 0x33, 0xe4, 0x3e }, { 0x3e, 0x34, 0xe5, 0x3e }, { 0x3e, 0x35, 0xe6, 0x3e }, { 0x3e, 0x36, 0xe7, 0x3e }, { 0x3e, 0x37, 0xe8, 0x3e }, { 0x3e, 0x38, 0xe9, 0x3e }, { 0x3e, 0x39, 0xea, 0x3e }, { 0x3e, 0x3a, 0xeb, 0x3e }, { 0x3e, 0x3b, 0xec, 0x3e }, { 0x3e, 0x3c, 0xed, 0x3e }, { 0x3e, 0x3d, 0xee, 0x3f }, { 0x3e, 0x3e, 0xef, 0x3f }, { 0x3e, 0x3f, 0xf0, 0x3f }, { 0x3e, 0x30, 0xf1, 0x3f }, { 0x3f, 0x31, 0xf2, 0x3f }, { 0x3f, 0x32, 0xf3, 0x3f }, { 0x3f, 0x33, 0xf4, 0x3f }, { 0x3f, 0x34, 0xf5, 0x3f }, { 0x3f, 0x35, 0xf6, 0x3f }, { 0x3f, 0x36, 0xf7, 0x3f }, { 0x3f, 0x37, 0xf8, 0x3f }, { 0x3f, 0x38, 0xf9, 0x3f }, { 0x3f, 0x39, 0xfa, 0x3f }, { 0x3f, 0x3a, 0xfb, 0x3f }, { 0x3f, 0x3b, 0xfc, 0x3f }, { 0x3f, 0x3c, 0xfd, 0x3f }, { 0x3f, 0x3d, 0xfe, 0x40 }, { 0x3f, 0x3e, 0xff, 0x40 }, { 0x3f, 0x3f, 0x00, 0x40 }, { 0x3f, 0x40, 0x01, 0x40 }, }; GenefxAccumulator S[ACC_SIZE] = { { 0x0, 0x1, 0x2, 0x4 }, { 0x1, 0x2, 0x3, 0x5 }, { 0x2, 0x3, 0x4, 0x6 }, { 0x3, 0x4, 0x5, 0x7 }, { 0x4, 0x5, 0x6, 0x8 }, { 0x5, 0x6, 0x7, 0x9 }, { 0x6, 0x7, 0x8, 0xa }, { 0x7, 0x8, 0x9, 0xb }, { 0x8, 0x9, 0xa, 0xc }, { 0x9, 0xa, 0xb, 0xd }, { 0xa, 0xb, 0xc, 0xe }, { 0xb, 0xc, 0xd, 0xf }, { 0xc, 0xd, 0xe, 0x10 }, { 0xd, 0xe, 0xf, 0x11 }, { 0xe, 0xf, 0x10, 0x12 }, { 0xf, 0x10, 0x11, 0x13 }, { 0x10, 0x11, 0x12, 0x14 }, { 0x11, 0x12, 0x13, 0x15 }, { 0x12, 0x13, 0x14, 0x16 }, { 0x13, 0x14, 0x15, 0x17 }, { 0x14, 0x15, 0x16, 0x18 }, { 0x15, 0x16, 0x17, 0x19 }, { 0x16, 0x17, 0x18, 0x1a }, { 0x17, 0x18, 0x19, 0x1b }, { 0x18, 0x19, 0x1a, 0x1c }, { 0x19, 0x1a, 0x1b, 0x1d }, { 0x1a, 0x1b, 0x1c, 0x1e }, { 0x1b, 0x1c, 0x1d, 0x1f }, { 0x1c, 0x1d, 0x1e, 0x20 }, { 0x1d, 0x1e, 0x1f, 0x21 }, { 0x1e, 0x1f, 0x20, 0x22 }, { 0x1f, 0x20, 0x21, 0x23 }, { 0x20, 0x21, 0x22, 0x24 }, { 0x21, 0x22, 0x23, 0x25 }, { 0x22, 0x23, 0x24, 0x26 }, { 0x23, 0x24, 0x25, 0x27 }, { 0x24, 0x25, 0x26, 0x28 }, { 0x25, 0x26, 0x27, 0x29 }, { 0x26, 0x27, 0x28, 0x2a }, { 0x27, 0x28, 0x29, 0x2b }, { 0x28, 0x29, 0x2a, 0x2c }, { 0x29, 0x2a, 0x2b, 0x2d }, { 0x2a, 0x2b, 0x2c, 0x2e }, { 0x2b, 0x2c, 0x2d, 0x2f }, { 0x2c, 0x2d, 0x2e, 0x30 }, { 0x2d, 0x2e, 0x2f, 0x31 }, { 0x2e, 0x2f, 0x30, 0x32 }, { 0x2f, 0x30, 0x31, 0x33 }, { 0x30, 0x31, 0x32, 0x34 }, { 0x31, 0x32, 0x33, 0x35 }, { 0x32, 0x33, 0x34, 0x36 }, { 0x33, 0x34, 0x35, 0x37 }, { 0x34, 0x35, 0x36, 0x38 }, { 0x35, 0x36, 0x37, 0x39 }, { 0x36, 0x37, 0x38, 0x3a }, { 0x37, 0x38, 0x39, 0x3b }, { 0x38, 0x39, 0x3a, 0x3c }, { 0x39, 0x3a, 0x3b, 0x3d }, { 0x3a, 0x3b, 0x3c, 0x3e }, { 0x3b, 0x3c, 0x3d, 0x3f }, { 0x3c, 0x3d, 0x3e, 0x40 }, { 0x3d, 0x3e, 0x3f, 0x41 }, { 0x3e, 0x3f, 0x40, 0x42 }, { 0x3f, 0x40, 0x41, 0x43 }, { 0x40, 0x41, 0x42, 0x44 }, { 0x41, 0x42, 0x43, 0x45 }, { 0x42, 0x43, 0x44, 0x46 }, { 0x43, 0x44, 0x45, 0x47 }, { 0x44, 0x45, 0x46, 0x48 }, { 0x45, 0x46, 0x47, 0x49 }, { 0x46, 0x47, 0x48, 0x4a }, { 0x47, 0x48, 0x49, 0x4b }, { 0x48, 0x49, 0x4a, 0x4c }, { 0x49, 0x4a, 0x4b, 0x4d }, { 0x4a, 0x4b, 0x4c, 0x4e }, { 0x4b, 0x4c, 0x4d, 0x4f }, { 0x4c, 0x4d, 0x4e, 0x50 }, { 0x4d, 0x4e, 0x4f, 0x51 }, { 0x4e, 0x4f, 0x50, 0x52 }, { 0x4f, 0x50, 0x51, 0x53 }, { 0x50, 0x51, 0x52, 0x54 }, { 0x51, 0x52, 0x53, 0x55 }, { 0x52, 0x53, 0x54, 0x56 }, { 0x53, 0x54, 0x55, 0x57 }, { 0x54, 0x55, 0x56, 0x58 }, { 0x55, 0x56, 0x57, 0x59 }, { 0x56, 0x57, 0x58, 0x5a }, { 0x57, 0x58, 0x59, 0x5b }, { 0x58, 0x59, 0x5a, 0x5c }, { 0x59, 0x5a, 0x5b, 0x5d }, { 0x5a, 0x5b, 0x5c, 0x5e }, { 0x5b, 0x5c, 0x5d, 0x5f }, { 0x5c, 0x5d, 0x5e, 0x60 }, { 0x5d, 0x5e, 0x5f, 0x61 }, { 0x5e, 0x5f, 0x60, 0x62 }, { 0x5f, 0x60, 0x61, 0x63 }, { 0x60, 0x61, 0x62, 0x64 }, { 0x61, 0x62, 0x63, 0x65 }, { 0x62, 0x63, 0x64, 0x66 }, { 0x63, 0x64, 0x65, 0x67 }, { 0x64, 0x65, 0x66, 0x68 }, { 0x65, 0x66, 0x67, 0x69 }, { 0x66, 0x67, 0x68, 0x6a }, { 0x67, 0x68, 0x69, 0x6b }, { 0x68, 0x69, 0x6a, 0x6c }, { 0x69, 0x6a, 0x6b, 0x6d }, { 0x6a, 0x6b, 0x6c, 0x6e }, { 0x6b, 0x6c, 0x6d, 0x6f }, { 0x6c, 0x6d, 0x6e, 0x70 }, { 0x6d, 0x6e, 0x6f, 0x71 }, { 0x6e, 0x6f, 0x70, 0x72 }, { 0x6f, 0x70, 0x71, 0x73 }, { 0x70, 0x71, 0x72, 0x74 }, { 0x71, 0x72, 0x73, 0x75 }, { 0x72, 0x73, 0x74, 0x76 }, { 0x73, 0x74, 0x75, 0x77 }, { 0x74, 0x75, 0x76, 0x78 }, { 0x75, 0x76, 0x77, 0x79 }, { 0x76, 0x77, 0x78, 0x7a }, { 0x77, 0x78, 0x79, 0x7b }, { 0x78, 0x79, 0x7a, 0x7c }, { 0x79, 0x7a, 0x7b, 0x7d }, { 0x7a, 0x7b, 0x7c, 0x7e }, { 0x7b, 0x7c, 0x7d, 0x7f }, { 0x7c, 0x7d, 0x7e, 0x80 }, { 0x7d, 0x7e, 0x7f, 0x81 }, { 0x7e, 0x7f, 0x80, 0x82 }, { 0x7f, 0x80, 0x81, 0x83 }, { 0x80, 0x81, 0x82, 0x84 }, { 0x81, 0x82, 0x83, 0x85 }, { 0x82, 0x83, 0x84, 0x86 }, { 0x83, 0x84, 0x85, 0x87 }, { 0x84, 0x85, 0x86, 0x88 }, { 0x85, 0x86, 0x87, 0x89 }, { 0x86, 0x87, 0x88, 0x8a }, { 0x87, 0x88, 0x89, 0x8b }, { 0x88, 0x89, 0x8a, 0x8c }, { 0x89, 0x8a, 0x8b, 0x8d }, { 0x8a, 0x8b, 0x8c, 0x8e }, { 0x8b, 0x8c, 0x8d, 0x8f }, { 0x8c, 0x8d, 0x8e, 0x90 }, { 0x8d, 0x8e, 0x8f, 0x91 }, { 0x8e, 0x8f, 0x90, 0x92 }, { 0x8f, 0x90, 0x91, 0x93 }, { 0x90, 0x91, 0x92, 0x94 }, { 0x91, 0x92, 0x93, 0x95 }, { 0x92, 0x93, 0x94, 0x96 }, { 0x93, 0x94, 0x95, 0x97 }, { 0x94, 0x95, 0x96, 0x98 }, { 0x95, 0x96, 0x97, 0x99 }, { 0x96, 0x97, 0x98, 0x9a }, { 0x97, 0x98, 0x99, 0x9b }, { 0x98, 0x99, 0x9a, 0x9c }, { 0x99, 0x9a, 0x9b, 0x9d }, { 0x9a, 0x9b, 0x9c, 0x9e }, { 0x9b, 0x9c, 0x9d, 0x9f }, { 0x9c, 0x9d, 0x9e, 0xa0 }, { 0x9d, 0x9e, 0x9f, 0xa1 }, { 0x9e, 0x9f, 0xa0, 0xa2 }, { 0x9f, 0xa0, 0xa1, 0xa3 }, { 0xa0, 0xa1, 0xa2, 0xa4 }, { 0xa1, 0xa2, 0xa3, 0xa5 }, { 0xa2, 0xa3, 0xa4, 0xa6 }, { 0xa3, 0xa4, 0xa5, 0xa7 }, { 0xa4, 0xa5, 0xa6, 0xa8 }, { 0xa5, 0xa6, 0xa7, 0xa9 }, { 0xa6, 0xa7, 0xa8, 0xaa }, { 0xa7, 0xa8, 0xa9, 0xab }, { 0xa8, 0xa9, 0xaa, 0xac }, { 0xa9, 0xaa, 0xab, 0xad }, { 0xaa, 0xab, 0xac, 0xae }, { 0xab, 0xac, 0xad, 0xaf }, { 0xac, 0xad, 0xae, 0xb0 }, { 0xad, 0xae, 0xaf, 0xb1 }, { 0xae, 0xaf, 0xb0, 0xb2 }, { 0xaf, 0xb0, 0xb1, 0xb3 }, { 0xb0, 0xb1, 0xb2, 0xb4 }, { 0xb1, 0xb2, 0xb3, 0xb5 }, { 0xb2, 0xb3, 0xb4, 0xb6 }, { 0xb3, 0xb4, 0xb5, 0xb7 }, { 0xb4, 0xb5, 0xb6, 0xb8 }, { 0xb5, 0xb6, 0xb7, 0xb9 }, { 0xb6, 0xb7, 0xb8, 0xba }, { 0xb7, 0xb8, 0xb9, 0xbb }, { 0xb8, 0xb9, 0xba, 0xbc }, { 0xb9, 0xba, 0xbb, 0xbd }, { 0xba, 0xbb, 0xbc, 0xbe }, { 0xbb, 0xbc, 0xbd, 0xbf }, { 0xbc, 0xbd, 0xbe, 0xc0 }, { 0xbd, 0xbe, 0xbf, 0xc1 }, { 0xbe, 0xbf, 0xc0, 0xc2 }, { 0xbf, 0xc0, 0xc1, 0xc3 }, { 0xc0, 0xc1, 0xc2, 0xc4 }, { 0xc1, 0xc2, 0xc3, 0xc5 }, { 0xc2, 0xc3, 0xc4, 0xc6 }, { 0xc3, 0xc4, 0xc5, 0xc7 }, { 0xc4, 0xc5, 0xc6, 0xc8 }, { 0xc5, 0xc6, 0xc7, 0xc9 }, { 0xc6, 0xc7, 0xc8, 0xca }, { 0xc7, 0xc8, 0xc9, 0xcb }, { 0xc8, 0xc9, 0xca, 0xcc }, { 0xc9, 0xca, 0xcb, 0xcd }, { 0xca, 0xcb, 0xcc, 0xce }, { 0xcb, 0xcc, 0xcd, 0xcf }, { 0xcc, 0xcd, 0xce, 0xd0 }, { 0xcd, 0xce, 0xcf, 0xd1 }, { 0xce, 0xcf, 0xd0, 0xd2 }, { 0xcf, 0xd0, 0xd1, 0xd3 }, { 0xd0, 0xd1, 0xd2, 0xd4 }, { 0xd1, 0xd2, 0xd3, 0xd5 }, { 0xd2, 0xd3, 0xd4, 0xd6 }, { 0xd3, 0xd4, 0xd5, 0xd7 }, { 0xd4, 0xd5, 0xd6, 0xd8 }, { 0xd5, 0xd6, 0xd7, 0xd9 }, { 0xd6, 0xd7, 0xd8, 0xda }, { 0xd7, 0xd8, 0xd9, 0xdb }, { 0xd8, 0xd9, 0xda, 0xdc }, { 0xd9, 0xda, 0xdb, 0xdd }, { 0xda, 0xdb, 0xdc, 0xde }, { 0xdb, 0xdc, 0xdd, 0xdf }, { 0xdc, 0xdd, 0xde, 0xe0 }, { 0xdd, 0xde, 0xdf, 0xe1 }, { 0xde, 0xdf, 0xe0, 0xe2 }, { 0xdf, 0xe0, 0xe1, 0xe3 }, { 0xe0, 0xe1, 0xe2, 0xe4 }, { 0xe1, 0xe2, 0xe3, 0xe5 }, { 0xe2, 0xe3, 0xe4, 0xe6 }, { 0xe3, 0xe4, 0xe5, 0xe7 }, { 0xe4, 0xe5, 0xe6, 0xe8 }, { 0xe5, 0xe6, 0xe7, 0xe9 }, { 0xe6, 0xe7, 0xe8, 0xea }, { 0xe7, 0xe8, 0xe9, 0xeb }, { 0xe8, 0xe9, 0xea, 0xec }, { 0xe9, 0xea, 0xeb, 0xed }, { 0xea, 0xeb, 0xec, 0xee }, { 0xeb, 0xec, 0xed, 0xef }, { 0xec, 0xed, 0xee, 0xf0 }, { 0xed, 0xee, 0xef, 0xf1 }, { 0xee, 0xef, 0xf0, 0xf2 }, { 0xef, 0xf0, 0xf1, 0xf3 }, { 0xf0, 0xf1, 0xf2, 0xf4 }, { 0xf1, 0xf2, 0xf3, 0xf5 }, { 0xf2, 0xf3, 0xf4, 0xf6 }, { 0xf3, 0xf4, 0xf5, 0xf7 }, { 0xf4, 0xf5, 0xf6, 0xf8 }, { 0xf5, 0xf6, 0xf7, 0xf9 }, { 0xf6, 0xf7, 0xf8, 0xfa }, { 0xf7, 0xf8, 0xf9, 0xfb }, { 0xf8, 0xf9, 0xfa, 0xfc }, { 0xf9, 0xfa, 0xfb, 0xfd }, { 0xfa, 0xfb, 0xfc, 0xfe }, { 0xfb, 0xfc, 0xfd, 0xff }, { 0xfc, 0xfd, 0xfe, 0x00 }, { 0xfd, 0xfe, 0xff, 0x01 }, { 0xfe, 0xff, 0x00, 0x02 }, { 0xff, 0x00, 0x01, 0x03 }, { 0x10, 0x11, 0x02, 0x10 }, { 0x10, 0x12, 0x03, 0x10 }, { 0x10, 0x13, 0x04, 0x10 }, { 0x10, 0x14, 0x05, 0x10 }, { 0x10, 0x15, 0x06, 0x10 }, { 0x10, 0x16, 0x07, 0x10 }, { 0x10, 0x17, 0x08, 0x10 }, { 0x10, 0x18, 0x09, 0x10 }, { 0x10, 0x19, 0x0a, 0x10 }, { 0x10, 0x1a, 0x0b, 0x10 }, { 0x10, 0x1b, 0x0c, 0x10 }, { 0x10, 0x1c, 0x0d, 0x10 }, { 0x10, 0x1d, 0x0e, 0x11 }, { 0x10, 0x1e, 0x0f, 0x11 }, { 0x10, 0x1f, 0x10, 0x11 }, { 0x10, 0x10, 0x11, 0x11 }, { 0x11, 0x11, 0x12, 0x11 }, { 0x11, 0x12, 0x13, 0x11 }, { 0x11, 0x13, 0x14, 0x11 }, { 0x11, 0x14, 0x15, 0x11 }, { 0x11, 0x15, 0x16, 0x11 }, { 0x11, 0x16, 0x17, 0x11 }, { 0x11, 0x17, 0x18, 0x11 }, { 0x11, 0x18, 0x19, 0x11 }, { 0x11, 0x19, 0x1a, 0x11 }, { 0x11, 0x1a, 0x1b, 0x11 }, { 0x11, 0x1b, 0x1c, 0x11 }, { 0x11, 0x1c, 0x1d, 0x11 }, { 0x11, 0x1d, 0x1e, 0x12 }, { 0x11, 0x1e, 0x1f, 0x12 }, { 0x11, 0x1f, 0x20, 0x12 }, { 0x11, 0x10, 0x21, 0x12 }, { 0x12, 0x11, 0x22, 0x12 }, { 0x12, 0x12, 0x23, 0x12 }, { 0x12, 0x13, 0x24, 0x12 }, { 0x12, 0x14, 0x25, 0x12 }, { 0x12, 0x15, 0x26, 0x12 }, { 0x12, 0x16, 0x27, 0x12 }, { 0x12, 0x17, 0x28, 0x12 }, { 0x12, 0x18, 0x29, 0x12 }, { 0x12, 0x19, 0x2a, 0x12 }, { 0x12, 0x1a, 0x2b, 0x12 }, { 0x12, 0x1b, 0x2c, 0x12 }, { 0x12, 0x1c, 0x2d, 0x12 }, { 0x12, 0x1d, 0x2e, 0x13 }, { 0x12, 0x1e, 0x2f, 0x13 }, { 0x12, 0x1f, 0x30, 0x13 }, { 0x12, 0x10, 0x31, 0x13 }, { 0x13, 0x11, 0x32, 0x13 }, { 0x13, 0x12, 0x33, 0x13 }, { 0x13, 0x13, 0x34, 0x13 }, { 0x13, 0x14, 0x35, 0x13 }, { 0x13, 0x15, 0x36, 0x13 }, { 0x13, 0x16, 0x37, 0x13 }, { 0x13, 0x17, 0x38, 0x13 }, { 0x13, 0x18, 0x39, 0x13 }, { 0x13, 0x19, 0x3a, 0x13 }, { 0x13, 0x1a, 0x3b, 0x13 }, { 0x13, 0x1b, 0x3c, 0x13 }, { 0x13, 0x1c, 0x3d, 0x13 }, { 0x13, 0x1d, 0x3e, 0x14 }, { 0x13, 0x1e, 0x3f, 0x14 }, { 0x13, 0x1f, 0x40, 0x14 }, { 0x13, 0x10, 0x41, 0x14 }, { 0x14, 0x11, 0x42, 0x14 }, { 0x14, 0x12, 0x43, 0x14 }, { 0x14, 0x13, 0x44, 0x14 }, { 0x14, 0x14, 0x45, 0x14 }, { 0x14, 0x15, 0x46, 0x14 }, { 0x14, 0x16, 0x47, 0x14 }, { 0x14, 0x17, 0x48, 0x14 }, { 0x14, 0x18, 0x49, 0x14 }, { 0x14, 0x19, 0x4a, 0x14 }, { 0x14, 0x1a, 0x4b, 0x14 }, { 0x14, 0x1b, 0x4c, 0x14 }, { 0x14, 0x1c, 0x4d, 0x14 }, { 0x14, 0x1d, 0x4e, 0x15 }, { 0x14, 0x1e, 0x4f, 0x15 }, { 0x14, 0x1f, 0x50, 0x15 }, { 0x14, 0x10, 0x51, 0x15 }, { 0x15, 0x11, 0x52, 0x15 }, { 0x15, 0x12, 0x53, 0x15 }, { 0x15, 0x13, 0x54, 0x15 }, { 0x15, 0x14, 0x55, 0x15 }, { 0x15, 0x15, 0x56, 0x15 }, { 0x15, 0x16, 0x57, 0x15 }, { 0x15, 0x17, 0x58, 0x15 }, { 0x15, 0x18, 0x59, 0x15 }, { 0x15, 0x19, 0x5a, 0x15 }, { 0x15, 0x1a, 0x5b, 0x15 }, { 0x15, 0x1b, 0x5c, 0x15 }, { 0x15, 0x1c, 0x5d, 0x15 }, { 0x15, 0x1d, 0x5e, 0x16 }, { 0x15, 0x1e, 0x5f, 0x16 }, { 0x15, 0x1f, 0x60, 0x16 }, { 0x15, 0x10, 0x61, 0x16 }, { 0x16, 0x11, 0x62, 0x16 }, { 0x16, 0x12, 0x63, 0x16 }, { 0x16, 0x13, 0x64, 0x16 }, { 0x16, 0x14, 0x65, 0x16 }, { 0x16, 0x15, 0x66, 0x16 }, { 0x16, 0x16, 0x67, 0x16 }, { 0x16, 0x17, 0x68, 0x16 }, { 0x16, 0x18, 0x69, 0x16 }, { 0x16, 0x19, 0x6a, 0x16 }, { 0x16, 0x1a, 0x6b, 0x16 }, { 0x16, 0x1b, 0x6c, 0x16 }, { 0x16, 0x1c, 0x6d, 0x16 }, { 0x16, 0x1d, 0x6e, 0x17 }, { 0x16, 0x1e, 0x6f, 0x17 }, { 0x16, 0x1f, 0x70, 0x17 }, { 0x16, 0x10, 0x71, 0x17 }, { 0x17, 0x11, 0x72, 0x17 }, { 0x17, 0x12, 0x73, 0x17 }, { 0x17, 0x13, 0x74, 0x17 }, { 0x17, 0x14, 0x75, 0x17 }, { 0x17, 0x15, 0x76, 0x17 }, { 0x17, 0x16, 0x77, 0x17 }, { 0x17, 0x17, 0x78, 0x17 }, { 0x17, 0x18, 0x79, 0x17 }, { 0x17, 0x19, 0x7a, 0x17 }, { 0x17, 0x1a, 0x7b, 0x17 }, { 0x17, 0x1b, 0x7c, 0x17 }, { 0x17, 0x1c, 0x7d, 0x17 }, { 0x17, 0x1d, 0x7e, 0x18 }, { 0x17, 0x1e, 0x7f, 0x18 }, { 0x17, 0x1f, 0x80, 0x18 }, { 0x17, 0x10, 0x81, 0x18 }, { 0x18, 0x11, 0x82, 0x18 }, { 0x18, 0x12, 0x83, 0x18 }, { 0x18, 0x13, 0x84, 0x18 }, { 0x18, 0x14, 0x85, 0x18 }, { 0x18, 0x15, 0x86, 0x18 }, { 0x18, 0x16, 0x87, 0x18 }, { 0x18, 0x17, 0x88, 0x18 }, { 0x18, 0x18, 0x89, 0x18 }, { 0x18, 0x19, 0x8a, 0x18 }, { 0x18, 0x1a, 0x8b, 0x18 }, { 0x18, 0x1b, 0x8c, 0x18 }, { 0x18, 0x1c, 0x8d, 0x18 }, { 0x18, 0x1d, 0x8e, 0x19 }, { 0x18, 0x1e, 0x8f, 0x19 }, { 0x18, 0x1f, 0x90, 0x19 }, { 0x18, 0x10, 0x91, 0x19 }, { 0x19, 0x11, 0x92, 0x19 }, { 0x19, 0x12, 0x93, 0x19 }, { 0x19, 0x13, 0x94, 0x19 }, { 0x19, 0x14, 0x95, 0x19 }, { 0x19, 0x15, 0x96, 0x19 }, { 0x19, 0x16, 0x97, 0x19 }, { 0x19, 0x17, 0x98, 0x19 }, { 0x19, 0x18, 0x99, 0x19 }, { 0x19, 0x19, 0x9a, 0x19 }, { 0x19, 0x1a, 0x9b, 0x19 }, { 0x19, 0x1b, 0x9c, 0x19 }, { 0x19, 0x1c, 0x9d, 0x19 }, { 0x19, 0x1d, 0x9e, 0x1a }, { 0x19, 0x1e, 0x9f, 0x1a }, { 0x19, 0x1f, 0xa0, 0x1a }, { 0x19, 0x10, 0xa1, 0x1a }, { 0x1a, 0x11, 0xa2, 0x1a }, { 0x1a, 0x12, 0xa3, 0x1a }, { 0x1a, 0x13, 0xa4, 0x1a }, { 0x1a, 0x14, 0xa5, 0x1a }, { 0x1a, 0x15, 0xa6, 0x1a }, { 0x1a, 0x16, 0xa7, 0x1a }, { 0x1a, 0x17, 0xa8, 0x1a }, { 0x1a, 0x18, 0xa9, 0x1a }, { 0x1a, 0x19, 0xaa, 0x1a }, { 0x1a, 0x1a, 0xab, 0x1a }, { 0x1a, 0x1b, 0xac, 0x1a }, { 0x1a, 0x1c, 0xad, 0x1a }, { 0x1a, 0x1d, 0xae, 0x1b }, { 0x1a, 0x1e, 0xaf, 0x1b }, { 0x1a, 0x1f, 0xb0, 0x1b }, { 0x1a, 0x10, 0xb1, 0x1b }, { 0x1b, 0x11, 0xb2, 0x1b }, { 0x1b, 0x12, 0xb3, 0x1b }, { 0x1b, 0x13, 0xb4, 0x1b }, { 0x1b, 0x14, 0xb5, 0x1b }, { 0x1b, 0x15, 0xb6, 0x1b }, { 0x1b, 0x16, 0xb7, 0x1b }, { 0x1b, 0x17, 0xb8, 0x1b }, { 0x1b, 0x18, 0xb9, 0x1b }, { 0x1b, 0x19, 0xba, 0x1b }, { 0x1b, 0x1a, 0xbb, 0x1b }, { 0x1b, 0x1b, 0xbc, 0x1b }, { 0x1b, 0x1c, 0xbd, 0x1b }, { 0x1b, 0x1d, 0xbe, 0x1c }, { 0x1b, 0x1e, 0xbf, 0x1c }, { 0x1b, 0x1f, 0xc0, 0x1c }, { 0x1b, 0x10, 0xc1, 0x1c }, { 0x1c, 0x11, 0xc2, 0x1c }, { 0x1c, 0x12, 0xc3, 0x1c }, { 0x1c, 0x13, 0xc4, 0x1c }, { 0x1c, 0x14, 0xc5, 0x1c }, { 0x1c, 0x15, 0xc6, 0x1c }, { 0x1c, 0x16, 0xc7, 0x1c }, { 0x1c, 0x17, 0xc8, 0x1c }, { 0x1c, 0x18, 0xc9, 0x1c }, { 0x1c, 0x19, 0xca, 0x1c }, { 0x1c, 0x1a, 0xcb, 0x1c }, { 0x1c, 0x1b, 0xcc, 0x1c }, { 0x1c, 0x1c, 0xcd, 0x1c }, { 0x1c, 0x1d, 0xce, 0x1d }, { 0x1c, 0x1e, 0xcf, 0x1d }, { 0x1c, 0x1f, 0xd0, 0x1d }, { 0x1c, 0x10, 0xd1, 0x1d }, { 0x1d, 0x11, 0xd2, 0x1d }, { 0x1d, 0x12, 0xd3, 0x1d }, { 0x1d, 0x13, 0xd4, 0x1d }, { 0x1d, 0x14, 0xd5, 0x1d }, { 0x1d, 0x15, 0xd6, 0x1d }, { 0x1d, 0x16, 0xd7, 0x1d }, { 0x1d, 0x17, 0xd8, 0x1d }, { 0x1d, 0x18, 0xd9, 0x1d }, { 0x1d, 0x19, 0xda, 0x1d }, { 0x1d, 0x1a, 0xdb, 0x1d }, { 0x1d, 0x1b, 0xdc, 0x1d }, { 0x1d, 0x1c, 0xdd, 0x1d }, { 0x1d, 0x1d, 0xde, 0x1e }, { 0x1d, 0x1e, 0xdf, 0x1e }, { 0x1d, 0x1f, 0xe0, 0x1e }, { 0x1d, 0x10, 0xe1, 0x1e }, { 0x1e, 0x11, 0xe2, 0x1e }, { 0x1e, 0x12, 0xe3, 0x1e }, { 0x1e, 0x13, 0xe4, 0x1e }, { 0x1e, 0x14, 0xe5, 0x1e }, { 0x1e, 0x15, 0xe6, 0x1e }, { 0x1e, 0x16, 0xe7, 0x1e }, { 0x1e, 0x17, 0xe8, 0x1e }, { 0x1e, 0x18, 0xe9, 0x1e }, { 0x1e, 0x19, 0xea, 0x1e }, { 0x1e, 0x1a, 0xeb, 0x1e }, { 0x1e, 0x1b, 0xec, 0x1e }, { 0x1e, 0x1c, 0xed, 0x1e }, { 0x1e, 0x1d, 0xee, 0x1f }, { 0x1e, 0x1e, 0xef, 0x1f }, { 0x1e, 0x1f, 0xf0, 0x1f }, { 0x1e, 0x10, 0xf1, 0x1f }, { 0x1f, 0x11, 0xf2, 0x1f }, { 0x1f, 0x12, 0xf3, 0x1f }, { 0x1f, 0x13, 0xf4, 0x1f }, { 0x1f, 0x14, 0xf5, 0x1f }, { 0x1f, 0x15, 0xf6, 0x1f }, { 0x1f, 0x16, 0xf7, 0x1f }, { 0x1f, 0x17, 0xf8, 0x1f }, { 0x1f, 0x18, 0xf9, 0x1f }, { 0x1f, 0x19, 0xfa, 0x1f }, { 0x1f, 0x1a, 0xfb, 0x1f }, { 0x1f, 0x1b, 0xfc, 0x1f }, { 0x1f, 0x1c, 0xfd, 0x1f }, { 0x1f, 0x1d, 0xfe, 0x20 }, { 0x1f, 0x1e, 0xff, 0x20 }, { 0x1f, 0x1f, 0x00, 0x20 }, { 0x1f, 0x20, 0x01, 0x20 }, { 0x20, 0x21, 0x02, 0x20 }, { 0x20, 0x22, 0x03, 0x20 }, { 0x20, 0x23, 0x04, 0x20 }, { 0x20, 0x24, 0x05, 0x20 }, { 0x20, 0x25, 0x06, 0x20 }, { 0x20, 0x26, 0x07, 0x20 }, { 0x20, 0x27, 0x08, 0x20 }, { 0x20, 0x28, 0x09, 0x20 }, { 0x20, 0x29, 0x0a, 0x20 }, { 0x20, 0x2a, 0x0b, 0x20 }, { 0x20, 0x2b, 0x0c, 0x20 }, { 0x20, 0x2c, 0x0d, 0x20 }, { 0x20, 0x2d, 0x0e, 0x21 }, { 0x20, 0x2e, 0x0f, 0x21 }, { 0x20, 0x2f, 0x10, 0x21 }, { 0x20, 0x20, 0x11, 0x21 }, { 0x21, 0x21, 0x12, 0x21 }, { 0x21, 0x22, 0x13, 0x21 }, { 0x21, 0x23, 0x14, 0x21 }, { 0x21, 0x24, 0x15, 0x21 }, { 0x21, 0x25, 0x16, 0x21 }, { 0x21, 0x26, 0x17, 0x21 }, { 0x21, 0x27, 0x18, 0x21 }, { 0x21, 0x28, 0x19, 0x21 }, { 0x21, 0x29, 0x1a, 0x21 }, { 0x21, 0x2a, 0x1b, 0x21 }, { 0x21, 0x2b, 0x1c, 0x21 }, { 0x21, 0x2c, 0x1d, 0x21 }, { 0x21, 0x2d, 0x1e, 0x22 }, { 0x21, 0x2e, 0x1f, 0x22 }, { 0x21, 0x2f, 0x20, 0x22 }, { 0x21, 0x20, 0x21, 0x22 }, { 0x22, 0x21, 0x22, 0x22 }, { 0x22, 0x22, 0x23, 0x22 }, { 0x22, 0x23, 0x24, 0x22 }, { 0x22, 0x24, 0x25, 0x22 }, { 0x22, 0x25, 0x26, 0x22 }, { 0x22, 0x26, 0x27, 0x22 }, { 0x22, 0x27, 0x28, 0x22 }, { 0x22, 0x28, 0x29, 0x22 }, { 0x22, 0x29, 0x2a, 0x22 }, { 0x22, 0x2a, 0x2b, 0x22 }, { 0x22, 0x2b, 0x2c, 0x22 }, { 0x22, 0x2c, 0x2d, 0x22 }, { 0x22, 0x2d, 0x2e, 0x23 }, { 0x22, 0x2e, 0x2f, 0x23 }, { 0x22, 0x2f, 0x30, 0x23 }, { 0x22, 0x20, 0x31, 0x23 }, { 0x23, 0x21, 0x32, 0x23 }, { 0x23, 0x22, 0x33, 0x23 }, { 0x23, 0x23, 0x34, 0x23 }, { 0x23, 0x24, 0x35, 0x23 }, { 0x23, 0x25, 0x36, 0x23 }, { 0x23, 0x26, 0x37, 0x23 }, { 0x23, 0x27, 0x38, 0x23 }, { 0x23, 0x28, 0x39, 0x23 }, { 0x23, 0x29, 0x3a, 0x23 }, { 0x23, 0x2a, 0x3b, 0x23 }, { 0x23, 0x2b, 0x3c, 0x23 }, { 0x23, 0x2c, 0x3d, 0x23 }, { 0x23, 0x2d, 0x3e, 0x24 }, { 0x23, 0x2e, 0x3f, 0x24 }, { 0x23, 0x2f, 0x40, 0x24 }, { 0x23, 0x20, 0x41, 0x24 }, { 0x24, 0x21, 0x42, 0x24 }, { 0x24, 0x22, 0x43, 0x24 }, { 0x24, 0x23, 0x44, 0x24 }, { 0x24, 0x24, 0x45, 0x24 }, { 0x24, 0x25, 0x46, 0x24 }, { 0x24, 0x26, 0x47, 0x24 }, { 0x24, 0x27, 0x48, 0x24 }, { 0x24, 0x28, 0x49, 0x24 }, { 0x24, 0x29, 0x4a, 0x24 }, { 0x24, 0x2a, 0x4b, 0x24 }, { 0x24, 0x2b, 0x4c, 0x24 }, { 0x24, 0x2c, 0x4d, 0x24 }, { 0x24, 0x2d, 0x4e, 0x25 }, { 0x24, 0x2e, 0x4f, 0x25 }, { 0x24, 0x2f, 0x50, 0x25 }, { 0x24, 0x20, 0x51, 0x25 }, { 0x25, 0x21, 0x52, 0x25 }, { 0x25, 0x22, 0x53, 0x25 }, { 0x25, 0x23, 0x54, 0x25 }, { 0x25, 0x24, 0x55, 0x25 }, { 0x25, 0x25, 0x56, 0x25 }, { 0x25, 0x26, 0x57, 0x25 }, { 0x25, 0x27, 0x58, 0x25 }, { 0x25, 0x28, 0x59, 0x25 }, { 0x25, 0x29, 0x5a, 0x25 }, { 0x25, 0x2a, 0x5b, 0x25 }, { 0x25, 0x2b, 0x5c, 0x25 }, { 0x25, 0x2c, 0x5d, 0x25 }, { 0x25, 0x2d, 0x5e, 0x26 }, { 0x25, 0x2e, 0x5f, 0x26 }, { 0x25, 0x2f, 0x60, 0x26 }, { 0x25, 0x20, 0x61, 0x26 }, { 0x26, 0x21, 0x62, 0x26 }, { 0x26, 0x22, 0x63, 0x26 }, { 0x26, 0x23, 0x64, 0x26 }, { 0x26, 0x24, 0x65, 0x26 }, { 0x26, 0x25, 0x66, 0x26 }, { 0x26, 0x26, 0x67, 0x26 }, { 0x26, 0x27, 0x68, 0x26 }, { 0x26, 0x28, 0x69, 0x26 }, { 0x26, 0x29, 0x6a, 0x26 }, { 0x26, 0x2a, 0x6b, 0x26 }, { 0x26, 0x2b, 0x6c, 0x26 }, { 0x26, 0x2c, 0x6d, 0x26 }, { 0x26, 0x2d, 0x6e, 0x27 }, { 0x26, 0x2e, 0x6f, 0x27 }, { 0x26, 0x2f, 0x70, 0x27 }, { 0x26, 0x20, 0x71, 0x27 }, { 0x27, 0x21, 0x72, 0x27 }, { 0x27, 0x22, 0x73, 0x27 }, { 0x27, 0x23, 0x74, 0x27 }, { 0x27, 0x24, 0x75, 0x27 }, { 0x27, 0x25, 0x76, 0x27 }, { 0x27, 0x26, 0x77, 0x27 }, { 0x27, 0x27, 0x78, 0x27 }, { 0x27, 0x28, 0x79, 0x27 }, { 0x27, 0x29, 0x7a, 0x27 }, { 0x27, 0x2a, 0x7b, 0x27 }, { 0x27, 0x2b, 0x7c, 0x27 }, { 0x27, 0x2c, 0x7d, 0x27 }, { 0x27, 0x2d, 0x7e, 0x28 }, { 0x27, 0x2e, 0x7f, 0x28 }, { 0x27, 0x2f, 0x80, 0x28 }, { 0x27, 0x20, 0x81, 0x28 }, { 0x28, 0x21, 0x82, 0x28 }, { 0x28, 0x22, 0x83, 0x28 }, { 0x28, 0x23, 0x84, 0x28 }, { 0x28, 0x24, 0x85, 0x28 }, { 0x28, 0x25, 0x86, 0x28 }, { 0x28, 0x26, 0x87, 0x28 }, { 0x28, 0x27, 0x88, 0x28 }, { 0x28, 0x28, 0x89, 0x28 }, { 0x28, 0x29, 0x8a, 0x28 }, { 0x28, 0x2a, 0x8b, 0x28 }, { 0x28, 0x2b, 0x8c, 0x28 }, { 0x28, 0x2c, 0x8d, 0x28 }, { 0x28, 0x2d, 0x8e, 0x29 }, { 0x28, 0x2e, 0x8f, 0x29 }, { 0x28, 0x2f, 0x90, 0x29 }, { 0x28, 0x20, 0x91, 0x29 }, { 0x29, 0x21, 0x92, 0x29 }, { 0x29, 0x22, 0x93, 0x29 }, { 0x29, 0x23, 0x94, 0x29 }, { 0x29, 0x24, 0x95, 0x29 }, { 0x29, 0x25, 0x96, 0x29 }, { 0x29, 0x26, 0x97, 0x29 }, { 0x29, 0x27, 0x98, 0x29 }, { 0x29, 0x28, 0x99, 0x29 }, { 0x29, 0x29, 0x9a, 0x29 }, { 0x29, 0x2a, 0x9b, 0x29 }, { 0x29, 0x2b, 0x9c, 0x29 }, { 0x29, 0x2c, 0x9d, 0x29 }, { 0x29, 0x2d, 0x9e, 0x2a }, { 0x29, 0x2e, 0x9f, 0x2a }, { 0x29, 0x2f, 0xa0, 0x2a }, { 0x29, 0x20, 0xa1, 0x2a }, { 0x2a, 0x21, 0xa2, 0x2a }, { 0x2a, 0x22, 0xa3, 0x2a }, { 0x2a, 0x23, 0xa4, 0x2a }, { 0x2a, 0x24, 0xa5, 0x2a }, { 0x2a, 0x25, 0xa6, 0x2a }, { 0x2a, 0x26, 0xa7, 0x2a }, { 0x2a, 0x27, 0xa8, 0x2a }, { 0x2a, 0x28, 0xa9, 0x2a }, { 0x2a, 0x29, 0xaa, 0x2a }, { 0x2a, 0x2a, 0xab, 0x2a }, { 0x2a, 0x2b, 0xac, 0x2a }, { 0x2a, 0x2c, 0xad, 0x2a }, { 0x2a, 0x2d, 0xae, 0x2b }, { 0x2a, 0x2e, 0xaf, 0x2b }, { 0x2a, 0x2f, 0xb0, 0x2b }, { 0x2a, 0x20, 0xb1, 0x2b }, { 0x2b, 0x21, 0xb2, 0x2b }, { 0x2b, 0x22, 0xb3, 0x2b }, { 0x2b, 0x23, 0xb4, 0x2b }, { 0x2b, 0x24, 0xb5, 0x2b }, { 0x2b, 0x25, 0xb6, 0x2b }, { 0x2b, 0x26, 0xb7, 0x2b }, { 0x2b, 0x27, 0xb8, 0x2b }, { 0x2b, 0x28, 0xb9, 0x2b }, { 0x2b, 0x29, 0xba, 0x2b }, { 0x2b, 0x2a, 0xbb, 0x2b }, { 0x2b, 0x2b, 0xbc, 0x2b }, { 0x2b, 0x2c, 0xbd, 0x2b }, { 0x2b, 0x2d, 0xbe, 0x2c }, { 0x2b, 0x2e, 0xbf, 0x2c }, { 0x2b, 0x2f, 0xc0, 0x2c }, { 0x2b, 0x20, 0xc1, 0x2c }, { 0x2c, 0x21, 0xc2, 0x2c }, { 0x2c, 0x22, 0xc3, 0x2c }, { 0x2c, 0x23, 0xc4, 0x2c }, { 0x2c, 0x24, 0xc5, 0x2c }, { 0x2c, 0x25, 0xc6, 0x2c }, { 0x2c, 0x26, 0xc7, 0x2c }, { 0x2c, 0x27, 0xc8, 0x2c }, { 0x2c, 0x28, 0xc9, 0x2c }, { 0x2c, 0x29, 0xca, 0x2c }, { 0x2c, 0x2a, 0xcb, 0x2c }, { 0x2c, 0x2b, 0xcc, 0x2c }, { 0x2c, 0x2c, 0xcd, 0x2c }, { 0x2c, 0x2d, 0xce, 0x2d }, { 0x2c, 0x2e, 0xcf, 0x2d }, { 0x2c, 0x2f, 0xd0, 0x2d }, { 0x2c, 0x20, 0xd1, 0x2d }, { 0x2d, 0x21, 0xd2, 0x2d }, { 0x2d, 0x22, 0xd3, 0x2d }, { 0x2d, 0x23, 0xd4, 0x2d }, { 0x2d, 0x24, 0xd5, 0x2d }, { 0x2d, 0x25, 0xd6, 0x2d }, { 0x2d, 0x26, 0xd7, 0x2d }, { 0x2d, 0x27, 0xd8, 0x2d }, { 0x2d, 0x28, 0xd9, 0x2d }, { 0x2d, 0x29, 0xda, 0x2d }, { 0x2d, 0x2a, 0xdb, 0x2d }, { 0x2d, 0x2b, 0xdc, 0x2d }, { 0x2d, 0x2c, 0xdd, 0x2d }, { 0x2d, 0x2d, 0xde, 0x2e }, { 0x2d, 0x2e, 0xdf, 0x2e }, { 0x2d, 0x2f, 0xe0, 0x2e }, { 0x2d, 0x20, 0xe1, 0x2e }, { 0x2e, 0x21, 0xe2, 0x2e }, { 0x2e, 0x22, 0xe3, 0x2e }, { 0x2e, 0x23, 0xe4, 0x2e }, { 0x2e, 0x24, 0xe5, 0x2e }, { 0x2e, 0x25, 0xe6, 0x2e }, { 0x2e, 0x26, 0xe7, 0x2e }, { 0x2e, 0x27, 0xe8, 0x2e }, { 0x2e, 0x28, 0xe9, 0x2e }, { 0x2e, 0x29, 0xea, 0x2e }, { 0x2e, 0x2a, 0xeb, 0x2e }, { 0x2e, 0x2b, 0xec, 0x2e }, { 0x2e, 0x2c, 0xed, 0x2e }, { 0x2e, 0x2d, 0xee, 0x2f }, { 0x2e, 0x2e, 0xef, 0x2f }, { 0x2e, 0x2f, 0xf0, 0x2f }, { 0x2e, 0x20, 0xf1, 0x2f }, { 0x2f, 0x21, 0xf2, 0x2f }, { 0x2f, 0x22, 0xf3, 0x2f }, { 0x2f, 0x23, 0xf4, 0x2f }, { 0x2f, 0x24, 0xf5, 0x2f }, { 0x2f, 0x25, 0xf6, 0x2f }, { 0x2f, 0x26, 0xf7, 0x2f }, { 0x2f, 0x27, 0xf8, 0x2f }, { 0x2f, 0x28, 0xf9, 0x2f }, { 0x2f, 0x29, 0xfa, 0x2f }, { 0x2f, 0x2a, 0xfb, 0x2f }, { 0x2f, 0x2b, 0xfc, 0x2f }, { 0x2f, 0x2c, 0xfd, 0x2f }, { 0x2f, 0x2d, 0xfe, 0x30 }, { 0x2f, 0x2e, 0xff, 0x30 }, { 0x2f, 0x2f, 0x00, 0x30 }, { 0x2f, 0x30, 0x01, 0x30 }, { 0x30, 0x31, 0x02, 0x30 }, { 0x30, 0x32, 0x03, 0x30 }, { 0x30, 0x33, 0x04, 0x30 }, { 0x30, 0x34, 0x05, 0x30 }, { 0x30, 0x35, 0x06, 0x30 }, { 0x30, 0x36, 0x07, 0x30 }, { 0x30, 0x37, 0x08, 0x30 }, { 0x30, 0x38, 0x09, 0x30 }, { 0x30, 0x39, 0x0a, 0x30 }, { 0x30, 0x3a, 0x0b, 0x30 }, { 0x30, 0x3b, 0x0c, 0x30 }, { 0x30, 0x3c, 0x0d, 0x30 }, { 0x30, 0x3d, 0x0e, 0x31 }, { 0x30, 0x3e, 0x0f, 0x31 }, { 0x30, 0x3f, 0x10, 0x31 }, { 0x30, 0x30, 0x11, 0x31 }, { 0x31, 0x31, 0x12, 0x31 }, { 0x31, 0x32, 0x13, 0x31 }, { 0x31, 0x33, 0x14, 0x31 }, { 0x31, 0x34, 0x15, 0x31 }, { 0x31, 0x35, 0x16, 0x31 }, { 0x31, 0x36, 0x17, 0x31 }, { 0x31, 0x37, 0x18, 0x31 }, { 0x31, 0x38, 0x19, 0x31 }, { 0x31, 0x39, 0x1a, 0x31 }, { 0x31, 0x3a, 0x1b, 0x31 }, { 0x31, 0x3b, 0x1c, 0x31 }, { 0x31, 0x3c, 0x1d, 0x31 }, { 0x31, 0x3d, 0x1e, 0x32 }, { 0x31, 0x3e, 0x1f, 0x32 }, { 0x31, 0x3f, 0x20, 0x32 }, { 0x31, 0x30, 0x21, 0x32 }, { 0x32, 0x31, 0x22, 0x32 }, { 0x32, 0x32, 0x23, 0x32 }, { 0x32, 0x33, 0x24, 0x32 }, { 0x32, 0x34, 0x25, 0x32 }, { 0x32, 0x35, 0x26, 0x32 }, { 0x32, 0x36, 0x27, 0x32 }, { 0x32, 0x37, 0x28, 0x32 }, { 0x32, 0x38, 0x29, 0x32 }, { 0x32, 0x39, 0x2a, 0x32 }, { 0x32, 0x3a, 0x2b, 0x32 }, { 0x32, 0x3b, 0x2c, 0x32 }, { 0x32, 0x3c, 0x2d, 0x32 }, { 0x32, 0x3d, 0x2e, 0x33 }, { 0x32, 0x3e, 0x2f, 0x33 }, { 0x32, 0x3f, 0x30, 0x33 }, { 0x32, 0x30, 0x31, 0x33 }, { 0x33, 0x31, 0x32, 0x33 }, { 0x33, 0x32, 0x33, 0x33 }, { 0x33, 0x33, 0x34, 0x33 }, { 0x33, 0x34, 0x35, 0x33 }, { 0x33, 0x35, 0x36, 0x33 }, { 0x33, 0x36, 0x37, 0x33 }, { 0x33, 0x37, 0x38, 0x33 }, { 0x33, 0x38, 0x39, 0x33 }, { 0x33, 0x39, 0x3a, 0x33 }, { 0x33, 0x3a, 0x3b, 0x33 }, { 0x33, 0x3b, 0x3c, 0x33 }, { 0x33, 0x3c, 0x3d, 0x33 }, { 0x33, 0x3d, 0x3e, 0x34 }, { 0x33, 0x3e, 0x3f, 0x34 }, { 0x33, 0x3f, 0x40, 0x34 }, { 0x33, 0x30, 0x41, 0x34 }, { 0x34, 0x31, 0x42, 0x34 }, { 0x34, 0x32, 0x43, 0x34 }, { 0x34, 0x33, 0x44, 0x34 }, { 0x34, 0x34, 0x45, 0x34 }, { 0x34, 0x35, 0x46, 0x34 }, { 0x34, 0x36, 0x47, 0x34 }, { 0x34, 0x37, 0x48, 0x34 }, { 0x34, 0x38, 0x49, 0x34 }, { 0x34, 0x39, 0x4a, 0x34 }, { 0x34, 0x3a, 0x4b, 0x34 }, { 0x34, 0x3b, 0x4c, 0x34 }, { 0x34, 0x3c, 0x4d, 0x34 }, { 0x34, 0x3d, 0x4e, 0x35 }, { 0x34, 0x3e, 0x4f, 0x35 }, { 0x34, 0x3f, 0x50, 0x35 }, { 0x34, 0x30, 0x51, 0x35 }, { 0x35, 0x31, 0x52, 0x35 }, { 0x35, 0x32, 0x53, 0x35 }, { 0x35, 0x33, 0x54, 0x35 }, { 0x35, 0x34, 0x55, 0x35 }, { 0x35, 0x35, 0x56, 0x35 }, { 0x35, 0x36, 0x57, 0x35 }, { 0x35, 0x37, 0x58, 0x35 }, { 0x35, 0x38, 0x59, 0x35 }, { 0x35, 0x39, 0x5a, 0x35 }, { 0x35, 0x3a, 0x5b, 0x35 }, { 0x35, 0x3b, 0x5c, 0x35 }, { 0x35, 0x3c, 0x5d, 0x35 }, { 0x35, 0x3d, 0x5e, 0x36 }, { 0x35, 0x3e, 0x5f, 0x36 }, { 0x35, 0x3f, 0x60, 0x36 }, { 0x35, 0x30, 0x61, 0x36 }, { 0x36, 0x31, 0x62, 0x36 }, { 0x36, 0x32, 0x63, 0x36 }, { 0x36, 0x33, 0x64, 0x36 }, { 0x36, 0x34, 0x65, 0x36 }, { 0x36, 0x35, 0x66, 0x36 }, { 0x36, 0x36, 0x67, 0x36 }, { 0x36, 0x37, 0x68, 0x36 }, { 0x36, 0x38, 0x69, 0x36 }, { 0x36, 0x39, 0x6a, 0x36 }, { 0x36, 0x3a, 0x6b, 0x36 }, { 0x36, 0x3b, 0x6c, 0x36 }, { 0x36, 0x3c, 0x6d, 0x36 }, { 0x36, 0x3d, 0x6e, 0x37 }, { 0x36, 0x3e, 0x6f, 0x37 }, { 0x36, 0x3f, 0x70, 0x37 }, { 0x36, 0x30, 0x71, 0x37 }, { 0x37, 0x31, 0x72, 0x37 }, { 0x37, 0x32, 0x73, 0x37 }, { 0x37, 0x33, 0x74, 0x37 }, { 0x37, 0x34, 0x75, 0x37 }, { 0x37, 0x35, 0x76, 0x37 }, { 0x37, 0x36, 0x77, 0x37 }, { 0x37, 0x37, 0x78, 0x37 }, { 0x37, 0x38, 0x79, 0x37 }, { 0x37, 0x39, 0x7a, 0x37 }, { 0x37, 0x3a, 0x7b, 0x37 }, { 0x37, 0x3b, 0x7c, 0x37 }, { 0x37, 0x3c, 0x7d, 0x37 }, { 0x37, 0x3d, 0x7e, 0x38 }, { 0x37, 0x3e, 0x7f, 0x38 }, { 0x37, 0x3f, 0x80, 0x38 }, { 0x37, 0x30, 0x81, 0x38 }, { 0x38, 0x31, 0x82, 0x38 }, { 0x38, 0x32, 0x83, 0x38 }, { 0x38, 0x33, 0x84, 0x38 }, { 0x38, 0x34, 0x85, 0x38 }, { 0x38, 0x35, 0x86, 0x38 }, { 0x38, 0x36, 0x87, 0x38 }, { 0x38, 0x37, 0x88, 0x38 }, { 0x38, 0x38, 0x89, 0x38 }, { 0x38, 0x39, 0x8a, 0x38 }, { 0x38, 0x3a, 0x8b, 0x38 }, { 0x38, 0x3b, 0x8c, 0x38 }, { 0x38, 0x3c, 0x8d, 0x38 }, { 0x38, 0x3d, 0x8e, 0x39 }, { 0x38, 0x3e, 0x8f, 0x39 }, { 0x38, 0x3f, 0x90, 0x39 }, { 0x38, 0x30, 0x91, 0x39 }, { 0x39, 0x31, 0x92, 0x39 }, { 0x39, 0x32, 0x93, 0x39 }, { 0x39, 0x33, 0x94, 0x39 }, { 0x39, 0x34, 0x95, 0x39 }, { 0x39, 0x35, 0x96, 0x39 }, { 0x39, 0x36, 0x97, 0x39 }, { 0x39, 0x37, 0x98, 0x39 }, { 0x39, 0x38, 0x99, 0x39 }, { 0x39, 0x39, 0x9a, 0x39 }, { 0x39, 0x3a, 0x9b, 0x39 }, { 0x39, 0x3b, 0x9c, 0x39 }, { 0x39, 0x3c, 0x9d, 0x39 }, { 0x39, 0x3d, 0x9e, 0x3a }, { 0x39, 0x3e, 0x9f, 0x3a }, { 0x39, 0x3f, 0xa0, 0x3a }, { 0x39, 0x30, 0xa1, 0x3a }, { 0x3a, 0x31, 0xa2, 0x3a }, { 0x3a, 0x32, 0xa3, 0x3a }, { 0x3a, 0x33, 0xa4, 0x3a }, { 0x3a, 0x34, 0xa5, 0x3a }, { 0x3a, 0x35, 0xa6, 0x3a }, { 0x3a, 0x36, 0xa7, 0x3a }, { 0x3a, 0x37, 0xa8, 0x3a }, { 0x3a, 0x38, 0xa9, 0x3a }, { 0x3a, 0x39, 0xaa, 0x3a }, { 0x3a, 0x3a, 0xab, 0x3a }, { 0x3a, 0x3b, 0xac, 0x3a }, { 0x3a, 0x3c, 0xad, 0x3a }, { 0x3a, 0x3d, 0xae, 0x3b }, { 0x3a, 0x3e, 0xaf, 0x3b }, { 0x3a, 0x3f, 0xb0, 0x3b }, { 0x3a, 0x30, 0xb1, 0x3b }, { 0x3b, 0x31, 0xb2, 0x3b }, { 0x3b, 0x32, 0xb3, 0x3b }, { 0x3b, 0x33, 0xb4, 0x3b }, { 0x3b, 0x34, 0xb5, 0x3b }, { 0x3b, 0x35, 0xb6, 0x3b }, { 0x3b, 0x36, 0xb7, 0x3b }, { 0x3b, 0x37, 0xb8, 0x3b }, { 0x3b, 0x38, 0xb9, 0x3b }, { 0x3b, 0x39, 0xba, 0x3b }, { 0x3b, 0x3a, 0xbb, 0x3b }, { 0x3b, 0x3b, 0xbc, 0x3b }, { 0x3b, 0x3c, 0xbd, 0x3b }, { 0x3b, 0x3d, 0xbe, 0x3c }, { 0x3b, 0x3e, 0xbf, 0x3c }, { 0x3b, 0x3f, 0xc0, 0x3c }, { 0x3b, 0x30, 0xc1, 0x3c }, { 0x3c, 0x31, 0xc2, 0x3c }, { 0x3c, 0x32, 0xc3, 0x3c }, { 0x3c, 0x33, 0xc4, 0x3c }, { 0x3c, 0x34, 0xc5, 0x3c }, { 0x3c, 0x35, 0xc6, 0x3c }, { 0x3c, 0x36, 0xc7, 0x3c }, { 0x3c, 0x37, 0xc8, 0x3c }, { 0x3c, 0x38, 0xc9, 0x3c }, { 0x3c, 0x39, 0xca, 0x3c }, { 0x3c, 0x3a, 0xcb, 0x3c }, { 0x3c, 0x3b, 0xcc, 0x3c }, { 0x3c, 0x3c, 0xcd, 0x3c }, { 0x3c, 0x3d, 0xce, 0x3d }, { 0x3c, 0x3e, 0xcf, 0x3d }, { 0x3c, 0x3f, 0xd0, 0x3d }, { 0x3c, 0x30, 0xd1, 0x3d }, { 0x3d, 0x31, 0xd2, 0x3d }, { 0x3d, 0x32, 0xd3, 0x3d }, { 0x3d, 0x33, 0xd4, 0x3d }, { 0x3d, 0x34, 0xd5, 0x3d }, { 0x3d, 0x35, 0xd6, 0x3d }, { 0x3d, 0x36, 0xd7, 0x3d }, { 0x3d, 0x37, 0xd8, 0x3d }, { 0x3d, 0x38, 0xd9, 0x3d }, { 0x3d, 0x39, 0xda, 0x3d }, { 0x3d, 0x3a, 0xdb, 0x3d }, { 0x3d, 0x3b, 0xdc, 0x3d }, { 0x3d, 0x3c, 0xdd, 0x3d }, { 0x3d, 0x3d, 0xde, 0x3e }, { 0x3d, 0x3e, 0xdf, 0x3e }, { 0x3d, 0x3f, 0xe0, 0x3e }, { 0x3d, 0x30, 0xe1, 0x3e }, { 0x3e, 0x31, 0xe2, 0x3e }, { 0x3e, 0x32, 0xe3, 0x3e }, { 0x3e, 0x33, 0xe4, 0x3e }, { 0x3e, 0x34, 0xe5, 0x3e }, { 0x3e, 0x35, 0xe6, 0x3e }, { 0x3e, 0x36, 0xe7, 0x3e }, { 0x3e, 0x37, 0xe8, 0x3e }, { 0x3e, 0x38, 0xe9, 0x3e }, { 0x3e, 0x39, 0xea, 0x3e }, { 0x3e, 0x3a, 0xeb, 0x3e }, { 0x3e, 0x3b, 0xec, 0x3e }, { 0x3e, 0x3c, 0xed, 0x3e }, { 0x3e, 0x3d, 0xee, 0x3f }, { 0x3e, 0x3e, 0xef, 0x3f }, { 0x3e, 0x3f, 0xf0, 0x3f }, { 0x3e, 0x30, 0xf1, 0x3f }, { 0x3f, 0x31, 0xf2, 0x3f }, { 0x3f, 0x32, 0xf3, 0x3f }, { 0x3f, 0x33, 0xf4, 0x3f }, { 0x3f, 0x34, 0xf5, 0x3f }, { 0x3f, 0x35, 0xf6, 0x3f }, { 0x3f, 0x36, 0xf7, 0x3f }, { 0x3f, 0x37, 0xf8, 0x3f }, { 0x3f, 0x38, 0xf9, 0x3f }, { 0x3f, 0x39, 0xfa, 0x3f }, { 0x3f, 0x3a, 0xfb, 0x3f }, { 0x3f, 0x3b, 0xfc, 0x3f }, { 0x3f, 0x3c, 0xfd, 0x3f }, { 0x3f, 0x3d, 0xfe, 0x40 }, { 0x3f, 0x3e, 0xff, 0x40 }, { 0x3f, 0x3f, 0x00, 0x40 }, { 0x3f, 0x40, 0x01, 0x40 }, }; /* * Utils */ static void dump_Accumulator (GenefxAccumulator* g, int size) { int iter = 0; printf ("\t%3s %3s %3s %3s\n", "A", "R", "G", "B"); for(; iter < size; iter++) { printf ("\t[%4d]: %3x %3x %3x %3x\n", iter, g->RGB.a, g->RGB.r, g->RGB.g, g->RGB.b); g++; } return; } #if 0 /* * Operation_1, to be converted */ static void Xacc_blend_invsrccolor( int w, GenefxAccumulator* S, GenefxAccumulator Cacc, GenefxAccumulator* X) { // int w = gfxs->length; // GenefxAccumulator *X = gfxs->Xacc; if (S) { // GenefxAccumulator *S = gfxs->Sacc; while (w--) { if (!(X->RGB.a & 0xF000)) { X->RGB.r = ((0x100 - S->RGB.r) * X->RGB.r) >> 8; X->RGB.g = ((0x100 - S->RGB.g) * X->RGB.g) >> 8; X->RGB.b = ((0x100 - S->RGB.b) * X->RGB.b) >> 8; X->RGB.a = ((0x100 - S->RGB.a) * X->RGB.a) >> 8; } X++; S++; } } else { // GenefxAccumulator Cacc = gfxs->Cacc; Cacc.RGB.r = 0x100 - Cacc.RGB.r; Cacc.RGB.g = 0x100 - Cacc.RGB.g; Cacc.RGB.b = 0x100 - Cacc.RGB.b; Cacc.RGB.a = 0x100 - Cacc.RGB.a; while (w--) { if (!(X->RGB.a & 0xF000)) { X->RGB.r = (Cacc.RGB.r * X->RGB.r) >> 8; X->RGB.g = (Cacc.RGB.g * X->RGB.g) >> 8; X->RGB.b = (Cacc.RGB.b * X->RGB.b) >> 8; X->RGB.a = (Cacc.RGB.a * X->RGB.a) >> 8; } X++; } } } /* * Operation_2, to be converted */ static void Dacc_premultiply( int w, GenefxAccumulator* D) { // int w = gfxs->length; // GenefxAccumulator *D = gfxs->Dacc; while (w--) { if (!(D->RGB.a & 0xF000)) { register unsigned short Da = D->RGB.a + 1; D->RGB.r = (Da * D->RGB.r) >> 8; D->RGB.g = (Da * D->RGB.g) >> 8; D->RGB.b = (Da * D->RGB.b) >> 8; } D++; } } #endif int main (void) { //time_t t1,t2; //(void) time(&t1); GenefxAccumulator const_color = { .RGB = { .a = 0x80, .r = 0x80, .g = 0x80, .b = 0x80, } }; // printf ("[main] Initial conditions \n"); // dump_Accumulator (D, ACC_SIZE); //// dump_Accumulator (S, ACC_SIZE); // printf ("\n\n\n[main] Operation Dacc_premultiply\n"); Dacc_premultiply( ACC_SIZE, D); // printf ("[main] Results: Dacc_premultiply \n"); // dump_Accumulator (D, ACC_SIZE ); // printf ("\n\n\n[main] Operation Xacc_blend_invsrccolor \n"); Xacc_blend_invsrccolor( ACC_SIZE, S, const_color, D); // printf ("[main] Results: Xacc_blend_invsrccolor \n"); // dump_Accumulator (D, ACC_SIZE ); // printf ("\n\n\n[main] Operation Xacc_blend_invsrccolor_2 \n"); Xacc_blend_invsrccolor( ACC_SIZE, S, const_color, D); //// printf ("[main] Results: Xacc_blend_invsrccolor_2 \n"); // dump_Accumulator (D, ACC_SIZE ); //(void) time(&t2); //printf("\nexecution time : %lf sec \n\n",(float)(t2-t1)); return 0; } -------------- next part -------------- /* * Definitions */ typedef union { struct { unsigned short b; unsigned short g; unsigned short r; unsigned short a; } RGB; struct { unsigned short u; unsigned short v; unsigned short y; unsigned short a; } YUV; } GenefxAccumulator; /* * Operation_2, to be converted */ void Dacc_premultiply( int w, GenefxAccumulator* D) { // int w = gfxs->length; // GenefxAccumulator *D = gfxs->Dacc; while (w--) { if (!(D->RGB.a & 0xF000)) { register unsigned short Da = D->RGB.a + 1; D->RGB.r = (Da * D->RGB.r) >> 8; D->RGB.g = (Da * D->RGB.g) >> 8; D->RGB.b = (Da * D->RGB.b) >> 8; } D++; } } -------------- next part -------------- /* * Definitions */ typedef union { struct { unsigned short b; unsigned short g; unsigned short r; unsigned short a; } RGB; struct { unsigned short u; unsigned short v; unsigned short y; unsigned short a; } YUV; } GenefxAccumulator; /* * Operation_1, to be converted */ void Xacc_blend_invsrccolor( int w, GenefxAccumulator* S, GenefxAccumulator Cacc, GenefxAccumulator* X) { // int w = gfxs->length; // GenefxAccumulator *X = gfxs->Xacc; if (S) { // GenefxAccumulator *S = gfxs->Sacc; while (w--) { if (!(X->RGB.a & 0xF000)) { X->RGB.r = ((0x100 - S->RGB.r) * X->RGB.r) >> 8; X->RGB.g = ((0x100 - S->RGB.g) * X->RGB.g) >> 8; X->RGB.b = ((0x100 - S->RGB.b) * X->RGB.b) >> 8; X->RGB.a = ((0x100 - S->RGB.a) * X->RGB.a) >> 8; } X++; S++; } } else { // GenefxAccumulator Cacc = gfxs->Cacc; Cacc.RGB.r = 0x100 - Cacc.RGB.r; Cacc.RGB.g = 0x100 - Cacc.RGB.g; Cacc.RGB.b = 0x100 - Cacc.RGB.b; Cacc.RGB.a = 0x100 - Cacc.RGB.a; while (w--) { if (!(X->RGB.a & 0xF000)) { X->RGB.r = (Cacc.RGB.r * X->RGB.r) >> 8; X->RGB.g = (Cacc.RGB.g * X->RGB.g) >> 8; X->RGB.b = (Cacc.RGB.b * X->RGB.b) >> 8; X->RGB.a = (Cacc.RGB.a * X->RGB.a) >> 8; } X++; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm comaprisons.xls Type: application/vnd.ms-excel Size: 102400 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091114/6a8b2241/attachment-0001.xls From criswell at uiuc.edu Sat Nov 14 08:38:05 2009 From: criswell at uiuc.edu (John Criswell) Date: Sat, 14 Nov 2009 08:38:05 -0600 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4AFE749C.7040100@gmail.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> Message-ID: <4AFEC0CD.2060003@uiuc.edu> T?r?k Edwin wrote: > On 2009-11-14 00:57, John Criswell wrote: > >> Dear LLVMers, >> >> We are happy to announce an alpha release of the SAFECode compiler. It >> is now available for download from the LLVM public Subversion >> repository. SAFECode uses a set of analysis passes and program >> transformations to provide strong memory safety guarantees to C/C++ >> programs. Specifically, the safety guarantees are: >> >> > > Hi John, > > This is great news! > I'm reporting to you some problem I've found below, please tell me if > I'm doing anything wrong. > > The docs/Install.html however says this: > svn co http://llvm.org/svn/llvm-project/llvm/branches/release_16 llvm > > That looks like a typo and you meant release_26? > > Indeed! Sorry for that error; I've corrected it in the documentation. Thanks for catching that! I'll take a look at the other issues you've mentioned later (I'm working on a course project this weekend. :( ). -- John T. From coolhersh at gmail.com Sat Nov 14 09:02:13 2009 From: coolhersh at gmail.com (Hersh.S. Iyer) Date: Sat, 14 Nov 2009 10:02:13 -0500 Subject: [LLVMdev] CFG using LLVM Message-ID: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> Hi, I am a new user of LLVM. I am using it as the IR for a compiler for a subset of LUA. I have the .ll file ready and it executes fine when passed to the llvm interpreter. Now, I wish to perform a few optimizations to the code starting with dead code elimination. For this I would need the CFG. I am very new to all of this stuff. Please help me out guys. The way I want to proceed is to start at the top of the CFG and then find out the blocks reachable from here. At the end, if any basic block remains unreachable, then I would classify it as dead code. I read a few things about llvm passes and felt this could be made a pass. Please let me know what's the right and fastest way to do this. Regards, Hersh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091114/4b7ca78f/attachment.html From anton at korobeynikov.info Sat Nov 14 09:49:24 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Sat, 14 Nov 2009 18:49:24 +0300 Subject: [LLVMdev] CFG using LLVM In-Reply-To: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> References: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> Message-ID: > Now, I wish to perform a few optimizations to the code starting with dead > code elimination. LLVM already provides huge variety of optimization passes. Is there any specific reason why do you need to do a DCE by yourself? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From clattner at apple.com Sat Nov 14 10:22:53 2009 From: clattner at apple.com (Chris Lattner) Date: Sat, 14 Nov 2009 08:22:53 -0800 Subject: [LLVMdev] CFG using LLVM In-Reply-To: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> References: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> Message-ID: <326260C4-AF25-464F-9671-27E0A4109A92@apple.com> On Nov 14, 2009, at 7:02 AM, Hersh.S. Iyer wrote: > Hi, > > I am a new user of LLVM. I am using it as the IR for a compiler for a subset of LUA. > I have the .ll file ready and it executes fine when passed to the llvm interpreter. > > Now, I wish to perform a few optimizations to the code starting with dead code elimination. > For this I would need the CFG. I am very new to all of this stuff. Please help me out guys. Take a look at llvm/include/llvm/Support/CFG.h. Grep lib/Transforms/*/*.cpp for uses of pred_ for example. -Chris From eli.friedman at gmail.com Sat Nov 14 11:44:14 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Sat, 14 Nov 2009 09:44:14 -0800 Subject: [LLVMdev] CFG using LLVM In-Reply-To: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> References: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> Message-ID: On Sat, Nov 14, 2009 at 7:02 AM, Hersh.S. Iyer wrote: > Now, I wish to perform a few optimizations to the code starting with dead > code elimination. > For this I would need the CFG. I am very new to all of this stuff. Please > help me out guys. > The way I want to proceed is to start at the top of the CFG and then find > out the blocks > reachable from here. At the end, if any basic block remains unreachable, > then I would > classify it as dead code. I think the function RemoveUnreachableBlocksFromFn in lib/Transforms/Scalar/SimplifyCFGPass.cpp does the transformation you're describing. -Eli From nicholas at mxc.ca Sat Nov 14 11:54:26 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Sat, 14 Nov 2009 09:54:26 -0800 Subject: [LLVMdev] CFG using LLVM In-Reply-To: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> References: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> Message-ID: <4AFEEED2.9040507@mxc.ca> Hersh.S. Iyer wrote: > Hi, > > I am a new user of LLVM. I am using it as the IR for a compiler for a > subset of LUA. > I have the .ll file ready and it executes fine when passed to the llvm > interpreter. > > Now, I wish to perform a few optimizations to the code starting with > dead code elimination. > For this I would need the CFG. I am very new to all of this stuff. > Please help me out guys. > The way I want to proceed is to start at the top of the CFG and then > find out the blocks > reachable from here. At the end, if any basic block remains unreachable, > then I would > classify it as dead code. > > I read a few things about llvm passes and felt this could be made a > pass. Please let me > know what's the right and fastest way to do this. If what's you've got is a .ll file on disk and you're just wondering how to optimize it, use the 'opt' tool. The list of passes available in LLVM is here: http://llvm.org/docs/Passes.html . A good default selection is available through 'opt -std-compile-opts', and if your .ll file represents a whole program (ie., it includes main()) then you can run 'opt -std-link-opts' too. Nick From eocallaghan at auroraux.org Sat Nov 14 14:09:33 2009 From: eocallaghan at auroraux.org (Edward O'Callaghan) Date: Sat, 14 Nov 2009 20:09:33 +0000 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4AFEC0CD.2060003@uiuc.edu> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4AFEC0CD.2060003@uiuc.edu> Message-ID: <521640720911141209g6a44db7hd8c26f5735a48708@mail.gmail.com> WOW ! This is a truly fantastic project ! Great work ! I'll be interested to build and port this to AuroraUX. Keep up the great work, Cheer, Edward. :D 2009/11/14 John Criswell : > T?r?k Edwin wrote: >> On 2009-11-14 00:57, John Criswell wrote: >> >>> Dear LLVMers, >>> >>> We are happy to announce an alpha release of the SAFECode compiler. ?It >>> is now available for download from the LLVM public Subversion >>> repository. ?SAFECode uses a set of analysis passes and program >>> transformations to provide strong memory safety guarantees to C/C++ >>> programs. ?Specifically, the safety guarantees are: >>> >>> >> >> Hi John, >> >> This is great news! >> I'm reporting to you some problem I've found below, please tell me if >> I'm doing anything wrong. >> >> The docs/Install.html ?however says this: >> svn co http://llvm.org/svn/llvm-project/llvm/branches/release_16 llvm >> >> That looks like a typo and you meant release_26? >> >> > Indeed! ?Sorry for that error; I've corrected it in the documentation. > Thanks for catching that! > > I'll take a look at the other issues you've mentioned later (I'm working > on a course project this weekend. :( ). > > -- John T. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > -- -- Edward O'Callaghan http://www.auroraux.org/ eocallaghan at auroraux dot org From echristo at apple.com Sat Nov 14 15:40:40 2009 From: echristo at apple.com (Eric Christopher) Date: Sat, 14 Nov 2009 13:40:40 -0800 Subject: [LLVMdev] Very slow performance of lli on x86 In-Reply-To: References: Message-ID: > > for -O3 results refer attachment. > time clang (-O0) llvm-gcc(-O0) gcc(-O0) > real 0m10.247s 0m11.324s 0m10.963s > user 0m2.644s 0m2.478s 0m2.263s > sys 0m5.949s 0m6.000s 0m5.953s > > llvm-jit > i used clang-cc -O0 -emit-llvm-bc to emit llvm bytecode and then passed it to opt tool and then linked all bytecode files to single bytecode using llvm-ld, i used lli tool to run this single bytecode file and noticed the following output > real 6m33.786s > user 5m12.612s > sys 1m1.205s > > why is lli taking such a loooong time to execute this particular piece of code.?? Something's wrong on your machine or something. I did the same (but using llvm-gcc for the .ll files). Using a debug build of current ToT I got this: [ghostwheel:~/Desktop] echristo% time ~/builds/build-llvm-64bit/Debug/bin/lli foo.bc.bc 0.210u 0.010s 0:00.22 100.0% 0+0k 0+0io 0pf+0w That's a 64-bit build, but you'll notice the time difference. That said I'm guessing that there's something missing since it takes no time to execute. Step by step directions on what you did might help. -eric From evan.cheng at apple.com Sat Nov 14 16:10:47 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 14 Nov 2009 14:10:47 -0800 Subject: [LLVMdev] Very slow performance of lli on x86 In-Reply-To: References: Message-ID: He is probably using the interpreter on a debug build. Evan On Nov 14, 2009, at 1:40 PM, Eric Christopher wrote: >> >> for -O3 results refer attachment. >> time clang (- >> O0) llvm-gcc(-O0) >> gcc(-O0) >> real >> 0m10.247s >> 0m11.324s 0m10.963s >> user >> 0m2.644s >> 0m2.478s 0m2.263s >> sys >> 0m5.949s >> 0m6.000s 0m5.953s >> >> llvm-jit >> i used clang-cc -O0 -emit-llvm-bc to emit llvm bytecode and then >> passed it to opt tool and then linked all bytecode files to single >> bytecode using llvm-ld, i used lli tool to run this single bytecode >> file and noticed the following output >> real 6m33.786s >> user 5m12.612s >> sys 1m1.205s >> >> why is lli taking such a loooong time to execute this particular >> piece of code.?? > > Something's wrong on your machine or something. I did the same (but > using llvm-gcc for the .ll files). Using a debug build of current > ToT I got this: > > [ghostwheel:~/Desktop] echristo% time ~/builds/build-llvm-64bit/ > Debug/bin/lli foo.bc.bc > 0.210u 0.010s 0:00.22 100.0% 0+0k 0+0io 0pf+0w > > > That's a 64-bit build, but you'll notice the time difference. That > said I'm guessing that there's something missing since it takes no > time to execute. Step by step directions on what you did might help. > > -eric > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From hhinnant at apple.com Sat Nov 14 17:16:23 2009 From: hhinnant at apple.com (Howard Hinnant) Date: Sat, 14 Nov 2009 18:16:23 -0500 Subject: [LLVMdev] next Message-ID: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> In many places there is code that looks like: MBBI = next(MBBI); In C++0X there is a std::next that is likely to be in scope when these calls are made. And due to ADL the above call becomes ambiguous: llvm::next or std::next? I recommend: MBBI = llvm::next(MBBI); -Howard From hhinnant at apple.com Sat Nov 14 17:23:38 2009 From: hhinnant at apple.com (Howard Hinnant) Date: Sat, 14 Nov 2009 18:23:38 -0500 Subject: [LLVMdev] Incomplete X86MachineFunctionInfo type Message-ID: In lib/Target/X86/X86COFFMachineModuleInfo.h we have: class X86MachineFunctionInfo; ... class X86COFFMachineModuleInfo : public MachineModuleInfoImpl { ... typedef std::map FMFInfoMap; FMFInfoMap FunctionInfoMap; ... }; At this point in the translation unit X86MachineFunctionInfo is an incomplete type, yet it is being used to instantiate std::map. This is undefined behavior in C++03 (and C++0X) according to: 17.4.3.6 - Other functions [lib.res.on.functions], p2, b5 Unfortunately I am not familiar enough with this code to recommend a fix. However I do know that this will create portability problems with llvm. X86MachineFunctionInfo must not be incomplete at the point it is used to instantiate std::map. -Howard From lhames at gmail.com Sat Nov 14 22:38:29 2009 From: lhames at gmail.com (Lang Hames) Date: Sat, 14 Nov 2009 20:38:29 -0800 Subject: [LLVMdev] Crash in PBQP register allocator In-Reply-To: <728927c70911121629i5091b14ay1ae37dc5f0568d66@mail.gmail.com> References: <728927c70911121629i5091b14ay1ae37dc5f0568d66@mail.gmail.com> Message-ID: <728927c70911142038n133a45e4lb9f796c6af19d1a2@mail.gmail.com> Hi Sachin, Confirmed: This is being caused by a subtle issue in the heuristic PBQP solver. Specifically: R1/R2 reductions as currently implemented can, on rare occasions, lead to the heuristic solver failing to find a finite cost solution, even though one exists. The infinite cost solution will always be in violation of some rule of register allocation (failing to handle an interference, or spilling an infinite cost node for instance). There are several ways to fix the issue with the solver, but most would pesimmize allocation quality in the general case. I will look for a better solution when I return to the University of Sydney in a couple of weeks. In the mean time I have added an assert to the allocator to ensure that infinite cost solutions do not produce miscompilations. For programs which trigger the assert you'll just have to fall back on linear scan I'm afraid. (If you particularly want PBQP to work in the short term you could apply the following fix: Simply pre-color all infinite cost intervals and remove the register option from any live intervals with which they interfere). Cheers, Lang. On Thu, Nov 12, 2009 at 4:29 PM, Lang Hames wrote: > This looks like a bug in the PBQP solver. I'm currently investigating. > > Cheers, > Lang. > > On Thu, Nov 12, 2009 at 12:46 AM, ? wrote: >> Hi, >> >> >> >> Please see the two ?.ll? files attached. >> >> >> >> Command line used >> >> llc ?march=pic16 ??pre-RA-sched=list-burr ?regalloc=pbqp new.obc >> >> >> >> The above test case crashes only when I use the combination of list-burr >> scheduler and pbqp register allocator. If any of them (scheduler or register >> allocator) is replaced with some alternate then I don?t see the crash. >> >> >> >> I could not figure out the reason. Please provide some pointers to reasons >> of the crash. >> >> >> >> Regards >> >> Sachin >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > From j.prasanth.j at gmail.com Sun Nov 15 01:52:15 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Sun, 15 Nov 2009 13:22:15 +0530 Subject: [LLVMdev] Very slow performance of lli on x86 In-Reply-To: References: Message-ID: Hi all, LLVM is built without debug enabled. Also i am not forcing lli to use interpreter mode. so i dont think the reason is not because of debug build or interpreter mode. *step 1: * compiled the 3 files (generic_replica.c ,xacc.c and dacc.c) with clang-cc to llvm bytecode files using -emit-llvm-bc and (-O0/-O3) options *step 2:* bytecode obtained from step 1 (generic_replica.bc, xacc.bc and dacc.bc) is passed to opt tool using (-O0/-O3) options *step 3:* optimized bytecode obtained from step 2 (generic_replica.opt.bc, xacc.opt.bc and dacc.opt.c) is combinde to a single bytecode file (monolith.bc) using llvm-ld tool *step 4: * running monolith.bc for 10000 iterations using lli tool and measured the time. I also tried using llvm-gcc for emiting bytecode in step 1 but got almost the same output. As i have my entire setup in office i cant attach my makefile today. i will attach my entire setup tom once i get back to office. Also i will attach the configuration options i used for compiling LLVM. Let me know in case i am wrong anywhere. Thanks & Regards, Prasanth J On Sun, Nov 15, 2009 at 3:40 AM, Evan Cheng wrote: > He is probably using the interpreter on a debug build. > > Evan > > > On Nov 14, 2009, at 1:40 PM, Eric Christopher wrote: > > >>> for -O3 results refer attachment. >>> time clang (-O0) >>> llvm-gcc(-O0) gcc(-O0) >>> real 0m10.247s >>> 0m11.324s 0m10.963s >>> user 0m2.644s >>> 0m2.478s 0m2.263s >>> sys 0m5.949s >>> 0m6.000s 0m5.953s >>> >>> llvm-jit >>> i used clang-cc -O0 -emit-llvm-bc to emit llvm bytecode and then passed >>> it to opt tool and then linked all bytecode files to single bytecode using >>> llvm-ld, i used lli tool to run this single bytecode file and noticed the >>> following output >>> real 6m33.786s >>> user 5m12.612s >>> sys 1m1.205s >>> >>> why is lli taking such a loooong time to execute this particular piece of >>> code.?? >>> >> >> Something's wrong on your machine or something. I did the same (but using >> llvm-gcc for the .ll files). Using a debug build of current ToT I got this: >> >> [ghostwheel:~/Desktop] echristo% time >> ~/builds/build-llvm-64bit/Debug/bin/lli foo.bc.bc >> 0.210u 0.010s 0:00.22 100.0% 0+0k 0+0io 0pf+0w >> >> >> That's a 64-bit build, but you'll notice the time difference. That said >> I'm guessing that there's something missing since it takes no time to >> execute. Step by step directions on what you did might help. >> >> -eric >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091115/9f8c5d23/attachment.html From j.prasanth.j at gmail.com Sun Nov 15 01:55:53 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Sun, 15 Nov 2009 13:25:53 +0530 Subject: [LLVMdev] Very slow performance of lli on x86 In-Reply-To: References: Message-ID: Sorry i really forgot to mention one thing. I downloaded the X86 binaries of llvm+clang and llvm-gcc from llvm download site. i hope that is not a debug build. Prasanth J On Sun, Nov 15, 2009 at 1:22 PM, Prasanth J wrote: > Hi all, > > LLVM is built without debug enabled. Also i am not forcing lli to use > interpreter mode. so i dont think the reason is not because of debug build > or interpreter mode. > > > *step 1: * > compiled the 3 files (generic_replica.c ,xacc.c and dacc.c) with clang-cc > to llvm bytecode files using -emit-llvm-bc and (-O0/-O3) options > *step 2:* > bytecode obtained from step 1 (generic_replica.bc, xacc.bc and dacc.bc) is > passed to opt tool using (-O0/-O3) options > *step 3:* > optimized bytecode obtained from step 2 (generic_replica.opt.bc, > xacc.opt.bc and dacc.opt.c) is combinde to a single bytecode file > (monolith.bc) using llvm-ld tool > *step 4: * > running monolith.bc for 10000 iterations using lli tool and measured the > time. > > I also tried using llvm-gcc for emiting bytecode in step 1 but got almost > the same output. As i have my entire setup in office i cant attach my > makefile today. i will attach my entire setup tom once i get back to office. > Also i will attach the configuration options i used for compiling LLVM. Let > me know in case i am wrong anywhere. > > Thanks & Regards, > Prasanth J > > > > > > > On Sun, Nov 15, 2009 at 3:40 AM, Evan Cheng wrote: > >> He is probably using the interpreter on a debug build. >> >> Evan >> >> >> On Nov 14, 2009, at 1:40 PM, Eric Christopher wrote: >> >> >>>> for -O3 results refer attachment. >>>> time clang (-O0) >>>> llvm-gcc(-O0) gcc(-O0) >>>> real 0m10.247s >>>> 0m11.324s 0m10.963s >>>> user 0m2.644s >>>> 0m2.478s 0m2.263s >>>> sys 0m5.949s >>>> 0m6.000s 0m5.953s >>>> >>>> llvm-jit >>>> i used clang-cc -O0 -emit-llvm-bc to emit llvm bytecode and then passed >>>> it to opt tool and then linked all bytecode files to single bytecode using >>>> llvm-ld, i used lli tool to run this single bytecode file and noticed the >>>> following output >>>> real 6m33.786s >>>> user 5m12.612s >>>> sys 1m1.205s >>>> >>>> why is lli taking such a loooong time to execute this particular piece >>>> of code.?? >>>> >>> >>> Something's wrong on your machine or something. I did the same (but using >>> llvm-gcc for the .ll files). Using a debug build of current ToT I got this: >>> >>> [ghostwheel:~/Desktop] echristo% time >>> ~/builds/build-llvm-64bit/Debug/bin/lli foo.bc.bc >>> 0.210u 0.010s 0:00.22 100.0% 0+0k 0+0io 0pf+0w >>> >>> >>> That's a 64-bit build, but you'll notice the time difference. That said >>> I'm guessing that there's something missing since it takes no time to >>> execute. Step by step directions on what you did might help. >>> >>> -eric >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091115/a648657b/attachment.html From ofv at wanadoo.es Sun Nov 15 04:05:45 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Sun, 15 Nov 2009 11:05:45 +0100 Subject: [LLVMdev] Very slow performance of lli on x86 References: Message-ID: <87skcgcdc6.fsf@telefonica.net> Prasanth J writes: > LLVM is built without debug enabled. Also i am not forcing lli to use > interpreter mode. so i dont think the reason is not because of debug build > or interpreter mode. > > > *step 1: * > compiled the 3 files (generic_replica.c ,xacc.c and dacc.c) with clang-cc to > llvm bytecode files using -emit-llvm-bc and (-O0/-O3) options > *step 2:* > bytecode obtained from step 1 (generic_replica.bc, xacc.bc and dacc.bc) is > passed to opt tool using (-O0/-O3) options > *step 3:* > optimized bytecode obtained from step 2 (generic_replica.opt.bc, xacc.opt.bc > and dacc.opt.c) is combinde to a single bytecode file (monolith.bc) using > llvm-ld tool > *step 4: * > running monolith.bc for 10000 iterations using lli tool and measured the > time. So if I understand you correctly, you build executables with llvm-gcc and clang, and ran it 10000 times taking about 10 seconds. Then you generate some .bc files, combine and optimized them, and invoke lli 10000 times with the resulting .bc file. lli needs to generate the native code from the .bc file each time you invoke it, so it is not a fair comparision, unless you are testing lli's native code generation speed. So if your program executes fast (<1 ms) when compiled with llvm-gcc but have a moderately large (a few KB) .bc file, that could explain why lli seems slow. If the .bc file is short then, for some unknown reason, lli may be using the interpreter instead of generating and running native code. Which operative system do you use? How long is the .bc file you pass to lli? What's the output of running your .bc file passing the command line option -stats to lli? Is there any difference if you pass to lli the -force-interpreter option too? > I also tried using llvm-gcc for emiting bytecode in step 1 but got almost > the same output. As i have my entire setup in office i cant attach my > makefile today. i will attach my entire setup tom once i get back to office. > Also i will attach the configuration options i used for compiling LLVM. Let > me know in case i am wrong anywhere. -- ?scar From gvenn.cfe.dev at gmail.com Sun Nov 15 05:42:20 2009 From: gvenn.cfe.dev at gmail.com (Garrison Venn) Date: Sun, 15 Nov 2009 06:42:20 -0500 Subject: [LLVMdev] [cfe-dev] Very slow performance of lli on x86 In-Reply-To: References: Message-ID: <1943A945-8FFB-44C8-BA2B-A7B503BA17B0@gmail.com> Granted I'm not up on using bit code files, but I don't believe the debug build affects whether or not the jit is used (non-interpretive mode). Ignoring other debug build effects on the efficiency of the jitted code, it would be interesting if you also could measure the time to jit--don't actually execute the 10000 iteration. I don't believe this would explain the time scale shown, but it should have some effect. To my mind, the proffered time scale also implies interpretive mode which you might be able to force to see if this is the culprit. I'll help test when you supply the build (make files). Garrison On Nov 15, 2009, at 2:55, Prasanth J wrote: > Sorry i really forgot to mention one thing. I downloaded the X86 > binaries of llvm+clang and llvm-gcc from llvm download site. i hope > that is not a debug build. > > Prasanth J > > > > > > On Sun, Nov 15, 2009 at 1:22 PM, Prasanth J > wrote: > Hi all, > > LLVM is built without debug enabled. Also i am not forcing lli to > use interpreter mode. so i dont think the reason is not because of > debug build or interpreter mode. > > > step 1: > compiled the 3 files (generic_replica.c ,xacc.c and dacc.c) with > clang-cc to llvm bytecode files using -emit-llvm-bc and (-O0/-O3) > options > step 2: > bytecode obtained from step 1 (generic_replica.bc, xacc.bc and > dacc.bc) is passed to opt tool using (-O0/-O3) options > step 3: > optimized bytecode obtained from step 2 (generic_replica.opt.bc, > xacc.opt.bc and dacc.opt.c) is combinde to a single bytecode file > (monolith.bc) using llvm-ld tool > step 4: > running monolith.bc for 10000 iterations using lli tool and measured > the time. > > I also tried using llvm-gcc for emiting bytecode in step 1 but got > almost the same output. As i have my entire setup in office i cant > attach my makefile today. i will attach my entire setup tom once i > get back to office. Also i will attach the configuration options i > used for compiling LLVM. Let me know in case i am wrong anywhere. > > Thanks & Regards, > Prasanth J > > > > > > > On Sun, Nov 15, 2009 at 3:40 AM, Evan Cheng > wrote: > He is probably using the interpreter on a debug build. > > Evan > > > On Nov 14, 2009, at 1:40 PM, Eric Christopher > wrote: > > > for -O3 results refer attachment. > time clang (- > O0) llvm-gcc(-O0) > gcc(-O0) > real > 0m10.247s > 0m11.324s 0m10.963s > user > 0m2.644s > 0m2.478s 0m2.263s > sys > 0m5.949s > 0m6.000s 0m5.953s > > llvm-jit > i used clang-cc -O0 -emit-llvm-bc to emit llvm bytecode and then > passed it to opt tool and then linked all bytecode files to single > bytecode using llvm-ld, i used lli tool to run this single bytecode > file and noticed the following output > real 6m33.786s > user 5m12.612s > sys 1m1.205s > > why is lli taking such a loooong time to execute this particular > piece of code.?? > > Something's wrong on your machine or something. I did the same (but > using llvm-gcc for the .ll files). Using a debug build of current > ToT I got this: > > [ghostwheel:~/Desktop] echristo% time ~/builds/build-llvm-64bit/ > Debug/bin/lli foo.bc.bc > 0.210u 0.010s 0:00.22 100.0% 0+0k 0+0io 0pf+0w > > > That's a 64-bit build, but you'll notice the time difference. That > said I'm guessing that there's something missing since it takes no > time to execute. Step by step directions on what you did might help. > > -eric > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > _______________________________________________ > cfe-dev mailing list > cfe-dev at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091115/e528d0d1/attachment.html From richard at xmos.com Sun Nov 15 13:18:45 2009 From: richard at xmos.com (Richard Osborne) Date: Sun, 15 Nov 2009 19:18:45 +0000 Subject: [LLVMdev] Matching an instruction that writes a specific register in a Pat<> Message-ID: <4B005415.2020107@xmos.com> I can match an instruction whose result is always written to a specific register using set with that register as the first operand in the DAG pattern of the instruction. For example on the XCore the result of the the ldap instruction is written to R11 and used to match the tglobaladdr node as follows: def LDAP_lu10 : _FLU10< (outs), (ins i32imm:$addr), "ldap r11, $addr", [(set R11, (pcrelwrapper tglobaladdr:$addr))]>; Is there anyway to get the same effect using a Pat<>? I'm asking because I want to use the same instruction for the new tblockaddress node. This means I have two patterns I want to specify, only one of which can be placed on the instruction definition. I haven't been able to figure out how to specify one of these using Pat<>. I can make things work by using two instruction definitions for the same instruction (allowing me to specify both patterns), but I wanted to check whether there was a better solution than duplicating the instruction definition in the .td file. Thanks, Richard From brukman at gmail.com Sun Nov 15 13:24:18 2009 From: brukman at gmail.com (Misha Brukman) Date: Sun, 15 Nov 2009 14:24:18 -0500 Subject: [LLVMdev] Sandboxing code In-Reply-To: <1d492d70911061228j1fc6d050v319812bbd2920017@mail.gmail.com> References: <1d492d70911061228j1fc6d050v319812bbd2920017@mail.gmail.com> Message-ID: 2009/11/6 P?ter Szil?gyi > I'm trying to explore what LLVM can and cannot be used for. One > thing I was wondering, whether it would be possible to execute an LLVM > code in a completely sandboxed environment? By sandboxed I mean that > the executed code should not have direct access to any system > resources (i.e. hard drive, networking, devices), only through some > specific API that I would provide. The idea is to be able to execute a > random LLVM code from the internet in a completely safe way (provided > that the specific code adheres to my libs in the first place... > otherwise it shouldn't even compile). > It is not the goal of LLVM to provide or enforce program safety. Other projects do this, either on top of the LLVM representation (e.g., SAFECode which John already mentioned) or on native code directly (e.g., Native Client: http://code.google.com/p/nativeclient/ ) -- so you'd have to compile LLVM to native code first. Misha -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091115/7183780e/attachment.html From echristo at apple.com Sun Nov 15 13:36:15 2009 From: echristo at apple.com (Eric Christopher) Date: Sun, 15 Nov 2009 11:36:15 -0800 Subject: [LLVMdev] Very slow performance of lli on x86 In-Reply-To: References: Message-ID: On Nov 14, 2009, at 11:52 PM, Prasanth J wrote: > step 4: > running monolith.bc for 10000 iterations using lli tool and measured the time. How are you doing this? -eric From blah32 at live.com Sun Nov 15 13:32:15 2009 From: blah32 at live.com (blah32) Date: Sun, 15 Nov 2009 11:32:15 -0800 (PST) Subject: [LLVMdev] create dummy function In-Reply-To: <278bcd900911050510n4584500eh269d4728a4907cf3@mail.gmail.com> References: <278bcd900911050230m2fedefbcu1edc9739e0da0de6@mail.gmail.com> <278bcd900911050510n4584500eh269d4728a4907cf3@mail.gmail.com> Message-ID: <26362436.post@talk.nabble.com> What exactly is M in that code you posted? Oleg Knut wrote: > > Thank you very much for you help, Renato! > > I read through paper you referred and also this document - > http://llvm.org/docs/tutorial/JITTutorial1.html > > Following these instructions to create successful function I run into > some problems: > 1) llvm::getGlobalContext() does not exists anymore? "llvm/LLVMContext.h" > too? > 2) creating instance of IRBuilder don't require template (from > tutorial paper - IRBuilder<> builder(block)) > > So, I believe this is just outdated information? I think it just need > some quick attention with getting materials up to date. > > In the end I got following code, that satisfy my needs: > > llvm::Constant* c = M.getOrInsertFunction(dummyFunctionName, > F.getFunctionType()); > llvm::Function* dummy = llvm::cast(c); > dummy->setLinkage(llvm::Function::ExternalLinkage); > dummy->setCallingConv(llvm::CallingConv::C); > llvm::BasicBlock* block = llvm::BasicBlock::Create("entry", dummy); > // no context needed > llvm::IRBuilder builder(block); // no need in <> > builder.CreateRetVoid(); > > Cheers, > Oleg. > > 2009/11/5 Renato Golin : >> 2009/11/5 Oleg Knut : >>> Hello, >>> I have a simple question. How to create "dummy" function which will >>> have no functionality behind (return nothing and do nothing)? >>> Currently I'm trying to do this: >>> >>> llvm::Constant* c = Module.getOrInsertFunction("dummy", >>> FunctionThatNeedsToBeReplaced.getFunctionType()); >>> llvm::Function* dummy = llvm::cast(c); >> >> Hi Oleg, >> >> Every function needs a BasicBlock, even if the basic block just >> contains a return. >> >> The only reason to create a function without a basic block is when the >> function is extern'd and imported via JIT, but I guess it's not what >> you're attempting. >> >> Try this presentation and let me know if it's helpful: >> >> http://www.systemcall.org/rengolin/stuff/compiler/download/LLVM-pet-project.pdf >> >> cheers, >> --renato >> >> Reclaim your digital rights, eliminate DRM, learn more at >> http://www.defectivebydesign.org/what_is_drm >> > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > -- View this message in context: http://old.nabble.com/create-dummy-function-tp26212354p26362436.html Sent from the LLVM - Dev mailing list archive at Nabble.com. From oleg77 at gmail.com Sun Nov 15 14:48:31 2009 From: oleg77 at gmail.com (Oleg Knut) Date: Sun, 15 Nov 2009 22:48:31 +0200 Subject: [LLVMdev] create dummy function In-Reply-To: <26362436.post@talk.nabble.com> References: <278bcd900911050230m2fedefbcu1edc9739e0da0de6@mail.gmail.com> <278bcd900911050510n4584500eh269d4728a4907cf3@mail.gmail.com> <26362436.post@talk.nabble.com> Message-ID: <278bcd900911151248y538575d9r887d4fe2d5c62f82@mail.gmail.com> M is llvm::Module instance. Cheers, Oleg. 2009/11/15 blah32 : > > What exactly is M in that code you posted? > > > > Oleg Knut wrote: >> >> Thank you very much for you help, Renato! >> >> I read through paper you referred and also this document - >> http://llvm.org/docs/tutorial/JITTutorial1.html >> >> Following these instructions to create successful function I run into >> some problems: >> 1) llvm::getGlobalContext() does not exists anymore? "llvm/LLVMContext.h" >> too? >> 2) creating instance of IRBuilder don't require template (from >> tutorial paper - IRBuilder<> builder(block)) >> >> So, I believe this is just outdated information? I think it just need >> some quick attention with getting materials up to date. >> >> In the end I got following code, that satisfy my needs: >> >> ? ? ? ? ? ? ? ? ? ? ? llvm::Constant* c = M.getOrInsertFunction(dummyFunctionName, >> F.getFunctionType()); >> ? ? ? ? ? ? ? ? ? ? ? llvm::Function* dummy = llvm::cast(c); >> ? ? ? ? ? ? ? ? ? ? ? dummy->setLinkage(llvm::Function::ExternalLinkage); >> ? ? ? ? ? ? ? ? ? ? ? dummy->setCallingConv(llvm::CallingConv::C); >> ? ? ? ? ? ? ? ? ? ? ? llvm::BasicBlock* block = llvm::BasicBlock::Create("entry", dummy); >> // no context needed >> ? ? ? ? ? ? ? ? ? ? ? llvm::IRBuilder builder(block); // no need in <> >> ? ? ? ? ? ? ? ? ? ? ? builder.CreateRetVoid(); >> >> Cheers, >> Oleg. >> >> 2009/11/5 Renato Golin : >>> 2009/11/5 Oleg Knut : >>>> Hello, >>>> I have a simple question. How to create "dummy" function which will >>>> have no functionality behind (return nothing and do nothing)? >>>> Currently I'm trying to do this: >>>> >>>> llvm::Constant* c = Module.getOrInsertFunction("dummy", >>>> FunctionThatNeedsToBeReplaced.getFunctionType()); >>>> llvm::Function* dummy = llvm::cast(c); >>> >>> Hi Oleg, >>> >>> Every function needs a BasicBlock, even if the basic block just >>> contains a return. >>> >>> The only reason to create a function without a basic block is when the >>> function is extern'd and imported via JIT, but I guess it's not what >>> you're attempting. >>> >>> Try this presentation and let me know if it's helpful: >>> >>> http://www.systemcall.org/rengolin/stuff/compiler/download/LLVM-pet-project.pdf >>> >>> cheers, >>> --renato >>> >>> Reclaim your digital rights, eliminate DRM, learn more at >>> http://www.defectivebydesign.org/what_is_drm >>> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > -- > View this message in context: http://old.nabble.com/create-dummy-function-tp26212354p26362436.html > Sent from the LLVM - Dev mailing list archive at Nabble.com. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From rengolin at systemcall.org Sun Nov 15 15:20:59 2009 From: rengolin at systemcall.org (Renato Golin) Date: Sun, 15 Nov 2009 21:20:59 +0000 Subject: [LLVMdev] Passes dependencies? Message-ID: I was reading this page: http://llvm.org/docs/Passes.html and there seems to be lots of passes that depend on others to produce consistent non-redundant code. For instance, the DIE must run after Simple constant propagation, Loop-Closed SSA Form Pass is mostly (only) useful for other passes, such as LoopUnswitching, and a few passes that leave a good mess, requiring other passes to run afterwards to clean up. Is there any map of dependencies/recommendations for the passes? Does clang/opt cares if the user tries to use one without the other (warning)? cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From eli.friedman at gmail.com Sun Nov 15 16:17:11 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Sun, 15 Nov 2009 14:17:11 -0800 Subject: [LLVMdev] Passes dependencies? In-Reply-To: References: Message-ID: On Sun, Nov 15, 2009 at 1:20 PM, Renato Golin wrote: > Is there any map of dependencies/recommendations for the passes? Does > clang/opt cares if the user tries to use one without the other > (warning)? Any arbitrary set of pass arguments should work; strong dependencies, are added automatically by the pass manager. You can see the passes which are getting implicitly added by passing "-debug-pass=Arguments" to opt; try running "opt -licm -debug-pass=Arguments < /dev/null -S" to get an idea of what happens here. Nothing will warn you if you do something silly like run -instcombine twice in a row, though. http://llvm.org/svn/llvm-project/llvm/trunk/include/llvm/Support/StandardPasses.h has the set of passes llvm-gcc, clang, and opt run for -O1/2/3; there are some useful comments there in terms of choosing which passes to run. -Eli From viridia at gmail.com Sun Nov 15 17:17:51 2009 From: viridia at gmail.com (Talin) Date: Sun, 15 Nov 2009 15:17:51 -0800 Subject: [LLVMdev] Quick question about assembly output Message-ID: I notice that when I assemble a .bc file into a .s (assembly) file, the symbol names that are generated are very different under different hosts OS's. For example, I have a symbol such as "main(tart.core.String[])->int". Under Darwin, the assembly output says "main(tart.core.String[])->int" (with quotes), but when I generate the assembly file under Linux I get "main_28_tart.core.String_5B__5D__29__2D__3E_int". It appears that something is translating all of the punctuation characters to escape sequences. My question is, can this be controlled and/or disabled? Given that I'm using the same assembler (Gnu) in both cases, is it really necessary? -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091115/cb79a897/attachment.html From anton at korobeynikov.info Sun Nov 15 17:41:54 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 16 Nov 2009 02:41:54 +0300 Subject: [LLVMdev] Quick question about assembly output In-Reply-To: References: Message-ID: > For example, I have a symbol such as "main(tart.core.String[])->int". Under > Darwin, the assembly output says "main(tart.core.String[])->int" (with > quotes), but when I generate the assembly file under Linux I get > "main_28_tart.core.String_5B__5D__29__2D__3E_int". It appears that something > is translating all of the punctuation characters to escape sequences. > My question is, can this be controlled and/or disabled? Given that I'm using > the same assembler (Gnu) in both cases, is it really necessary? Different file formats / assemblers have different restrictions on characters which can be used in symbol names. LLVM pass the stuff through the mangler to ensure that the output assemble properly. And this cannot be disabled if you really want the output to be usable :) And also you're not using the same assembler - darwin assembler is completely different from gnu. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From rengolin at systemcall.org Sun Nov 15 18:12:08 2009 From: rengolin at systemcall.org (Renato Golin) Date: Mon, 16 Nov 2009 00:12:08 +0000 Subject: [LLVMdev] Passes dependencies? In-Reply-To: References: Message-ID: 2009/11/15 Eli Friedman : > Any arbitrary set of pass arguments should work; strong dependencies, > are added automatically by the pass manager. That answers my question, thanks! Maybe some warnings (if enabled) to make sure not only the strong dependencies are met, but all of them. > Nothing will warn you if you do something silly like run -instcombine > twice in a row, though. I'd suspect that running N times the same pass won't change the code a single bit more than running once. cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From j.prasanth.j at gmail.com Mon Nov 16 00:44:50 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Mon, 16 Nov 2009 12:14:50 +0530 Subject: [LLVMdev] Very slow performance of lli on x86 In-Reply-To: References: Message-ID: Hi all, I have attached the complete test suite. it has different directories for gcc, llvm-gcc , clang and lli-clang. Source code , makefile and run script (contains number of times the program should execute) for each case are available inside each directory. * FOLLOWING ARE THE STATISTICS WHILE USING LLI FOR SINGLE ITERATION* ===-------------------------------------------------------------------------=== ... Statistics Collected ... ===-------------------------------------------------------------------------=== 58 dagcombine - Number of dag nodes combined 16384 jit - Number of bytes of global vars initialized 357 jit - Number of bytes of machine code compiled 2 jit - Number of global vars initialized 27 jit - Number of relocations applied 3 jit - Number of slabs of memory allocated by the JIT 105 liveintervals - Number of original intervals 21 loop-reduce - Number of IV uses strength reduced 4 loop-reduce - Number of PHIs inserted 2 loop-reduce - Number of loop terminating conds optimized 1 machine-licm - Number of machine instructions hoisted out of loops 4 phielim - Number of atomic phis lowered 2 regalloc - Number of copies coalesced 27 regalloc - Number of iterations performed 3 regcoalescing - Number of cross class joins performed 44 regcoalescing - Number of identity moves eliminated after coalescing 1 regcoalescing - Number of instructions re-materialized 40 regcoalescing - Number of interval joins performed 2 scalar-evolution - Number of loops with predictable loop counts 4 twoaddrinstr - Number of instructions aggressively commuted 6 twoaddrinstr - Number of instructions commuted to coalesce 3 twoaddrinstr - Number of instructions re-materialized 23 twoaddrinstr - Number of two-address instructions 2 virtregrewriter - Number of copies elided 1 x86-codegen - Number of floating point instructions 84 x86-emitter - Number of machine instructions emitted real 0m0.043s user 0m0.027s sys 0m0.010s *FOLLOWING ARE THE STATISTICS WHILE FORCING LLI TO USE INTERPRETER FOR SINGLE ITERATION* ===-------------------------------------------------------------------------=== ... Statistics Collected ... ===-------------------------------------------------------------------------=== 147495 interpreter - Number of dynamic instructions executed 17735 jit - Number of bytes of global vars initialized 49 jit - Number of global vars initialized real 0m0.083s user 0m0.078s sys 0m0.003s Even for single iteration the time take for execution is pretty high when compared to gcc, llvm-gcc and clang. What should be the expected behavior while using lli? As per my understanding as lli does runtime optimizations it should be faster than clang and llvm-gcc. am i right? *My machine details are* *Linux localhost.localdomain 2.6.25-14.fc9.i686 #1 SMP Thu May 1 06:28:41 EDT 2008 i686 i686 i386 GNU/Linux* *Memory : 1GB DDR2 CPU: Intel Pentium Dual-core @ 2.00 GHz* Please let me know how can i proceed with this test. Thanks and Regards, Prasanth J On Mon, Nov 16, 2009 at 1:06 AM, Eric Christopher wrote: > > On Nov 14, 2009, at 11:52 PM, Prasanth J wrote: > > > step 4: > > running monolith.bc for 10000 iterations using lli tool and measured the > time. > > How are you doing this? > > -eric -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/918a9562/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: generic_asm.tgz Type: application/x-gzip Size: 62726 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/918a9562/attachment-0001.tgz From evan.cheng at apple.com Mon Nov 16 00:49:42 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 15 Nov 2009 22:49:42 -0800 Subject: [LLVMdev] next In-Reply-To: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> Message-ID: I am pretty sure the .cpp files always explicitly use "llvm" namespace. Look for: using namespace llvm; Is that sufficient? Evan On Nov 14, 2009, at 3:16 PM, Howard Hinnant wrote: > In many places there is code that looks like: > > MBBI = next(MBBI); > > In C++0X there is a std::next that is likely to be in scope when these > calls are made. And due to ADL the above call becomes ambiguous: > llvm::next or std::next? > > I recommend: > > MBBI = llvm::next(MBBI); > > -Howard > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From yangx2000 at gmail.com Mon Nov 16 01:14:27 2009 From: yangx2000 at gmail.com (Xu Yang) Date: Mon, 16 Nov 2009 02:14:27 -0500 Subject: [LLVMdev] lli -force-interpreter complains about external function Message-ID: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> Hi: When I try to execute lli -force-interpreter=true hello.bc, it gave the following error: LLVM ERROR: Tried to execute an unknown external function: i32 (i8*)* puts I think the error is because C library is not being linked with the byte code, but I was not able to find any helpful instruction in lli's document. Can you please teach me how to do it? Thanks Xu The hello.bc is generated as the following: ======file: hello.c====== #include int main(int argc, char** argv){ printf("hello world\n"); return 0; } ==================== llvm-gcc -o hello.bc -emit-llvm -c hello.c This is the code in hello.bc (after llvm-dis): ================================== ; ModuleID = 'hello.bc' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i386-pc-linux-gnu" @.str = private constant [12 x i8] c"hello world\00", align 1 ; <[12 x i8]*> [#uses=1] define i32 @main(i32 %argc, i8** %argv) nounwind { entry: %argc_addr = alloca i32 ; [#uses=1] %argv_addr = alloca i8** ; [#uses=1] %retval = alloca i32 ; [#uses=2] %0 = alloca i32 ; [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] store i32 %argc, i32* %argc_addr store i8** %argv, i8*** %argv_addr %1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0)) nounwind ; [#uses=0] store i32 0, i32* %0, align 4 %2 = load i32* %0, align 4 ; [#uses=1] store i32 %2, i32* %retval, align 4 br label %return return: ; preds = %entry %retval1 = load i32* %retval ; [#uses=1] ret i32 %retval1 } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/1314fe99/attachment.html From nicholas at mxc.ca Mon Nov 16 01:23:53 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Sun, 15 Nov 2009 23:23:53 -0800 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> Message-ID: <4B00FE09.9020008@mxc.ca> Xu Yang wrote: > Hi: > > When I try to execute lli -force-interpreter=true hello.bc, it gave the > following error: > > LLVM ERROR: Tried to execute an unknown external function: i32 (i8*)* puts > > I think the error is because C library is not being linked with the byte > code, but I was not able to find any helpful instruction in lli's document. > > Can you please teach me how to do it? The interpreter uses libffi to make external function calls. However, it needs to be detected at LLVM's compile time. If you're using the released packages, we disabled that because we were worried about users who don't have libffi installed. In short, install libffi and rebuild LLVM. Nick > Thanks > Xu > > > The hello.bc is generated as the following: > > ======file: hello.c====== > #include > > > int main(int argc, char** argv){ > printf("hello world\n"); > return 0; > } > > ==================== > > > llvm-gcc -o hello.bc -emit-llvm -c hello.c > > > This is the code in hello.bc (after llvm-dis): > ================================== > ; ModuleID = 'hello.bc' > target datalayout = > "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" > target triple = "i386-pc-linux-gnu" > > @.str = private constant [12 x i8] c"hello world\00", align 1 ; <[12 x > i8]*> [#uses=1] > > define i32 @main(i32 %argc, i8** %argv) nounwind { > entry: > %argc_addr = alloca i32 ; [#uses=1] > %argv_addr = alloca i8** ; [#uses=1] > %retval = alloca i32 ; [#uses=2] > %0 = alloca i32 ; [#uses=2] > %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > store i32 %argc, i32* %argc_addr > store i8** %argv, i8*** %argv_addr > %1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str, i32 > 0, i32 0)) nounwind ; [#uses=0] > store i32 0, i32* %0, align 4 > %2 = load i32* %0, align 4 ; [#uses=1] > store i32 %2, i32* %retval, align 4 > br label %return > > return: ; preds = %entry > %retval1 = load i32* %retval ; [#uses=1] > ret i32 %retval1 > } > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev From rjmccall at apple.com Mon Nov 16 02:21:11 2009 From: rjmccall at apple.com (John McCall) Date: Mon, 16 Nov 2009 00:21:11 -0800 Subject: [LLVMdev] next In-Reply-To: References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> Message-ID: <4B010B77.7010107@apple.com> Evan Cheng wrote: > I am pretty sure the .cpp files always explicitly use "llvm" namespace. Look for: > using namespace llvm; > > Is that sufficient? > No; once it's visible through ADL (because ilist<>::iterator extends std::iterator) there's no hiding or precedence mechanism we can exploit. On the other hand, AFAICT std::next is interchangeable with llvm::next; we should be able to replace llvm::next with 'using std::next' in C++0x builds. John. From sebastian.redl at getdesigned.at Mon Nov 16 02:32:11 2009 From: sebastian.redl at getdesigned.at (Sebastian Redl) Date: Mon, 16 Nov 2009 09:32:11 +0100 Subject: [LLVMdev] next In-Reply-To: References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> Message-ID: <09cc593e5876912e3f0ee85eff881739@localhost> On Sun, 15 Nov 2009 22:49:42 -0800, Evan Cheng wrote: > I am pretty sure the .cpp files always explicitly use "llvm" namespace. > Look for: > using namespace llvm; > > Is that sufficient? > No. To prevent ADL from finding std::next, you need an explicitly qualified name at the call site. Sebastian From rnk at mit.edu Mon Nov 16 02:36:03 2009 From: rnk at mit.edu (Reid Kleckner) Date: Mon, 16 Nov 2009 03:36:03 -0500 Subject: [LLVMdev] next In-Reply-To: <4B010B77.7010107@apple.com> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> <4B010B77.7010107@apple.com> Message-ID: <9a9942200911160036p2bffdb64oc8c8baa46b94061a@mail.gmail.com> C++ newbie question: But doesn't all the code in LLVM avoid "using namespace std"? It seems like the solution is to just never use both the llvm and std namespace in the C++ file. Reid On Mon, Nov 16, 2009 at 3:21 AM, John McCall wrote: > Evan Cheng wrote: >> I am pretty sure the .cpp files always explicitly use "llvm" namespace. Look for: >> using namespace llvm; >> >> Is that sufficient? >> > > No; ?once it's visible through ADL (because ilist<>::iterator extends > std::iterator) there's no hiding or precedence mechanism we can > exploit. ?On the other hand, AFAICT std::next is interchangeable with > llvm::next; ?we should be able to replace llvm::next with 'using > std::next' in C++0x builds. > > John. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From xerxes at zafena.se Mon Nov 16 04:42:29 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Mon, 16 Nov 2009 11:42:29 +0100 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue - now the __sync_val_compare_and_swap issue - now the internal compiler error issue. In-Reply-To: References: <4AF80219.6090809@zafena.se> <4AFD68AD.9080200@zafena.se> Message-ID: <4B012C95.3030909@zafena.se> Prasanth J wrote: > Hi, > > As you said i downloaded arm toolchain from codesourcery(2009q3 with > gcc 4.4.1 version).. if i use this toolchain i am getting the > following error.. > > make[2]: Entering directory > `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis' > llvm[2]: Compiling LoopPass.cpp for Release build > if arm-none-linux-gnueabi-g++ > -I/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/include > -I/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis > -I/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/include > -I/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis > -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS > -O2 -fomit-frame-pointer -fno-exceptions -fPIC -Woverloaded-virtual > -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter > -Wwrite-strings -c -MMD -MP -MF > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp" > -MT > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o" > -MT > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d" > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp > -o > /home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o > ; \ > then /bin/mv -f > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp" > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d"; > else /bin/rm > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp"; > exit 1; fi > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp: > In member function 'void > llvm::LPPassManager::deleteLoopFromQueue(llvm::Loop*)': > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp:100: > internal compiler error: Segmentation fault > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. > /bin/rm: cannot remove > `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp': > No such file or directory > make[2]: *** > [/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o] > Error 1 > make[2]: Leaving directory > `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis' > make[1]: *** [Analysis/.makeall] Error 2 > make[1]: Leaving directory > `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib' > make: *** [all] Error 1 > > please let me know how should i resolve this error... > > Thanks and Regards, > Prasanth J > Make sure you are running a clean build. If you are then follow the suggested instructions in the error message and file a bugreport for your toolchain to codesourcery. /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp:100: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Cheers Xerxes From j.prasanth.j at gmail.com Mon Nov 16 04:55:10 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Mon, 16 Nov 2009 16:25:10 +0530 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue - now the __sync_val_compare_and_swap issue - now the internal compiler error issue. In-Reply-To: <4B012C95.3030909@zafena.se> References: <4AF80219.6090809@zafena.se> <4AFD68AD.9080200@zafena.se> <4B012C95.3030909@zafena.se> Message-ID: Hi, I can able to compile LLVM using armgcc_4.3.3 (codesourcery2009q1..).. but when i tried to run it on target it shows GCC 4.3.0 version not found. So i copied the runtime libraries (libc.so and libgcc_s.so) from the toolchain to the target and exported its path in LD_LIBRARY_PATH. But when i tried to run any llvm tools on target its crashing with Segmentation fault. What could be the problem for this. My target kernel and rootfs are compiled with armgcc-4.2.1... so should i need to compile the kernel and rootfs with armgcc-4.3.3? If i want to use arm-toolchain-4.2.1 , what should i do for clearing the instruction cache call in lib/System/Memory.cpp? Thanks and Regards, Prasanth J On Mon, Nov 16, 2009 at 4:12 PM, Xerxes R?nby wrote: > > Prasanth J wrote: > > Hi, > > > > As you said i downloaded arm toolchain from codesourcery(2009q3 with > > gcc 4.4.1 version).. if i use this toolchain i am getting the > > following error.. > > > > make[2]: Entering directory > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis' > > llvm[2]: Compiling LoopPass.cpp for Release build > > if arm-none-linux-gnueabi-g++ > > -I/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/include > > -I/home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis > > -I/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/include > > -I/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis > > -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS > > -O2 -fomit-frame-pointer -fno-exceptions -fPIC -Woverloaded-virtual > > -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter > > -Wwrite-strings -c -MMD -MP -MF > > > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp" > > -MT > > > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o" > > -MT > > > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d" > > > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp > > -o > > > /home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o > > ; \ > > then /bin/mv -f > > > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp" > > > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d"; > > else /bin/rm > > > "/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp"; > > exit 1; fi > > > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp: > > In member function 'void > > llvm::LPPassManager::deleteLoopFromQueue(llvm::Loop*)': > > > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp:100: > > internal compiler error: Segmentation fault > > Please submit a full bug report, > > with preprocessed source if appropriate. > > See for instructions. > > /bin/rm: cannot remove > > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.d.tmp': > > No such file or directory > > make[2]: *** > > > [/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis/Release/LoopPass.o] > > Error 1 > > make[2]: Leaving directory > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib/Analysis' > > make[1]: *** [Analysis/.makeall] Error 2 > > make[1]: Leaving directory > > `/home/prasanth/LLVM_ARM/llvm-with-armgcc441/llvm-obj/lib' > > make: *** [all] Error 1 > > > > please let me know how should i resolve this error... > > > > Thanks and Regards, > > Prasanth J > > > > Make sure you are running a clean build. > If you are then follow the suggested instructions in the error message > and file a bugreport for your toolchain to codesourcery. > > > /home/prasanth/LLVM_ARM/llvm-with-armgcc433/llvm/lib/Analysis/LoopPass.cpp:100: > internal compiler error: Segmentation fault > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. > > Cheers > Xerxes > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/ae7d6dc0/attachment.html From timo.lindfors at iki.fi Mon Nov 16 06:47:12 2009 From: timo.lindfors at iki.fi (Timo Juhani Lindfors) Date: Mon, 16 Nov 2009 14:47:12 +0200 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <4B00FE09.9020008@mxc.ca> (Nick Lewycky's message of "Sun, 15 Nov 2009 23:23:53 -0800") References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> <4B00FE09.9020008@mxc.ca> Message-ID: <84ws1q63hr.fsf@sauna.l.org> Nick Lewycky writes: > The interpreter uses libffi to make external function calls. However, it > needs to be detected at LLVM's compile time. If you're using the > released packages, we disabled that because we were worried about users > who don't have libffi installed. This seems to be quite a common problem (I too hit it once, thought it was a bug and reported it at http://llvm.org/bugs/show_bug.cgi?id=5466) how about making lli inform the user that LLVM was built without FFI support? From Ken.Dyck at onsemi.com Mon Nov 16 07:22:34 2009 From: Ken.Dyck at onsemi.com (Ken Dyck) Date: Mon, 16 Nov 2009 06:22:34 -0700 Subject: [LLVMdev] how to define a 24-bits register class In-Reply-To: References: <5f72161f0911130645p4cd7e103w4ec4459ca32dd192@mail.gmail.com> Message-ID: <8F2E4A8BCDA0B84DA6C9088EB5B27747A37478@NAMAIL.ad.onsemi.com> On Friday, November 13, 2009 11:29 AM, Chris Lattner wrote: > > On Nov 13, 2009, at 6:45 AM, ether zhhb wrote: > > > hi every one, > > > > i have a very strange cpu that have 24-bits reigsters, but > i cant see > > i24 in machine value type? and if defining it as MVT others will be > > ok? > > You'd want to add a new i24 MVT enum. Can this be done without breaking the other code generators? I recently tried going down this path for a back end that I'm working on and I found that it caused virtually all of the tests for the other code generators to fail. I have to admit that I didn't dig too deeply to figure out what was causing the failures. Once I realized that fixing it would require modifying the other back ends, I figured I should find a different solution. What I came up with was to define some ValueTypes of type 'Other' in the sizes that I need in my MyTarget.td file, like so: class MyTargetValueType : ValueType { string Namespace = "MyTargetMVT"; } def i24 : MyTargetValueType<24>; def i48 : MyTargetValueType<48>; def i56 : MyTargetValueType<56>; I haven't reached the point yet where I'm using these in instruction selection, so I have no idea whether this approach will actually work, but for the time being it seems to be. And it doesn't require any modifications to the other code generators. Is this a better solution? Or a dead end? -Ken From coolhersh at gmail.com Mon Nov 16 08:28:49 2009 From: coolhersh at gmail.com (Hersh.S. Iyer) Date: Mon, 16 Nov 2009 09:28:49 -0500 Subject: [LLVMdev] CFG using LLVM In-Reply-To: <4AFF0ACC.5000705@uiuc.edu> References: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> <4AFEC960.2020405@uiuc.edu> <663ee7320911140849g74f18bd2jc65d2bf07235c3d3@mail.gmail.com> <4AFF0ACC.5000705@uiuc.edu> Message-ID: <663ee7320911160628x67901eefv521241a14837432f@mail.gmail.com> I used successors to find the basic blocks that can be visited and those that cannot be reached. My pass just prints out those blocks which can be reached. The problem is that I want to include this in my compiler code rather than as a separate .cpp file which will perform the pass when I use 'opt'. I have seen that there is something called a PassManager class. Will this help me any way ? Basically, I want to run this pass on the functions and generate the optimized .ll file. Right now, the .ll file is generated without optimizations. Also, is there a way that I can make LLVM generate unreachable basic blocks ? I need to test my pass and not able to find suitable examples. Regards, Hersh On Sat, Nov 14, 2009 at 2:53 PM, John Criswell wrote: > Hersh.S. Iyer wrote: > >> Hi John, >> >> Thanks for the reply. >> I read the document and was able to write simple passes too. >> I used members of CFG.H to find the successor and predecessor of the >> blocks. >> So this way I get to know which blocks are reachable and which are not. >> All this said and done, if a block is not reachable, can I delete it? >> > In general, yes, I believe you can delete it, unless you want to optimize > programs that utilize undefined behavior (e.g., a program that manufactures > function pointers). > > There are more aggressive algorithms that perform constant propagation > along with dead code elimination; this can reveal basic blocks that are > reachable through conditional branches but for which the condition can be > proven constant if dead code is ignored. > >> The function pass goes over each function in the .ll code and finds basic >> blocks in them. So >> all I need to do is to create a new .ll file which is same as the old one >> except that the dead >> blocks are gone. >> The inbuilt passes won't work as I need to write my own pass. >> > Why do you need to write your own pass? Passes can be executed one after > another, so if you pass needs to do something else besides remove dead basic > blocks, you run the dead code elimination pass first and then your pass > after it. > > -- John T. > > Your help is appreciated. >> >> Thanks, >> Hersh >> >> On Sat, Nov 14, 2009 at 10:14 AM, John Criswell > criswell at uiuc.edu>> wrote: >> >> Hersh.S. Iyer wrote: >> >> Hi, >> >> I am a new user of LLVM. I am using it as the IR for a >> compiler for a subset of LUA. >> I have the .ll file ready and it executes fine when passed to >> the llvm interpreter. >> >> Welcome! >> >> >> Now, I wish to perform a few optimizations to the code >> starting with dead code elimination. >> For this I would need the CFG. I am very new to all of this >> stuff. Please help me out guys. >> The way I want to proceed is to start at the top of the CFG >> and then find out the blocks >> reachable from here. At the end, if any basic block remains >> unreachable, then I would >> classify it as dead code. >> >> LLVM already has at least two dead-code elimination passes (-dce >> and -adce); I believe it also has a pass to remove dead basic >> blocks. These can be run using the opt tool and can be >> incorporated into any tool that you're building. They're >> documented at http://llvm.org/docs/Passes.html. Is there a reason >> these won't work for your purpose? >> >> If you do need to write your own pass, you'll notice that the CFG >> of a function is explicit in the IR: each basic block ends with a >> terminator instruction which explicitly lists the successor basic >> blocks to which control flow can move. Assuming that you write a >> function pass (which is given a Function & reference as input), >> you can find the entry basic block by using the getEntryBlock() >> method and then follow the CFG by finding the basic block's >> terminator instruction (using the getTerminator() method) and then >> finding the successors listed in the terminator instruction (using >> the getSuccessor() method). >> >> You'll find doxygen (http://llvm.org/doxygen/hierarchy.html) >> invaluable in looking up what methods each class has and how to >> use them. >> >> Have you read the Programmer's Manual and the "How to Write an >> LLVM Pass" document? >> >> -- John T. >> >> >> I read a few things about llvm passes and felt this could be >> made a pass. Please let me >> know what's the right and fastest way to do this. >> >> Regards, >> Hersh >> >> >> >> >> >> -- >> HSIyer >> > > -- HSIyer -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/9a8a552b/attachment.html From daveed at vandevoorde.com Mon Nov 16 08:37:31 2009 From: daveed at vandevoorde.com (David Vandevoorde) Date: Mon, 16 Nov 2009 09:37:31 -0500 Subject: [LLVMdev] next In-Reply-To: <09cc593e5876912e3f0ee85eff881739@localhost> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> <09cc593e5876912e3f0ee85eff881739@localhost> Message-ID: <5FFEB84D-8E5B-40EF-96FA-6305FA9C543C@vandevoorde.com> On Nov 16, 2009, at 3:32 AM, Sebastian Redl wrote: > > On Sun, 15 Nov 2009 22:49:42 -0800, Evan Cheng > wrote: >> I am pretty sure the .cpp files always explicitly use "llvm" >> namespace. >> Look for: >> using namespace llvm; >> >> Is that sufficient? >> > > No. To prevent ADL from finding std::next, you need an explicitly > qualified name at the call site. An alternative is to parenthesize the function name. E.g.: MBBI = (next)(MBBI); // Disables ADL Daveed From xerxes at zafena.se Mon Nov 16 08:48:08 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Mon, 16 Nov 2009 15:48:08 +0100 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue - now the __sync_val_compare_and_swap issue - now the internal compiler error issue. In-Reply-To: References: <4AF80219.6090809@zafena.se> <4AFD68AD.9080200@zafena.se> <4B012C95.3030909@zafena.se> Message-ID: <4B016628.6090702@zafena.se> Prasanth J wrote: > Hi, > > I can able to compile LLVM using armgcc_4.3.3 (codesourcery2009q1..).. > but when i tried to run it on target it shows GCC 4.3.0 version not > found. So i copied the runtime libraries (libc.so and libgcc_s.so) > from the toolchain to the target and exported its path in > LD_LIBRARY_PATH. But when i tried to run any llvm tools on target its > crashing with Segmentation fault. What could be the problem for this. Impossible to know without debugging. whats the backtrace when running the program from inside the gnu debugger gdb? and what tools did you run. What command did you run that caused the crash? What are the output from llc -version and lli -version ? > > My target kernel and rootfs are compiled with armgcc-4.2.1... so > should i need to compile the kernel and rootfs with armgcc-4.3.3? Probably not needed. > > If i want to use arm-toolchain-4.2.1 , what should i do for clearing > the instruction cache call in lib/System/Memory.cpp? You have to implement it using inline assembler for GCC 4.2.1 and below to work. You can check the gcc sources to see how __clear_cache got implemeted in gcc 4.3.3 or check the arm reference manual (ARM ARM): http://www.arm.com/miscPDFs/14128.pdf Cheers Xerxes From sebastian.redl at getdesigned.at Mon Nov 16 08:53:38 2009 From: sebastian.redl at getdesigned.at (Sebastian Redl) Date: Mon, 16 Nov 2009 15:53:38 +0100 Subject: [LLVMdev] next In-Reply-To: <9a9942200911160036p2bffdb64oc8c8baa46b94061a@mail.gmail.com> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> <4B010B77.7010107@apple.com> <9a9942200911160036p2bffdb64oc8c8baa46b94061a@mail.gmail.com> Message-ID: <4B016772.80607@getdesigned.at> Reid Kleckner wrote: > C++ newbie question: But doesn't all the code in LLVM avoid "using > namespace std"? It seems like the solution is to just never use both > the llvm and std namespace in the C++ file. > The point of ADL is that it looks into namespaces based on argument types, whether you have using declarations/statements or not. Sebastian From ofv at wanadoo.es Mon Nov 16 08:51:03 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Mon, 16 Nov 2009 15:51:03 +0100 Subject: [LLVMdev] Very slow performance of lli on x86 References: Message-ID: <87iqdacylk.fsf@telefonica.net> Prasanth J writes: [snip] > FOLLOWING ARE THE STATISTICS WHILE USING LLI FOR SINGLE ITERATION* [snip] > real 0m0.043s 0.043 * 10000 = 430 seconds [snip] > Even for single iteration the time take for execution is pretty high when > compared to gcc, llvm-gcc and clang. > What should be the expected behavior while using lli? As per my > understanding as lli does runtime optimizations it should be faster than > clang and llvm-gcc. am i right? As explained on a previous message, lli translates the llvm bitecode to native code on each run. This is not comparable to gcc or clang, that creates a process which you run separately. I suspect that there are further reasons for not taking your test code as a meaningful benchmark (it seems to execute too fast, i.e. you are actually testing process creation performance for the clang and llvm-gcc and gcc parts). You can expect that as the test code grows, you will find larger differences among code executed with lli and code which was compiled into executable files. Not because the code generaed by lli is bad, but because it needs to generate the code on each run. [snip] -- ?scar From xerxes at zafena.se Mon Nov 16 08:59:37 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Mon, 16 Nov 2009 15:59:37 +0100 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue - now the __sync_val_compare_and_swap issue - now the internal compiler error issue. In-Reply-To: References: <4AF80219.6090809@zafena.se> <4AFD68AD.9080200@zafena.se> <4B012C95.3030909@zafena.se> Message-ID: <4B0168D9.1060104@zafena.se> Prasanth J wrote: > > If i want to use arm-toolchain-4.2.1 , what should i do for clearing > the instruction cache call in lib/System/Memory.cpp? > You can also look how other projects have solved this problem in the past: http://www.complang.tuwien.ac.at/viewcvs/cgi-bin/viewcvs.cgi/gforth/arch/arm/cacheflush-linux.c?rev=1.4 Here the clear cache are implemented using inline asm and a linux systemcall to be usable with gcc 4.2.1. Cheers Xerxes From criswell at uiuc.edu Mon Nov 16 09:11:03 2009 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Nov 2009 09:11:03 -0600 Subject: [LLVMdev] CFG using LLVM In-Reply-To: <663ee7320911160628x67901eefv521241a14837432f@mail.gmail.com> References: <663ee7320911140702x6b6b7b75q1e1ae76e3424665e@mail.gmail.com> <4AFEC960.2020405@uiuc.edu> <663ee7320911140849g74f18bd2jc65d2bf07235c3d3@mail.gmail.com> <4AFF0ACC.5000705@uiuc.edu> <663ee7320911160628x67901eefv521241a14837432f@mail.gmail.com> Message-ID: <4B016B87.7090201@uiuc.edu> Hersh.S. Iyer wrote: > I used successors to find the basic blocks that can be visited and > those that cannot be reached. > My pass just prints out those blocks which can be reached. The problem > is that I want to include > this in my compiler code rather than as a separate .cpp file which > will perform the pass when I use 'opt'. > I have seen that there is something called a PassManager class. Will > this help me any way ? > Basically, I want to run this pass on the functions and generate the > optimized .ll file. > Right now, the .ll file is generated without optimizations. Also, is > there a way that I can make > LLVM generate unreachable basic blocks ? I need to test my pass and > not able to find suitable examples. Yes, you can create a PassManager object and use it to run any number of LLVM analysis and transform passes from your own C++ program (there are hooks for C and other languages, too). For examples on how to use it, you can look at the source code of opt (found in the LLVM distribution), pa (found in the poolalloc distribution), or sc (found in the SAFECode distribution that I sent email to llvmdev about last Friday). As for your second question, I do not know how to convince LLVM to generate code for basic blocks that it has determined are unreachable. I suppose the easiest thing to do would be to make the unreachable basic blocks appear reachable so that they don't get eliminated. To do that, you would do the following: 1) Add a global constant variable that is assigned the value of zero. 2) Add a volatile load to the entry basic block. 3) Change the terminator instruction of the entry basic block so that it is a switch instruction that switches on the result of the volatile load. The 0 tag will cause it to branch to its original destination. Other tags will cause it to branch to the unreachable basic blocks. The basic blocks will still be unreachable, but because the load is volatile, LLVM won't optimize it away, and therefore, LLVM won't be able to tell that those blocks are unreachable. -- John T. > > Regards, > Hersh > > On Sat, Nov 14, 2009 at 2:53 PM, John Criswell > wrote: > > Hersh.S. Iyer wrote: > > Hi John, > > Thanks for the reply. > I read the document and was able to write simple passes too. > I used members of CFG.H to find the successor and predecessor > of the blocks. > So this way I get to know which blocks are reachable and which > are not. > All this said and done, if a block is not reachable, can I > delete it? > > In general, yes, I believe you can delete it, unless you want to > optimize programs that utilize undefined behavior (e.g., a program > that manufactures function pointers). > > There are more aggressive algorithms that perform constant > propagation along with dead code elimination; this can reveal > basic blocks that are reachable through conditional branches but > for which the condition can be proven constant if dead code is > ignored. > > The function pass goes over each function in the .ll code and > finds basic blocks in them. So > all I need to do is to create a new .ll file which is same as > the old one except that the dead > blocks are gone. > The inbuilt passes won't work as I need to write my own pass. > > Why do you need to write your own pass? Passes can be executed > one after another, so if you pass needs to do something else > besides remove dead basic blocks, you run the dead code > elimination pass first and then your pass after it. > > -- John T. > > Your help is appreciated. > > Thanks, > Hersh > > On Sat, Nov 14, 2009 at 10:14 AM, John Criswell > > >> wrote: > > Hersh.S. Iyer wrote: > > Hi, > > I am a new user of LLVM. I am using it as the IR for a > compiler for a subset of LUA. > I have the .ll file ready and it executes fine when > passed to > the llvm interpreter. > > Welcome! > > > Now, I wish to perform a few optimizations to the code > starting with dead code elimination. > For this I would need the CFG. I am very new to all of this > stuff. Please help me out guys. > The way I want to proceed is to start at the top of the CFG > and then find out the blocks > reachable from here. At the end, if any basic block remains > unreachable, then I would > classify it as dead code. > > LLVM already has at least two dead-code elimination passes > (-dce > and -adce); I believe it also has a pass to remove dead basic > blocks. These can be run using the opt tool and can be > incorporated into any tool that you're building. They're > documented at http://llvm.org/docs/Passes.html. Is there a > reason > these won't work for your purpose? > > If you do need to write your own pass, you'll notice that > the CFG > of a function is explicit in the IR: each basic block ends > with a > terminator instruction which explicitly lists the successor > basic > blocks to which control flow can move. Assuming that you > write a > function pass (which is given a Function & reference as input), > you can find the entry basic block by using the getEntryBlock() > method and then follow the CFG by finding the basic block's > terminator instruction (using the getTerminator() method) > and then > finding the successors listed in the terminator instruction > (using > the getSuccessor() method). > > You'll find doxygen (http://llvm.org/doxygen/hierarchy.html) > invaluable in looking up what methods each class has and how to > use them. > > Have you read the Programmer's Manual and the "How to Write an > LLVM Pass" document? > > -- John T. > > > I read a few things about llvm passes and felt this > could be > made a pass. Please let me > know what's the right and fastest way to do this. > > Regards, > Hersh > > > > > > -- > HSIyer > > > > > > -- > HSIyer From simmon12 at cs.uiuc.edu Mon Nov 16 12:09:05 2009 From: simmon12 at cs.uiuc.edu (Patrick Alexander Simmons) Date: Mon, 16 Nov 2009 12:09:05 -0600 Subject: [LLVMdev] [PATCH] ADT Fixups Message-ID: <4B019541.4090408@cs.uiuc.edu> Hello, I posted an earlier version of this patch some months ago and realized I've still been sitting on it. The earlier version of this patch was rejected for adding a cycle detection function to SCCIterator.h. This function is now removed. This patch makes the following changes: 1. Allow SCCIterator to work with GraphT types that are constant. 2. Allow SCCIterator to work with inverse graphs. 3. Fix an incorrect comment in GraphTraits.h (the type in the comment was given as GraphType* when it is actually const GraphType &). I think these changes should be pretty uncontroversial. Would someone with commit authority please apply this for me? --Patrick Index: include/llvm/ADT/SCCIterator.h =================================================================== --- include/llvm/ADT/SCCIterator.h (revision 88920) +++ include/llvm/ADT/SCCIterator.h (working copy) @@ -135,8 +135,8 @@ typedef scc_iterator _Self; // Provide static "constructors"... - static inline _Self begin(GraphT& G) { return _Self(GT::getEntryNode(G)); } - static inline _Self end (GraphT& G) { return _Self(); } + static inline _Self begin(const GraphT& G) { return _Self(GT::getEntryNode(G)); } + static inline _Self end (const GraphT& G) { return _Self(); } // Direct loop termination test (I.fini() is more efficient than I == end()) inline bool fini() const { @@ -185,15 +185,25 @@ // Global constructor for the SCC iterator. template -scc_iterator scc_begin(T G) { +scc_iterator scc_begin(const T& G) { return scc_iterator::begin(G); } template -scc_iterator scc_end(T G) { +scc_iterator scc_end(const T& G) { return scc_iterator::end(G); } +template +scc_iterator > scc_begin(const Inverse& G) { + return scc_iterator >::begin(G); +} + +template +scc_iterator > scc_end(const Inverse& G) { + return scc_iterator >::end(G); +} + } // End llvm namespace #endif Index: include/llvm/ADT/GraphTraits.h =================================================================== --- include/llvm/ADT/GraphTraits.h (revision 88920) +++ include/llvm/ADT/GraphTraits.h (working copy) @@ -30,7 +30,7 @@ // typedef NodeType - Type of Node in the graph // typedef ChildIteratorType - Type used to iterate over children in graph - // static NodeType *getEntryNode(GraphType *) + // static NodeType *getEntryNode(const GraphType &) // Return the entry node of the graph // static ChildIteratorType child_begin(NodeType *) From devang.patel at gmail.com Mon Nov 16 12:34:40 2009 From: devang.patel at gmail.com (Devang Patel) Date: Mon, 16 Nov 2009 10:34:40 -0800 Subject: [LLVMdev] Passes dependencies? In-Reply-To: References: Message-ID: <352a1fb20911161034g120484a3v1f5be0dabc6061bb@mail.gmail.com> On Sun, Nov 15, 2009 at 1:20 PM, Renato Golin wrote: > I was reading this page: > http://llvm.org/docs/Passes.html > > and there seems to be lots of passes that depend on others to produce > consistent non-redundant code. > > For instance, the DIE must run after Simple constant propagation, > Loop-Closed SSA Form Pass is mostly (only) useful for other passes, > such as LoopUnswitching, and a few passes that leave a good mess, > requiring other passes to run afterwards to clean up. Usually, a pass has two kind of dependencies. 1) Info it needs to do its job. e.g. loop info, dominator tree, alias analysis etc... A pass can request these requirements explicitly and pass manager will sequence appropriate passes to meet the requirement. 2) IR form it needs to identify pattern and do its job. E.g. loop unswitch. loop rotation. etc.. In such cases, these passes should be added in pass queue by the driver (clang, or opt, or llvm-gcc) before your pass. However, your pass should be able to gracefully handle (and skip code) if the incoming IR is not in suitable form. - Devang From dalej at apple.com Mon Nov 16 12:43:22 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 16 Nov 2009 10:43:22 -0800 Subject: [LLVMdev] next In-Reply-To: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> Message-ID: <997D8861-0ACD-4548-AEE3-F78901B858C9@apple.com> On Nov 14, 2009, at 3:16 PMPST, Howard Hinnant wrote: > In many places there is code that looks like: > > MBBI = next(MBBI); > > In C++0X there is a std::next that is likely to be in scope when these > calls are made. And due to ADL the above call becomes ambiguous: > llvm::next or std::next? > > I recommend: > > MBBI = llvm::next(MBBI); > > -Howard "next" is a popular name; if it breaks llvm, I'd expect this standards change to break a lot of existing code. Do you really want to do that? From hhinnant at apple.com Mon Nov 16 12:49:43 2009 From: hhinnant at apple.com (Howard Hinnant) Date: Mon, 16 Nov 2009 13:49:43 -0500 Subject: [LLVMdev] next In-Reply-To: <997D8861-0ACD-4548-AEE3-F78901B858C9@apple.com> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> <997D8861-0ACD-4548-AEE3-F78901B858C9@apple.com> Message-ID: <97A55633-B4C3-464E-A885-1710E59FE4E5@apple.com> On Nov 16, 2009, at 1:43 PM, Dale Johannesen wrote: > > On Nov 14, 2009, at 3:16 PMPST, Howard Hinnant wrote: > >> In many places there is code that looks like: >> >> MBBI = next(MBBI); >> >> In C++0X there is a std::next that is likely to be in scope when these >> calls are made. And due to ADL the above call becomes ambiguous: >> llvm::next or std::next? >> >> I recommend: >> >> MBBI = llvm::next(MBBI); >> >> -Howard > > "next" is a popular name; if it breaks llvm, I'd expect this standards change to break a lot of existing code. Do you really want to do that? I'm happy to open an LWG issue for you on this subject. Here are directions on submitting an issue: http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#submit_issue Please don't hesitate to ask me if these directions aren't clear (I'll likely update the directions from your feedback). Here is a link to the latest C++0X draft that your issue will be directing the LWG to modify: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n3000.pdf The inclusion of next() into C++0X wasn't my proposal, nor do I have the authority to pull it. But I can open an issue if you provide it to me, and the LWG will then consider taking the action suggested by the issue. -Howard From criswell at uiuc.edu Mon Nov 16 13:04:02 2009 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Nov 2009 13:04:02 -0600 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4AFE749C.7040100@gmail.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> Message-ID: <4B01A222.7020603@uiuc.edu> T?r?k Edwin wrote: > [snip] > > I applied the attached patch to make it compile on my box (Debian > x86_64), only to find out that x86_64 is not supported :( > This architecture is not supported by the pool allocator! > Aborted > Thanks for the patch. What options do I give to the patch command to apply it to the source code? Although there's no documentation about contributions to SAFECode as of yet, I'd like to follow the same policy that LLVM uses (notably that the copyright of contributions is passed to the University of Illinois). Is this acceptable to you? We haven't regularly tested SAFECode and Automatic Pool Allocation on 64 bit architectures, so while it may work, we can't say for certain that it will. This particular error is caused by the fact that the run-time does not know which allocator is best for allocating page-aligned sections of memory. If you modify getPages() in runtime/BitmapPoolAllocator/PageManager.cpp to use mmap(), posix_memalign(), or valloc(), then it will fix this error and allow you to continue experimenting with Poolalloc/SAFECode in 64-bit mode. Eventually, we should set up something in the configure script to find a usable default for this function. This would be a simple autoconf change; it just hasn't been high on the priority list. > I turned off Werror too because I was getting lots of aliasing violation > warnings (with g++ 4.3.4). > There are some "cast pointer to integer of different size" warnings, but > they're all in SVA, and thats the kernel stuff that has nothing to do > with safecode right? > Which code are you referring to? I don't believe any of the SVA specific code is compiled by default in the mainline SAFECode tree. > So I've built SAFEcode in a 32-bit chroot (I get the aliasing warnings > on 32-bit too). > > A simple test program works, however when trying to compile ClamAV I get > an error right on startup, and it aborts! > The docs say that if I don't use terminate it should go on. > The -terminate option used to work but broke during some refactoring of the error reporting code. Getting it to work again is on my TODO list. You can get the behavior you want, for now, by removing the abort() line from runtime/DebugRuntime/Report.cpp. As far as the ClamAV error, are you sure it's a false positive (i.e., a bug in SAFECode)? I ran SAFECode on the programs in MultiSource/Applications and found that quite a few programs have memory safety errors. In the case of ClamAV, a false positive might occur if 1) the memory object is allocated by a library linked in as native code, or 2) the memory object is allocated via some C library function that SAFECode doesn't recognize as an allocator (e.g., getenv() or getpwent()). Handling the latter requires some simple changes to the DSA analysis and SAFECode so that it treats these functions as allocators. > SAFECode:Violation Type 0x2 when accessing 0x832d228 at IP=0x812b531 > > =======+++++++ SAFECODE RUNTIME ALERT +++++++======= > = Error type : Invalid Free Error > = Program counter : 0x812b531 > = Faulting pointer : 0x832d228 > > Program received signal SIGABRT, Aborted. > 0xf7fdf430 in __kernel_vsyscall () > (gdb) bt > #0 0xf7fdf430 in __kernel_vsyscall () > #1 0xf7d713d0 in raise () from /lib/i686/cmov/libc.so.6 > #2 0xf7d74a85 in abort () from /lib/i686/cmov/libc.so.6 > #3 0x08214227 in > safecode::ReportMemoryViolation(safecode::ViolationInfo const*) () > #4 0xf7fccea0 in ?? () from /usr/lib/libstdc++.so.6 > Backtrace stopped: previous frame inner to this frame (corrupt stack?) > > I did compile ClamAV with -g, I even used -disable-opt for llvm-ld, but > I still don't see line number error there (according to the docs I should). > Hrm. Yes. This seems to be a missing feature. I think I can add it relatively easily. > $ ~/llvm2.6/obj32/projects/safecode/Release/bin/sc -rewrite-oob > clamscan.bc -o clamscan_sc3.bc > $ ~/llvm2.6/obj32/Release/bin/llc clamscan_sc3.bc -f > $ gcc -o clamscan_sc3 clamscan_sc3.s > ~/llvm2.6/obj32/projects/safecode/Release/lib/libsc_dbg_rt.a > ~/llvm2.6/obj32/projects/safecode/Release/lib/libpoolalloc_bitmap.a > -lstdc++ -lbz2 -pthread -lz ../libltdl/.libs/libltdlcS.o > > And I've built ClamAV like this: > $ ./configure CC=llvm-gcc --disable-shared > $ make CPPFLAGS="-O2 -g -emit-llvm" CFLAGS= > CCLD="/home/edwin/llvm2.6/obj32/Release/bin/llvm-ld -disable-opt" -j8 > > > If I use addr2line on the IP printed by SAFEcode, I get this, but I > don't see anything wrong there: > foreach_dirinpath > /home/edwin/clam/git/builds/sc/libltdl/../../../clamav-devel/libltdl/ltdl.c:717 > > If I use the system's libltdl I get an invalid freee error here: > optfree > /home/edwin/clam/git/builds/sc/clamscan/../../../clamav-devel/shared/optparser.c:612 > > Is there a way to disable these invalid free errors? They look like > false positives to me (valgrind doesn't report them). > Not currently. SAFECode should not have false positives. There is either a real error in ClamAV or a bug in SAFECode. > I can send you clamscan.bc (it is 2.3M gzipped) if you want to. > Let me first enhance the invalid free error reporting. That may help you narrow down what SAFECode thinks the problem is and may help rule out the possibility of a real memory error in ClamAV. After that, if SAFECode is still reporting an error, and you can't figure out why, I can add looking at the problem to my TODO list. > P.S.: should I send "bugs" like this to you directly, or report them on > LLVM bugzilla? > I think it's actually best to file bug reports for each individual issue. That way, we can track their progress, and they won't get lost in my email INBOX. Thanks again for giving SAFECode a test drive. I'll try to get the invalid free error reporting improved within the next day or two. If you can let me know how to apply your patch (patch < patchfile isn't working for me), that'd be great too. Thanks again! -- John T. > Best regards, > --Edwin > From coolhersh at gmail.com Mon Nov 16 13:25:25 2009 From: coolhersh at gmail.com (Hersh.S. Iyer) Date: Mon, 16 Nov 2009 14:25:25 -0500 Subject: [LLVMdev] extracting data and operands Message-ID: <663ee7320911161125o1a2fefb1td5ac85228d6d1763@mail.gmail.com> Hi, I wish to implement dead code elimination as a pass in llvm. This is not the same as unreachable block. For this, I plan to go ahead like this : In each function Identify the store and branch operations Identify the operands involved in these operations. Build the UD chain of these and check if there is any variable that is not used and mark its definition (the entire instruction) Delete all marked instructions. I have no clue how to do this using llvm. Any help would be greatly appreciated. Regards, Hersh -- HSIyer -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/d009cf05/attachment.html From rengolin at systemcall.org Mon Nov 16 13:43:18 2009 From: rengolin at systemcall.org (Renato Golin) Date: Mon, 16 Nov 2009 19:43:18 +0000 Subject: [LLVMdev] Passes dependencies? In-Reply-To: <352a1fb20911161034g120484a3v1f5be0dabc6061bb@mail.gmail.com> References: <352a1fb20911161034g120484a3v1f5be0dabc6061bb@mail.gmail.com> Message-ID: 2009/11/16 Devang Patel : > ? ?A pass can request these requirements explicitly and pass manager > will sequence appropriate passes to meet the requirement. So if two different passes request a third one independently, that third is going to run twice? > ? ?In such cases, these passes should be added in pass queue by the > driver (clang, or opt, or llvm-gcc) before your pass. However, your > pass should be able to gracefully handle (and skip code) if the > incoming IR is not in suitable form. This way, it's the caller responsibility to assure consistency, right? It could be possible that some required passes are not run if the caller doesn't do it properly. cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm From sebastian.redl at getdesigned.at Mon Nov 16 13:54:55 2009 From: sebastian.redl at getdesigned.at (Sebastian Redl) Date: Mon, 16 Nov 2009 20:54:55 +0100 Subject: [LLVMdev] next In-Reply-To: <97A55633-B4C3-464E-A885-1710E59FE4E5@apple.com> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> <997D8861-0ACD-4548-AEE3-F78901B858C9@apple.com> <97A55633-B4C3-464E-A885-1710E59FE4E5@apple.com> Message-ID: <4B01AE0F.9070406@getdesigned.at> Howard Hinnant wrote: > On Nov 16, 2009, at 1:43 PM, Dale Johannesen wrote: > > >> "next" is a popular name; if it breaks llvm, I'd expect this standards change to break a lot of existing code. Do you really want to do that? >> > > I'm happy to open an LWG issue for you on this subject. Here are directions on submitting an issue: > > http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#submit_issue > It may be premature, but a resolution for the issue would be the same thing Boost does in this case: put the function in a subnamespace and introduce it to std via using declaration. I believe this should prevent it from being found via ADL. (Or does that only work the other way round?) Sebastian From dag at cray.com Mon Nov 16 13:53:08 2009 From: dag at cray.com (David Greene) Date: Mon, 16 Nov 2009 13:53:08 -0600 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B01A222.7020603@uiuc.edu> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> Message-ID: <200911161353.08644.dag@cray.com> On Monday 16 November 2009 13:04, John Criswell wrote: > > [snip] > > > > I applied the attached patch to make it compile on my box (Debian > > x86_64), only to find out that x86_64 is not supported :( > > This architecture is not supported by the pool allocator! > > Aborted > > Thanks for the patch. What options do I give to the patch command to > apply it to the source code? Did I miss a message? I am getting tons of compiler errors building poolalloc and safecode and am wondering if this patch would fix things. -Dave From edwintorok at gmail.com Mon Nov 16 14:05:21 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Mon, 16 Nov 2009 22:05:21 +0200 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B01A222.7020603@uiuc.edu> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> Message-ID: <4B01B081.3060501@gmail.com> On 2009-11-16 21:04, John Criswell wrote: > T?r?k Edwin wrote: >> [snip] >> >> I applied the attached patch to make it compile on my box (Debian >> x86_64), only to find out that x86_64 is not supported :( >> This architecture is not supported by the pool allocator! >> Aborted >> > Thanks for the patch. What options do I give to the patch command to > apply it to the source code? It was generated by svn diff, so patch -p0 should apply it. I only fixed the obvious compiler warnings about pointer size, I don't know if there are any more assumptions that sizeof(void*) == 4 in the code. > > Although there's no documentation about contributions to SAFECode as > of yet, I'd like to follow the same policy that LLVM uses (notably > that the copyright of contributions is passed to the University of > Illinois). Is this acceptable to you? I don't think that a few lines of changes are copyrightable, but sure its acceptable. > > We haven't regularly tested SAFECode and Automatic Pool Allocation on > 64 bit architectures, so while it may work, we can't say for certain > that it will. > > This particular error is caused by the fact that the run-time does not > know which allocator is best for allocating page-aligned sections of > memory. If you modify getPages() in > runtime/BitmapPoolAllocator/PageManager.cpp to use mmap(), > posix_memalign(), or valloc(), then it will fix this error and allow > you to continue experimenting with Poolalloc/SAFECode in 64-bit mode. Why is that dependent on the architecture, and not the OS? mmap always allocates page-aligned memory AFAIK, and its widely available (except for win32). > > Eventually, we should set up something in the configure script to find > a usable default for this function. This would be a simple autoconf > change; it just hasn't been high on the priority list. >> I turned off Werror too because I was getting lots of aliasing violation >> warnings (with g++ 4.3.4). >> There are some "cast pointer to integer of different size" warnings, but >> they're all in SVA, and thats the kernel stuff that has nothing to do >> with safecode right? >> > Which code are you referring to? I don't believe any of the SVA > specific code is compiled by default in the mainline SAFECode tree. The SVA runtime, see the buildlog I sent you: /home/edwin/llvm2.6/llvm-2.6/projects/safecode/runtime/SVA/PoolCheck.c:66: warning: cast from pointer to integer of different size >> So I've built SAFEcode in a 32-bit chroot (I get the aliasing warnings >> on 32-bit too). >> >> A simple test program works, however when trying to compile ClamAV I get >> an error right on startup, and it aborts! >> The docs say that if I don't use terminate it should go on. >> > The -terminate option used to work but broke during some refactoring > of the error reporting code. Getting it to work again is on my TODO > list. You can get the behavior you want, for now, by removing the > abort() line from runtime/DebugRuntime/Report.cpp. > > As far as the ClamAV error, are you sure it's a false positive (i.e., > a bug in SAFECode)? I ran SAFECode on the programs in > MultiSource/Applications and found that quite a few programs have > memory safety errors. One of the errors is in libltdl, the other one inside optparser in ClamAV. Neither of these errors show up in valgrind, and mudflap. That doesn't mean there is no error there, its just very unlikely. Do you accept NULL as a parameter to free? If not that might the problem here. > > In the case of ClamAV, a false positive might occur if 1) the memory > object is allocated by a library linked in as native code, or 2) the > memory object is allocated via some C library function that SAFECode > doesn't recognize as an allocator (e.g., getenv() or getpwent()). > Handling the latter requires some simple changes to the DSA analysis > and SAFECode so that it treats these functions as allocators. The allocation is: opts->filename = (char **) calloc(argc - optind + 1, sizeof(char *)); opts->filename[i - optind] = strdup(argv[i]); The free is this one (according to addr2line, assuming you are reporting the address of the call): free(opts->filename); And it is this line (assuming you are reporting the return address, and thus addr2line is one-off): free(opts->filename[i]); Nothing fancy here, standard libc allocations, my guess would be strdup. Where is the list of allocator functions handled by DSA/SAFEcode? However if I remove the abort as you suggest below, I get this: SAFECode:Violation Type 0x2 when accessing 0xa1567e0 at IP=0x812892d =======+++++++ SAFECODE RUNTIME ALERT +++++++======= = Error type : Invalid Free Error = Program counter : 0x812892d = Faulting pointer : 0xa1567e0 clamscan_sc3: /home/edwin/llvm2.6/llvm-2.6/projects/safecode/runtime/BitmapPoolAllocator/PoolAllocatorBitMask.cpp:378: void __pa_bitmap_poolfree(safecode::BitmapPoolTy*, void*): Assertion `PS && "poolfree: No poolslab found for object!\n"' failed. Aborted > >> SAFECode:Violation Type 0x2 when accessing 0x832d228 at IP=0x812b531 >> >> =======+++++++ SAFECODE RUNTIME ALERT +++++++======= >> = Error type : Invalid Free Error >> = Program counter : 0x812b531 >> = Faulting pointer : 0x832d228 >> >> Program received signal SIGABRT, Aborted. >> 0xf7fdf430 in __kernel_vsyscall () >> (gdb) bt >> #0 0xf7fdf430 in __kernel_vsyscall () >> #1 0xf7d713d0 in raise () from /lib/i686/cmov/libc.so.6 >> #2 0xf7d74a85 in abort () from /lib/i686/cmov/libc.so.6 >> #3 0x08214227 in >> safecode::ReportMemoryViolation(safecode::ViolationInfo const*) () >> #4 0xf7fccea0 in ?? () from /usr/lib/libstdc++.so.6 >> Backtrace stopped: previous frame inner to this frame (corrupt stack?) >> >> I did compile ClamAV with -g, I even used -disable-opt for llvm-ld, but >> I still don't see line number error there (according to the docs I >> should). >> > > Hrm. Yes. This seems to be a missing feature. I think I can add it > relatively easily. > Thanks. >> $ ~/llvm2.6/obj32/projects/safecode/Release/bin/sc -rewrite-oob >> clamscan.bc -o clamscan_sc3.bc >> $ ~/llvm2.6/obj32/Release/bin/llc clamscan_sc3.bc -f >> $ gcc -o clamscan_sc3 clamscan_sc3.s >> ~/llvm2.6/obj32/projects/safecode/Release/lib/libsc_dbg_rt.a >> ~/llvm2.6/obj32/projects/safecode/Release/lib/libpoolalloc_bitmap.a >> -lstdc++ -lbz2 -pthread -lz ../libltdl/.libs/libltdlcS.o >> >> And I've built ClamAV like this: >> $ ./configure CC=llvm-gcc --disable-shared >> $ make CPPFLAGS="-O2 -g -emit-llvm" CFLAGS= >> CCLD="/home/edwin/llvm2.6/obj32/Release/bin/llvm-ld -disable-opt" -j8 >> >> >> If I use addr2line on the IP printed by SAFEcode, I get this, but I >> don't see anything wrong there: >> foreach_dirinpath >> /home/edwin/clam/git/builds/sc/libltdl/../../../clamav-devel/libltdl/ltdl.c:717 >> >> >> If I use the system's libltdl I get an invalid freee error here: >> optfree >> /home/edwin/clam/git/builds/sc/clamscan/../../../clamav-devel/shared/optparser.c:612 >> >> >> Is there a way to disable these invalid free errors? They look like >> false positives to me (valgrind doesn't report them). >> > Not currently. SAFECode should not have false positives. There is > either a real error in ClamAV or a bug in SAFECode. Ok, in that case a flag to warn about unknown pointers would help: i.e. warnings calls to native functions that DSA/SAFEcode doesn't know about that can return a pointer (or create one in another way, by filling a struct field for example). This could be a runtime warning too, whenever you use something that could have been modified by native code, if you stumble across a pointer to an unknown memory zone: warn about it. >> I can send you clamscan.bc (it is 2.3M gzipped) if you want to. >> > Let me first enhance the invalid free error reporting. That may help > you narrow down what SAFECode thinks the problem is and may help rule > out the possibility of a real memory error in ClamAV. After that, if > SAFECode is still reporting an error, and you can't figure out why, I > can add looking at the problem to my TODO list. Thanks, linenumber for the error, and a stacktrace would help a lot. Also saying why it is an invalid free would help: - is it trying to free something that was already freed (in that case were was the previous free)? - is it trying to free something that was never allocated? - is it trying to free a stack allocated object? (doesn't appear to be the case here) > > >> P.S.: should I send "bugs" like this to you directly, or report them on >> LLVM bugzilla? >> > I think it's actually best to file bug reports for each individual > issue. That way, we can track their progress, and they won't get lost > in my email INBOX. > > Thanks again for giving SAFECode a test drive. I'll try to get the > invalid free error reporting improved within the next day or two. If > you can let me know how to apply your patch (patch < patchfile isn't > working for me), that'd be great too. > > Thanks again! Thanks for making SAFEcode available. Best regards, --Edwin From edwintorok at gmail.com Mon Nov 16 14:06:31 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Mon, 16 Nov 2009 22:06:31 +0200 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <200911161353.08644.dag@cray.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> Message-ID: <4B01B0C7.4040009@gmail.com> On 2009-11-16 21:53, David Greene wrote: > On Monday 16 November 2009 13:04, John Criswell wrote: > >>> [snip] >>> >>> I applied the attached patch to make it compile on my box (Debian >>> x86_64), only to find out that x86_64 is not supported :( >>> This architecture is not supported by the pool allocator! >>> Aborted >>> >> Thanks for the patch. What options do I give to the patch command to >> apply it to the source code? >> > > Did I miss a message? I am getting tons of compiler errors building poolalloc > and safecode and am wondering if this patch would fix things. > My initial message (containing the patch) was a private reply to John. Attached the patch again, it applies with 'patch -p0'. Also try to build on x86-32, x86-64 is not quite ready yet. Best regards, --Edwin -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch Url: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/4ea0e342/attachment.pl From hhinnant at apple.com Mon Nov 16 14:11:17 2009 From: hhinnant at apple.com (Howard Hinnant) Date: Mon, 16 Nov 2009 15:11:17 -0500 Subject: [LLVMdev] next In-Reply-To: <4B01AE0F.9070406@getdesigned.at> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> <997D8861-0ACD-4548-AEE3-F78901B858C9@apple.com> <97A55633-B4C3-464E-A885-1710E59FE4E5@apple.com> <4B01AE0F.9070406@getdesigned.at> Message-ID: On Nov 16, 2009, at 2:54 PM, Sebastian Redl wrote: > Howard Hinnant wrote: >> On Nov 16, 2009, at 1:43 PM, Dale Johannesen wrote: >> >> >>> "next" is a popular name; if it breaks llvm, I'd expect this standards change to break a lot of existing code. Do you really want to do that? >>> >> >> I'm happy to open an LWG issue for you on this subject. Here are directions on submitting an issue: >> >> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#submit_issue >> > It may be premature, but a resolution for the issue would be the same thing Boost does in this case: put the function in a subnamespace and introduce it to std via using declaration. I believe this should prevent it from being found via ADL. (Or does that only work the other way round?) I believe that solution would prevent ADL as you intend, and if someone submits an issue, it is not premature for the submitter to propose wording which does that. Whether or not the LWG would accept that solution is not something I could speculate on. For background: Here is a paper which mentions next/prev within the context of backwards compatibility: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2270.html And here is the proposal that contains next/prev: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2246.html which was voted in on 2007-04-20. -Howard From criswell at uiuc.edu Mon Nov 16 14:18:51 2009 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Nov 2009 14:18:51 -0600 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <200911161353.08644.dag@cray.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> Message-ID: <4B01B3AB.5050100@uiuc.edu> David Greene wrote: > On Monday 16 November 2009 13:04, John Criswell wrote: > >>> [snip] >>> >>> I applied the attached patch to make it compile on my box (Debian >>> x86_64), only to find out that x86_64 is not supported :( >>> This architecture is not supported by the pool allocator! >>> Aborted >>> >> Thanks for the patch. What options do I give to the patch command to >> apply it to the source code? >> > > Did I miss a message? I am getting tons of compiler errors building poolalloc > and safecode and am wondering if this patch would fix things. > What platform are you building on? What types of errors are you seeing? Edwin's patch will fix warnings for SAFECode on 64-bit platforms. -- John T. > -Dave > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From criswell at uiuc.edu Mon Nov 16 14:45:09 2009 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Nov 2009 14:45:09 -0600 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B01B0C7.4040009@gmail.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B0C7.4040009@gmail.com> Message-ID: <4B01B9D5.2040308@uiuc.edu> T?r?k Edwin wrote: > On 2009-11-16 21:53, David Greene wrote: > >> On Monday 16 November 2009 13:04, John Criswell wrote: >> >> >>>> [snip] >>>> >>>> I applied the attached patch to make it compile on my box (Debian >>>> x86_64), only to find out that x86_64 is not supported :( >>>> This architecture is not supported by the pool allocator! >>>> Aborted >>>> >>>> >>> Thanks for the patch. What options do I give to the patch command to >>> apply it to the source code? >>> >>> >> Did I miss a message? I am getting tons of compiler errors building poolalloc >> and safecode and am wondering if this patch would fix things. >> >> > > My initial message (containing the patch) was a private reply to John. > > Attached the patch again, it applies with 'patch -p0'. > > Also try to build on x86-32, x86-64 is not quite ready yet. > Patch applied. Thanks! -- John T. > Best regards, > --Edwin > From criswell at uiuc.edu Mon Nov 16 14:46:37 2009 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Nov 2009 14:46:37 -0600 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B01B0C7.4040009@gmail.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B0C7.4040009@gmail.com> Message-ID: <4B01BA2D.6050006@uiuc.edu> [snip] > > My initial message (containing the patch) was a private reply to John. > > Attached the patch again, it applies with 'patch -p0'. > > Also try to build on x86-32, x86-64 is not quite ready yet. > Actually, I made one small change to the patch. I kept -Werror in Makefile.common.in. It's better if we fix these warnings; -Werror provides incentive for that. I'll consider removing it if there's a problem that's not trivially fixable. -- John T. > Best regards, > --Edwin > From devang.patel at gmail.com Mon Nov 16 15:22:45 2009 From: devang.patel at gmail.com (Devang Patel) Date: Mon, 16 Nov 2009 13:22:45 -0800 Subject: [LLVMdev] Passes dependencies? In-Reply-To: References: <352a1fb20911161034g120484a3v1f5be0dabc6061bb@mail.gmail.com> Message-ID: <352a1fb20911161322n19c46328u898736eb85fa63b6@mail.gmail.com> On Mon, Nov 16, 2009 at 11:43 AM, Renato Golin wrote: > 2009/11/16 Devang Patel : >> ? ?A pass can request these requirements explicitly and pass manager >> will sequence appropriate passes to meet the requirement. > > So if two different passes request a third one independently, that > third is going to run twice? If the two users do not destroy the info collected by the third pass. >> ? ?In such cases, these passes should be added in pass queue by the >> driver (clang, or opt, or llvm-gcc) before your pass. However, your >> pass should be able to gracefully handle (and skip code) if the >> incoming IR is not in suitable form. > > This way, it's the caller responsibility to assure consistency, right? > It could be possible that some required passes are not run if the > caller doesn't do it properly. Yes. You can write your own 'opt' tool (it is very simple) and sequence the transformation passes the way you want. And it should work. - Devang From edwintorok at gmail.com Mon Nov 16 15:25:31 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Mon, 16 Nov 2009 23:25:31 +0200 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B01BA2D.6050006@uiuc.edu> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B0C7.4040009@gmail.com> <4B01BA2D.6050006@uiuc.edu> Message-ID: <4B01C34B.7000507@gmail.com> On 2009-11-16 22:46, John Criswell wrote: > [snip] >> >> My initial message (containing the patch) was a private reply to John. >> >> Attached the patch again, it applies with 'patch -p0'. >> >> Also try to build on x86-32, x86-64 is not quite ready yet. >> > Actually, I made one small change to the patch. I kept -Werror in > Makefile.common.in. It's better if we fix these warnings; -Werror > provides incentive for that. > > I'll consider removing it if there's a problem that's not trivially > fixable. That leaves us with the aliasing violations. I looked at the first, and I couldn't tell why gcc (4.3.4) thinks it is wrong: safecode/runtime/BitmapPoolAllocator/PoolAllocatorBitMask.cpp:185: warning: dereferencing type-punned pointer will break strict-aliasing rules Line 185 is: PS->addToList((PoolSlab**)&Pool->Ptr2); and Ptr2 is a field of type void*. Isn't void* compatible with anything? Best regards, --Edwin -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: log Url: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/f78c1992/attachment.pl From dalej at apple.com Mon Nov 16 15:42:21 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 16 Nov 2009 13:42:21 -0800 Subject: [LLVMdev] next In-Reply-To: <97A55633-B4C3-464E-A885-1710E59FE4E5@apple.com> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> <997D8861-0ACD-4548-AEE3-F78901B858C9@apple.com> <97A55633-B4C3-464E-A885-1710E59FE4E5@apple.com> Message-ID: <925DEF86-3B81-4AC8-8D87-5055B41DB5ED@apple.com> On Nov 16, 2009, at 10:49 AMPST, Howard Hinnant wrote: > On Nov 16, 2009, at 1:43 PM, Dale Johannesen wrote: > >> >> On Nov 14, 2009, at 3:16 PMPST, Howard Hinnant wrote: >> >>> In many places there is code that looks like: >>> >>> MBBI = next(MBBI); >>> >>> In C++0X there is a std::next that is likely to be in scope when >>> these >>> calls are made. And due to ADL the above call becomes ambiguous: >>> llvm::next or std::next? >>> >>> I recommend: >>> >>> MBBI = llvm::next(MBBI); >>> >>> -Howard >> >> "next" is a popular name; if it breaks llvm, I'd expect this >> standards change to break a lot of existing code. Do you really >> want to do that? > > I'm happy to open an LWG issue for you on this subject. Eek. I'm not sure I have enough background to be the driver on this; for example I didn't know what ADL was until I looked it up. That's why I phrased it as a question. At least you don't seem to think it's a dumb question:) From rjmccall at apple.com Mon Nov 16 15:42:22 2009 From: rjmccall at apple.com (John McCall) Date: Mon, 16 Nov 2009 13:42:22 -0800 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B01C34B.7000507@gmail.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B0C7.4040009@gmail.com> <4B01BA2D.6050006@uiuc.edu> <4B01C34B.7000507@gmail.com> Message-ID: <4B01C73E.60003@apple.com> T?r?k Edwin wrote: > On 2009-11-16 22:46, John Criswell wrote: > >> [snip] >> >>> My initial message (containing the patch) was a private reply to John. >>> >>> Attached the patch again, it applies with 'patch -p0'. >>> >>> Also try to build on x86-32, x86-64 is not quite ready yet. >>> >>> >> Actually, I made one small change to the patch. I kept -Werror in >> Makefile.common.in. It's better if we fix these warnings; -Werror >> provides incentive for that. >> >> I'll consider removing it if there's a problem that's not trivially >> fixable. >> > > That leaves us with the aliasing violations. I looked at the first, and > I couldn't tell why gcc (4.3.4) thinks it is wrong: > safecode/runtime/BitmapPoolAllocator/PoolAllocatorBitMask.cpp:185: > warning: dereferencing type-punned pointer will break strict-aliasing rules > Line 185 is: PS->addToList((PoolSlab**)&Pool->Ptr2); > > and Ptr2 is a field of type void*. Isn't void* compatible with anything? > No. void* is _convertible_ to an arbitrary pointer type (6.3.2.3p1): A pointer to void may be converted to or from a pointer to any incomplete or object type. A pointer to any incomplete or object type may be converted to a pointer to void and back again; the result shall compare equal to the original pointer. But the _compatibility_ rules for pointers don't mention void* (6.7.5.1p2): For two pointer types to be compatible, both shall be identically qualified and both shall be pointers to compatible types. Nor is there an exception carved out in 6.5p1. Among other things, this permits null pointers to have different representations based on the element type, &c &c. John. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/d6e3d19a/attachment.html From TELarson at west.com Mon Nov 16 15:42:32 2009 From: TELarson at west.com (Larson, Timothy E.) Date: Mon, 16 Nov 2009 15:42:32 -0600 Subject: [LLVMdev] rpaths in llvm binaries Message-ID: <226316B3E1F749498E28ACA66321D5BA4A7A1B32@oma00cexmbx03.corp.westworlds.com> Hello LLVM devs, I am trying to package llvm for NetBSD. The package checker scripts are complaining about bad rpaths in the binaries. I see that they are relative to the build directory. I have no idea why that would be. Can you explain? If I build as myself, for testing (e.g.): $ readelf -d ~/downloads/llvm-2.6/Release/bin/llvm-ar Dynamic section at offset 0x15af28 contains 25 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libpthread.so.0] 0x00000001 (NEEDED) Shared library: [libstdc++.so.6] 0x00000001 (NEEDED) Shared library: [libm.so.0] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x00000001 (NEEDED) Shared library: [libc.so.12] 0x0000000f (RPATH) Library rpath: [/home/tim/downloads/llvm-2.6/Release/bin] 0x0000000c (INIT) 0x804dfe0 ............. As root, for packaging: # readelf -d /usr/pkg/bin/llvm-ar Dynamic section at offset 0x152028 contains 25 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [libpthread.so.0] 0x00000001 (NEEDED) Shared library: [libstdc++.so.6] 0x00000001 (NEEDED) Shared library: [libm.so.0] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x00000001 (NEEDED) Shared library: [libc.so.12] 0x0000000f (RPATH) Library rpath: [/usr/pkg/lib:/usr/pkgsrc/wip/llvm/work.i386/llvm-2.6/Release/bin] 0x0000000c (INIT) 0x804e1c0 ....... In the latter case, it ought to find the binaries in /usr/pkg/lib and never need to worry about the second path, but that second (in the former case, only) path ought not be there anyway. Should it? Why would you include an rpath from the build directory? Thanks, Tim PS Please cc me on replies. From deleeuw at stat.ucla.edu Mon Nov 16 15:56:12 2009 From: deleeuw at stat.ucla.edu (Jan de Leeuw) Date: Mon, 16 Nov 2009 13:56:12 -0800 Subject: [LLVMdev] gfortran front end Message-ID: <28D715DB-49E1-4BB5-A641-B9E49274E4CB@stat.ucla.edu> This is OS X 10.6. I can build llvm-gcc and llvm-g++ just fine, but the gfortran front end cannot find a symbol. Where would it normally be defined ? ==================================================================== /Developer/usr/bin/g++-4.2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -mdynamic-no-pic -DHAVE_CONFIG_H -o f951 \ fortran/arith.o fortran/array.o fortran/bbt.o fortran/check.o fortran/data.o fortran/decl.o fortran/dump-parse-tree.o fortran/error.o fortran/expr.o fortran/interface.o fortran/intrinsic.o fortran/io.o fortran/iresolve.o fortran/match.o fortran/matchexp.o fortran/misc.o fortran/module.o fortran/openmp.o fortran/options.o fortran/parse.o fortran/primary.o fortran/resolve.o fortran/scanner.o fortran/simplify.o fortran/st.o fortran/symbol.o fortran/convert.o fortran/dependency.o fortran/f95-lang.o fortran/trans.o fortran/trans-array.o fortran/trans-common.o fortran/trans-const.o fortran/trans-decl.o fortran/trans-expr.o fortran/trans-intrinsic.o fortran/trans-io.o fortran/trans-openmp.o fortran/trans-stmt.o fortran/trans-types.o llvm-main.o libbackend.a ../libcpp/libcpp.a /usr/local/lib/libLLVMBitReader.a /usr/local/lib/libLLVMipo.a /usr/local/lib/libLLVMBitWriter.a /usr/local/lib/libLLVMX86AsmParser.a /usr/local/lib/libLLVMX86AsmPrinter.a /usr/local/lib/libLLVMX86CodeGen.a /usr/local/lib/libLLVMSelectionDAG.a /usr/local/lib/libLLVMAsmPrinter.a /usr/local/lib/libLLVMCodeGen.a /usr/local/lib/libLLVMScalarOpts.a /usr/local/lib/libLLVMTransformUtils.a /usr/local/lib/libLLVMipa.a /usr/local/lib/libLLVMAnalysis.a /usr/local/lib/libLLVMTarget.a /usr/local/lib/libLLVMMC.a /usr/local/lib/libLLVMCore.a /usr/local/lib/libLLVMX86Info.a /usr/local/lib/libLLVMSupport.a /usr/local/lib/libLLVMSystem.a attribs.o stub-objc.o stub-c.o -L/usr/local/lib -L/usr/local/lib -lmpfr -lgmp ../libcpp/libcpp.a -lintl -L/usr/local/lib -liconv ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -L/usr/local/lib -lpthread -lffi -lm Undefined symbols: "_gt_ggc_r_gt_darwin_c_h", referenced from: _gt_ggc_rtab in f95-lang.o ld: symbol(s) not found collect2: ld returned 1 exit status make[3]: *** [f951] Error 1 make[2]: *** [all-stage3-gcc] Error 2 make[1]: *** [stage3-bubble] Error 2 make: *** [all] Error 2 === Jan de Leeuw; Distinguished Professor and Chair, UCLA Department of Statistics; Director: UCLA Center for Environmental Statistics (CES); Editor: Journal of Multivariate Analysis, Journal of Statistical Software; US mail: 8125 Math Sciences Bldg, Box 951554, Los Angeles, CA 90095-1554 phone (310)-825-9550; fax (310)-206-5658; email: deleeuw at stat.ucla.edu .mac: jdeleeuw ++++++ aim: deleeuwjan ++++++ skype: j_deleeuw homepages: http://gifi.stat.ucla.edu ++++++ http://www.cuddyvalley.org ------------------------------------------------------------------------------------------------- No matter where you go, there you are. --- Buckaroo Banzai http://gifi.stat.ucla.edu/sounds/nomatter.au ------------------------------------------------------------------------------------------------- From timo.lindfors at iki.fi Mon Nov 16 16:01:46 2009 From: timo.lindfors at iki.fi (Timo Juhani Lindfors) Date: Tue, 17 Nov 2009 00:01:46 +0200 Subject: [LLVMdev] [PATCH] bugpoint: pass -load options to LLI Message-ID: <84pr7i5dth.fsf@sauna.l.org> A non-text attachment was scrubbed... Name: llvm-bugpoint-load1.patch Type: text/x-diff Size: 1014 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091117/a6586d17/attachment.bin From devang.patel at gmail.com Mon Nov 16 16:16:53 2009 From: devang.patel at gmail.com (Devang Patel) Date: Mon, 16 Nov 2009 14:16:53 -0800 Subject: [LLVMdev] llvm-gcc: missing dbg.declare/dbg.stoppoint at optimization level > O0 In-Reply-To: References: Message-ID: <352a1fb20911161416n477775f3mc40ddb2e4d30963e@mail.gmail.com> Hi Martijn On Fri, Nov 13, 2009 at 4:52 AM, Martijn wrote: > Hello, > > I use llvm and llvm-gcc as a C-to-C transformation tool using a > modified version of the c backend, and rely on llvm debug instructions > to link back to the original source code. > > Does anyone know how to get detailed line number and variable debug > information at optimization levels beyond O0? > > Currently, I extract this debug information by compiling with -g. > This works fine with "llvm-gcc -g -O0 --emit-llvm", i.e. no > optimizations, but when I enable optimizations, e.g. "llvm-gcc -g -O2 > --emit-llvm", > most of the dbg.stoppoint and dbg.declare instructions dissapear. > > I tried to enable at least debug.declare instructions by removing the > "if(optimize) return" statement in gcc/llvm-debug.cpp, > DebugInfo::EmitDeclare(), but I still do not get any dbg.declare > instructions. This will enable dbg.declare, but they'll be removed by mem2reg pass immediately. > Is there a way to keep all debug information with optimizations > enabled in llvm-gcc? > If I have to disable some specific optimizations to keep the debug > info correct that is fine. Without mem2reg pass, you're unlikely to get much optimization done on your IR. We're working on the required support to enable variable debug info at -O1+. http://nondot.org/~sabre/LLVMNotes/DebugInfoVariableInfo.txt Let us know if you'd like to contribute in this area! - Devang From devang.patel at gmail.com Mon Nov 16 16:19:14 2009 From: devang.patel at gmail.com (Devang Patel) Date: Mon, 16 Nov 2009 14:19:14 -0800 Subject: [LLVMdev] extracting data and operands In-Reply-To: <663ee7320911161125o1a2fefb1td5ac85228d6d1763@mail.gmail.com> References: <663ee7320911161125o1a2fefb1td5ac85228d6d1763@mail.gmail.com> Message-ID: <352a1fb20911161419s7724d619idbc0f1a53c030522@mail.gmail.com> Hersh, On Mon, Nov 16, 2009 at 11:25 AM, Hersh.S. Iyer wrote: > Hi, > > I wish to implement dead code elimination as a pass in llvm. This is not the > same as unreachable block. > For this, I plan to go ahead like this : > In each function > ??? Identify the store and branch operations > ??? Identify the operands involved in these operations. > ??? Build the UD chain of these and check if there is any variable that is > not used and mark its definition (the entire instruction) > Delete all marked instructions. > > I have no clue how to do this using llvm. Any help would be greatly > appreciated. > Read lib/Transforms/Scalar/DCE.html. It'll help you understand how to write such transformations in LLVM. - Devang From hhinnant at apple.com Mon Nov 16 16:21:13 2009 From: hhinnant at apple.com (Howard Hinnant) Date: Mon, 16 Nov 2009 17:21:13 -0500 Subject: [LLVMdev] next In-Reply-To: <925DEF86-3B81-4AC8-8D87-5055B41DB5ED@apple.com> References: <18CC6B27-336F-4FAB-B371-F3674003C24A@apple.com> <997D8861-0ACD-4548-AEE3-F78901B858C9@apple.com> <97A55633-B4C3-464E-A885-1710E59FE4E5@apple.com> <925DEF86-3B81-4AC8-8D87-5055B41DB5ED@apple.com> Message-ID: <429D29EB-0A6B-4159-BC3F-C7FBDF1B5121@apple.com> On Nov 16, 2009, at 4:42 PM, Dale Johannesen wrote: > > On Nov 16, 2009, at 10:49 AMPST, Howard Hinnant wrote: > >> On Nov 16, 2009, at 1:43 PM, Dale Johannesen wrote: >> >>> >>> On Nov 14, 2009, at 3:16 PMPST, Howard Hinnant wrote: >>> >>>> In many places there is code that looks like: >>>> >>>> MBBI = next(MBBI); >>>> >>>> In C++0X there is a std::next that is likely to be in scope when these >>>> calls are made. And due to ADL the above call becomes ambiguous: >>>> llvm::next or std::next? >>>> >>>> I recommend: >>>> >>>> MBBI = llvm::next(MBBI); >>>> >>>> -Howard >>> >>> "next" is a popular name; if it breaks llvm, I'd expect this standards change to break a lot of existing code. Do you really want to do that? >> >> I'm happy to open an LWG issue for you on this subject. > > Eek. I'm not sure I have enough background to be the driver on this; for example I didn't know what ADL was until I looked it up. That's why I phrased it as a question. At least you don't seem to think it's a dumb question:) Despite the fact that I hear dumb answers all too often, I almost never come across a dumb question. :-) -Howard From ofv at wanadoo.es Mon Nov 16 16:38:37 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Mon, 16 Nov 2009 23:38:37 +0100 Subject: [LLVMdev] rpaths in llvm binaries References: <226316B3E1F749498E28ACA66321D5BA4A7A1B32@oma00cexmbx03.corp.westworlds.com> Message-ID: <87aaymccya.fsf@telefonica.net> "Larson, Timothy E." writes: > Hello LLVM devs, > > I am trying to package llvm for NetBSD. The package checker scripts > are complaining about bad rpaths in the binaries. I see that they are > relative to the build directory. I have no idea why that would be. > Can you explain? Are you using cmake for building LLVM? If the answer is yes, please ask on the cmake mailing list. Usually cmake sets the RPATH when building LLVM as shared objects. But on my Linux box it does not set RPATH when building LLVM as static libraries. -- ?scar From dag at cray.com Mon Nov 16 17:25:46 2009 From: dag at cray.com (David Greene) Date: Mon, 16 Nov 2009 17:25:46 -0600 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B01B3AB.5050100@uiuc.edu> References: <4AFDE45B.4090807@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B3AB.5050100@uiuc.edu> Message-ID: <200911161725.47263.dag@cray.com> On Monday 16 November 2009 14:18, John Criswell wrote: > > Did I miss a message? I am getting tons of compiler errors building > > poolalloc and safecode and am wondering if this patch would fix things. > > What platform are you building on? What types of errors are you > seeing? Edwin's patch will fix warnings for SAFECode on 64-bit platforms. I'm on a 64-bit Linux machine, SLES 10.1. Here's what I see: [x86_64-mod-dbg]: In file included from /ptmp/dag/llvm-project.modified/llvm/trunk/projects/poolalloc/include/dsa/DSGraph.h:18, [x86_64-mod-dbg]: from /ptmp/dag/llvm-project.modified/llvm/trunk/projects/poolalloc/lib/DSA/Basic.cpp:16: [x86_64-mod-dbg]: /ptmp/dag/llvm-project.modified/llvm/trunk/projects/poolalloc/include/dsa/DSNode.h:18:34: error: llvm/Support/Streams.h: No such file or directory Looks like if this gets fixed I will be in good shape. I configured with: cd /ptmp/dag/build.llvm.trunk.modified.debug/x86_64-unknown-linux-gnu /ptmp/dag/llvm-project.modified/llvm/trunk/configure --prefix=/tools/llvm-tools/llvm/install.trunk.modified.debug/x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu --enable-assertions --with-llvmgccdir=/tools/llvm-tools/llvm/install.trunk.modified.debug/x86_64-unknown-linux-gnu --disable-jit --disable-threads --with-llvmsrc=/ptmp/dag/llvm-project.modified/llvm/trunk --with-llvmobj=/ptmp/dag/build.llvm.trunk.modified.debug/x86_64-unknown-linux-gnu -Dave From criswell at uiuc.edu Mon Nov 16 18:10:25 2009 From: criswell at uiuc.edu (John Criswell) Date: Mon, 16 Nov 2009 18:10:25 -0600 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <200911161725.47263.dag@cray.com> References: <4AFDE45B.4090807@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B3AB.5050100@uiuc.edu> <200911161725.47263.dag@cray.com> Message-ID: <4B01E9F1.4030108@uiuc.edu> David Greene wrote: > On Monday 16 November 2009 14:18, John Criswell wrote: > > >>> Did I miss a message? I am getting tons of compiler errors building >>> poolalloc and safecode and am wondering if this patch would fix things. >>> >> What platform are you building on? What types of errors are you >> seeing? Edwin's patch will fix warnings for SAFECode on 64-bit platforms. >> > > I'm on a 64-bit Linux machine, SLES 10.1. > > Here's what I see: > > [x86_64-mod-dbg]: In file included > from /ptmp/dag/llvm-project.modified/llvm/trunk/projects/poolalloc/include/dsa/DSGraph.h:18, > [x86_64-mod-dbg]: > from /ptmp/dag/llvm-project.modified/llvm/trunk/projects/poolalloc/lib/DSA/Basic.cpp:16: > [x86_64-mod-dbg]: /ptmp/dag/llvm-project.modified/llvm/trunk/projects/poolalloc/include/dsa/DSNode.h:18:34: > error: llvm/Support/Streams.h: No such file or directory > I believe you're compiling with mainline LLVM. You need to compile against LLVM 2.6. -- John T. From jpmarath at gmail.com Mon Nov 16 20:23:15 2009 From: jpmarath at gmail.com (Jaydeep Marathe) Date: Mon, 16 Nov 2009 18:23:15 -0800 Subject: [LLVMdev] GVNPRE removed from main line? Message-ID: <6cfef6ee0911161823u4b441e41ta5133b2e8830fc3e@mail.gmail.com> It seems the GVNPRE pass has been removed from the main trunk, though it is present in the 2.6 release. From the llvm-commits archive, I found that it was removed? with this checkin: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090928/088214.html "remove the GVNPRE pass. It has been subsumed by the GVN pass." Does the GVN pass optimize all the partial redundancies that were caught by the GVNPRE pass? Thanks, -Jaydeep From resistor at mac.com Mon Nov 16 21:50:28 2009 From: resistor at mac.com (Owen Anderson) Date: Mon, 16 Nov 2009 19:50:28 -0800 Subject: [LLVMdev] GVNPRE removed from main line? In-Reply-To: <6cfef6ee0911161823u4b441e41ta5133b2e8830fc3e@mail.gmail.com> References: <6cfef6ee0911161823u4b441e41ta5133b2e8830fc3e@mail.gmail.com> Message-ID: On Nov 16, 2009, at 6:23 PM, Jaydeep Marathe wrote: > It seems the GVNPRE pass has been removed from the main trunk, though > it is present in the 2.6 release. From the llvm-commits archive, I > found that it was removed with this checkin: > http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090928/088214.html > > "remove the GVNPRE pass. It has been subsumed by the GVN pass." > > Does the GVN pass optimize all the partial redundancies that were > caught by the GVNPRE pass? No, but GVNPRE was quite slow, had some known bugs, and had not been maintained in a long time. --Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/19974fa2/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2620 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091116/19974fa2/attachment.bin From j.prasanth.j at gmail.com Mon Nov 16 23:30:53 2009 From: j.prasanth.j at gmail.com (Prasanth J) Date: Tue, 17 Nov 2009 11:00:53 +0530 Subject: [LLVMdev] Compilation error while cross compiling LLVM for ARM - the __clear_cache issue - now the __sync_val_compare_and_swap issue - now the internal compiler error issue. In-Reply-To: <4B016628.6090702@zafena.se> References: <4AF80219.6090809@zafena.se> <4AFD68AD.9080200@zafena.se> <4B012C95.3030909@zafena.se> <4B016628.6090702@zafena.se> Message-ID: > Prasanth J wrote: > > Hi, > > > > I can able to compile LLVM using armgcc_4.3.3 (codesourcery2009q1..).. > > but when i tried to run it on target it shows GCC 4.3.0 version not > > found. So i copied the runtime libraries (libc.so and libgcc_s.so) > > from the toolchain to the target and exported its path in > > LD_LIBRARY_PATH. But when i tried to run any llvm tools on target its > > crashing with Segmentation fault. What could be the problem for this. > Impossible to know without debugging. whats the backtrace when running > the program from inside the gnu debugger gdb? > and what tools did you run. > > What command did you run that caused the crash? > > What are the output from > llc -version > and > lli -version > ? > > when i tried to run this command (lli -version)i got the following error ../../llvm-with-gcc433/bin/lli: /lib/libstdc++.so.6: version `CXXABI_ARM_1.3.3' not found (required by ../../llvm-with-gcc433/bin/lli) ../../llvm-with-gcc433/bin/lli: /lib/libgcc_s.so.1: version `GCC_4.3.0' not found (required by ../../llvm-with-gcc433/bin/lli) so i exported the path to libstdc++ and libgcc_s in LD_LIBRARY_PATH. after exporting when i tried to run lli ( or any llvm tools) i am getting a crash saying Segmentation fault. i could not post the backtrace as even running gdb creates a crash. > > > > My target kernel and rootfs are compiled with armgcc-4.2.1... so > > should i need to compile the kernel and rootfs with armgcc-4.3.3? > Probably not needed. > > > > If i want to use arm-toolchain-4.2.1 , what should i do for clearing > > the instruction cache call in lib/System/Memory.cpp? > You have to implement it using inline assembler for GCC 4.2.1 and below > to work. > You can check the gcc sources to see how __clear_cache got implemeted in > gcc 4.3.3 or check the arm reference manual (ARM ARM): > http://www.arm.com/miscPDFs/14128.pdf > > Cheers > Xerxes > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091117/d25e6d36/attachment.html From Sachin.Punyani at microchip.com Tue Nov 17 00:29:35 2009 From: Sachin.Punyani at microchip.com (Sachin.Punyani at microchip.com) Date: Mon, 16 Nov 2009 23:29:35 -0700 Subject: [LLVMdev] Crash in PBQP register allocator In-Reply-To: <728927c70911142038n133a45e4lb9f796c6af19d1a2@mail.gmail.com> References: <728927c70911121629i5091b14ay1ae37dc5f0568d66@mail.gmail.com> <728927c70911142038n133a45e4lb9f796c6af19d1a2@mail.gmail.com> Message-ID: Thanks Lang! I think we can use linear scan as work around for short term. Thanks for your help. Regards Sachin > -----Original Message----- > From: Lang Hames [mailto:lhames at gmail.com] > Sent: Sunday, November 15, 2009 10:08 AM > To: Sachin Punyani - I00202 > Cc: llvmdev at cs.uiuc.edu > Subject: Re: [LLVMdev] Crash in PBQP register allocator > > Hi Sachin, > > Confirmed: This is being caused by a subtle issue in the heuristic > PBQP solver. Specifically: R1/R2 reductions as currently implemented > can, on rare occasions, lead to the heuristic solver failing to find a > finite cost solution, even though one exists. The infinite cost > solution will always be in violation of some rule of register > allocation (failing to handle an interference, or spilling an infinite > cost node for instance). > > There are several ways to fix the issue with the solver, but most > would pesimmize allocation quality in the general case. I will look > for a better solution when I return to the University of Sydney in a > couple of weeks. In the mean time I have added an assert to the > allocator to ensure that infinite cost solutions do not produce > miscompilations. For programs which trigger the assert you'll just > have to fall back on linear scan I'm afraid. > > (If you particularly want PBQP to work in the short term you could > apply the following fix: Simply pre-color all infinite cost intervals > and remove the register option from any live intervals with which they > interfere). > > Cheers, > Lang. > > On Thu, Nov 12, 2009 at 4:29 PM, Lang Hames wrote: > > This looks like a bug in the PBQP solver. I'm currently investigating. > > > > Cheers, > > Lang. > > > > On Thu, Nov 12, 2009 at 12:46 AM, ? wrote: > >> Hi, > >> > >> > >> > >> Please see the two ".ll' files attached. > >> > >> > >> > >> Command line used > >> > >> llc -march=pic16 ?-pre-RA-sched=list-burr -regalloc=pbqp new.obc > >> > >> > >> > >> The above test case crashes only when I use the combination of list- > burr > >> scheduler and pbqp register allocator. If any of them (scheduler or > register > >> allocator) is replaced with some alternate then I don't see the crash. > >> > >> > >> > >> I could not figure out the reason. Please provide some pointers to > reasons > >> of the crash. > >> > >> > >> > >> Regards > >> > >> Sachin > >> > >> _______________________________________________ > >> LLVM Developers mailing list > >> LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >> > >> > > From baldrick at free.fr Tue Nov 17 01:48:35 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 17 Nov 2009 08:48:35 +0100 Subject: [LLVMdev] gfortran front end In-Reply-To: <28D715DB-49E1-4BB5-A641-B9E49274E4CB@stat.ucla.edu> References: <28D715DB-49E1-4BB5-A641-B9E49274E4CB@stat.ucla.edu> Message-ID: <4B025553.8040603@free.fr> Hi Jan, > This is OS X 10.6. I can build llvm-gcc and llvm-g++ just fine, > but the gfortran front end cannot find a symbol. Where would it > normally be defined ? ... > Undefined symbols: > "_gt_ggc_r_gt_darwin_c_h", referenced from: > _gt_ggc_rtab in f95-lang.o these are garbage collector symbols, automatically generated by gengtype. Perhaps the library/object file defining _gt_ggc_r_gt_darwin_c_h is not being linked with? The darwin build has had lots of modifications that I don't understand, and probably this broke Fortran (no-one off linux ever seems to build it, which is bad). I suggest you search in the generated object files and libraries to find where the symbol is defined. Ciao, Duncan. From nicholas at mxc.ca Tue Nov 17 01:52:14 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 16 Nov 2009 23:52:14 -0800 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <84ws1q63hr.fsf@sauna.l.org> References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> <4B00FE09.9020008@mxc.ca> <84ws1q63hr.fsf@sauna.l.org> Message-ID: <4B02562E.6050506@mxc.ca> Timo Juhani Lindfors wrote: > Nick Lewycky writes: >> The interpreter uses libffi to make external function calls. However, it >> needs to be detected at LLVM's compile time. If you're using the >> released packages, we disabled that because we were worried about users >> who don't have libffi installed. > > This seems to be quite a common problem (I too hit it once, thought it > was a bug and reported it at > http://llvm.org/bugs/show_bug.cgi?id=5466) how about making lli inform > the user that LLVM was built without FFI support? Thanks for the reminder. I recall looking at the patch but I didn't apply it at the time because I couldn't figure out why the code above it used errs() in one case and llvm_report_error in another. Nick From edwintorok at gmail.com Tue Nov 17 01:55:21 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Tue, 17 Nov 2009 09:55:21 +0200 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B01C73E.60003@apple.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B0C7.4040009@gmail.com> <4B01BA2D.6050006@uiuc.edu> <4B01C34B.7000507@gmail.com> <4B01C73E.60003@apple.com> Message-ID: <4B0256E9.30707@gmail.com> On 2009-11-16 23:42, John McCall wrote: > T?r?k Edwin wrote: >> On 2009-11-16 22:46, John Criswell wrote: >> >>> [snip] >>> >>>> My initial message (containing the patch) was a private reply to John. >>>> >>>> Attached the patch again, it applies with 'patch -p0'. >>>> >>>> Also try to build on x86-32, x86-64 is not quite ready yet. >>>> >>>> >>> Actually, I made one small change to the patch. I kept -Werror in >>> Makefile.common.in. It's better if we fix these warnings; -Werror >>> provides incentive for that. >>> >>> I'll consider removing it if there's a problem that's not trivially >>> fixable. >>> >> That leaves us with the aliasing violations. I looked at the first, and >> I couldn't tell why gcc (4.3.4) thinks it is wrong: >> safecode/runtime/BitmapPoolAllocator/PoolAllocatorBitMask.cpp:185: >> warning: dereferencing type-punned pointer will break strict-aliasing rules >> Line 185 is: PS->addToList((PoolSlab**)&Pool->Ptr2); >> >> and Ptr2 is a field of type void*. Isn't void* compatible with anything? >> > > No. void* is _convertible_ to an arbitrary pointer type (6.3.2.3p1): > > A pointer to void may be converted to or from a pointer to any > incomplete or object type. A pointer to any incomplete or object type > may be converted to a pointer to void and back again; the result shall > compare equal to the original pointer. > > But the _compatibility_ rules for pointers don't mention void* > (6.7.5.1p2): > > For two pointer types to be compatible, both shall be identically > qualified and both shall be pointers to compatible types. > > Nor is there an exception carved out in 6.5p1. > > Among other things, this permits null pointers to have different > representations based on the element type, &c &c. Ok, then converting from void** to PoolSlab** can be done by going through void* as an intermediary type? The attached patch fixes the warnings. BTW how do I run make check for SAFEcode? It says 'make[1]: Nothing to be done for `check-local'' if I run make check. Best regards, --Edwin -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch Url: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091117/84c54c43/attachment.pl From rjmccall at apple.com Tue Nov 17 02:43:19 2009 From: rjmccall at apple.com (John McCall) Date: Tue, 17 Nov 2009 00:43:19 -0800 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B0256E9.30707@gmail.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B0C7.4040009@gmail.com> <4B01BA2D.6050006@uiuc.edu> <4B01C34B.7000507@gmail.com> <4B01C73E.60003@apple.com> <4B0256E9.30707@gmail.com> Message-ID: <4B026227.5020307@apple.com> T?r?k Edwin wrote: > Ok, then converting from void** to PoolSlab** can be done by going > through void* as an intermediary type? > The violation is not in how you're converting the void** to a PoolSlab**. That array is forever and always an array of void*s, and no amount of conversion will make it not a strict-aliasing violation to load PoolSlab*s from it. All your patch is doing is introducing enough indirection to disable the warning. The only ways to avoid the aliasing violation are to (1) have the array be a PoolSlab** in the first place or (2) actually read and write void*s from the array, casting to and from PoolSlab* as appropriate. John. From edwintorok at gmail.com Tue Nov 17 02:55:38 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Tue, 17 Nov 2009 10:55:38 +0200 Subject: [LLVMdev] SAFECode Source Code Released In-Reply-To: <4B026227.5020307@apple.com> References: <4AFDE45B.4090807@uiuc.edu> <4AFE749C.7040100@gmail.com> <4B01A222.7020603@uiuc.edu> <200911161353.08644.dag@cray.com> <4B01B0C7.4040009@gmail.com> <4B01BA2D.6050006@uiuc.edu> <4B01C34B.7000507@gmail.com> <4B01C73E.60003@apple.com> <4B0256E9.30707@gmail.com> <4B026227.5020307@apple.com> Message-ID: <4B02650A.6080802@gmail.com> On 2009-11-17 10:43, John McCall wrote: > T?r?k Edwin wrote: >> Ok, then converting from void** to PoolSlab** can be done by going >> through void* as an intermediary type? >> > > The violation is not in how you're converting the void** to a > PoolSlab**. That array is forever and always an array of void*s, and > no amount of conversion will make it not a strict-aliasing violation > to load PoolSlab*s from it. All your patch is doing is introducing > enough indirection to disable the warning. > > The only ways to avoid the aliasing violation are to (1) have the > array be a PoolSlab** in the first place or (2) actually read and > write void*s from the array, casting to and from PoolSlab* as > appropriate. In this case changing the field type from void* to PoolSlab* worked (I don't know why it had to be a void* in the first place). Now SAFEcode (excluding the SVA runtime which I disabled in my patch) builds. Best regards, --Edwin -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch Url: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091117/a0914a5c/attachment.pl From baldrick at free.fr Tue Nov 17 04:20:50 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 17 Nov 2009 11:20:50 +0100 Subject: [LLVMdev] [PATCH] bugpoint: pass -load options to LLI In-Reply-To: <84pr7i5dth.fsf@sauna.l.org> References: <84pr7i5dth.fsf@sauna.l.org> Message-ID: <4B027902.4040604@free.fr> Hi Timo, > LLI now supports -load but bugpoint LLI:ExecuteProgram() still assumes > that it doesn't. The attached patch makes bugpoint pass -load > arguments to LLI and lets one to use bugpoint with programs that > depend on native shared libraries. thanks for the patch. Applied in commit 89087. Ciao, Duncan. From baldrick at free.fr Tue Nov 17 04:55:06 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 17 Nov 2009 11:55:06 +0100 Subject: [LLVMdev] [PATCH] ADT Fixups In-Reply-To: <4B019541.4090408@cs.uiuc.edu> References: <4B019541.4090408@cs.uiuc.edu> Message-ID: <4B02810A.20601@free.fr> Hi Patrick, > I think these changes should be pretty uncontroversial. Would someone > with commit authority please apply this for me? thanks for the patch. Applied in commit 89091. Ciao, Duncan. From martijn at martijnrutten.com Tue Nov 17 05:25:05 2009 From: martijn at martijnrutten.com (Martijn) Date: Tue, 17 Nov 2009 12:25:05 +0100 Subject: [LLVMdev] llvm-gcc: missing dbg.declare/dbg.stoppoint at optimization level > O0 In-Reply-To: <352a1fb20911161416n477775f3mc40ddb2e4d30963e@mail.gmail.com> References: <352a1fb20911161416n477775f3mc40ddb2e4d30963e@mail.gmail.com> Message-ID: Hi Devang, >> I use llvm and llvm-gcc as a C-to-C transformation tool using a >> modified version of the c backend, and rely on llvm debug instructions >> to link back to the original source code. >> >> Does anyone know how to get detailed line number and variable debug >> information at optimization levels beyond O0? >> >> Currently, I extract this debug information by compiling with -g. >> This works fine with "llvm-gcc -g -O0 --emit-llvm", i.e. no >> optimizations, but when I enable optimizations, e.g. "llvm-gcc -g -O2 >> --emit-llvm", >> most of the dbg.stoppoint and dbg.declare instructions dissapear. >> >> I tried to enable at least debug.declare instructions by removing the >> "if(optimize) return" statement in gcc/llvm-debug.cpp, >> DebugInfo::EmitDeclare(), but I still do not get any dbg.declare >> instructions. > > This will enable dbg.declare, but they'll be removed by mem2reg pass > immediately. > >> Is there a way to keep all debug information with optimizations >> enabled in llvm-gcc? >> If I have to disable some specific optimizations to keep the debug >> info correct that is fine. > > Without mem2reg pass, you're unlikely to get much optimization done on your IR. Clear, thanks! I presume the mem2reg pass is also essential in the CLang frontend, so CLang is not an alternative to llvm-gcc to keep more debug information? For the dbg.stoppoints: many of the stoppoint instructions dissapear at higher optimization levels. We need these to link back instructions to original C statements. I guess this is not related to the mem2reg pass. Is there a way to at least keep the stoppoint instructions? > > We're working on the required support to enable variable debug info at -O1+. > http://nondot.org/~sabre/LLVMNotes/DebugInfoVariableInfo.txt > Let us know if you'd like to contribute in this area! The llvm.dbg.value proposal looks very interesting. We would like to contribute if possible. I estimate we do not have sufficient llvm experience to contribute ourselves, but may take up a part of the work using a contractor. Can you identify a clear part for which we could hire a contractor? Martijn From etherzhhb at gmail.com Tue Nov 17 06:48:34 2009 From: etherzhhb at gmail.com (ether zhhb) Date: Tue, 17 Nov 2009 20:48:34 +0800 Subject: [LLVMdev] LLVM target-independent code generator for reconfigurable logic Message-ID: <5f72161f0911170448y5cc41909g1f15b268337c89fd@mail.gmail.com> hi every one, i am use LLVM targeting a architecture with a processor and reconfigurable logic around it. now the llvm code generator work fine with the processor, but i am struggling to make the code generator to generate proper DAGs for the reconfigurable logic because "The LLVM target-independent code generator is designed to support efficient and quality code generation for standard register-based microprocessors.", so i want to insert my special DAG building code to the code generator. should i completely replace SelectionDAGISel, or modify SelectionDAGISel when necessary like this: LowerArguments(BasicBlock *LLVMBB) { // code for traditional target ........... for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I, ++Idx) { if (TLI.isStrangeTarget()) { //code for my strange target TLI.HandleArgment(...); continue; } // code for traditional target ....... } // code for traditional target ............. } thank you for any suggestion From shreyas76 at gmail.com Tue Nov 17 10:57:25 2009 From: shreyas76 at gmail.com (shreyas krishnan) Date: Tue, 17 Nov 2009 08:57:25 -0800 Subject: [LLVMdev] windows build Message-ID: <24389fb30911170857q2f4803e4ifadd2546f9826f14@mail.gmail.com> Hi all I am building LLVM 2.6 on VC++. I am running into this problem where even builds without any changes whatsoever causes rebuilding of certain directories like table gen of intrinsics and x86 target files. This then leads to build of the x86 codegen. Is this expected ? Any pointers to how I can avoid this? thanks shrey From astifter-llvm at gmx.at Tue Nov 17 11:03:27 2009 From: astifter-llvm at gmx.at (Andreas Neustifter) Date: Tue, 17 Nov 2009 18:03:27 +0100 Subject: [LLVMdev] PassManager again... Message-ID: <4B02D75F.1000401@gmx.at> Hi, I have trouble making my ProfileInfo-Analysis available in the backend, I have changed llc so it loads the ProfileInfo if requested, the PassManger gives this output: > Target Data Layout > Create Garbage Collector Module Metadata > Basic Alias Analysis (default AA impl) > DWARF Information Writer > No Profile Information > Module Information > ModulePass Manager > Profiling information loader > FunctionPass Manager > Preliminary module verification > Dominator Tree Construction > Module Verifier > Natural Loop Information > Loop Pass Manager > Canonicalize natural loops > Scalar Evolution Analysis > Loop Pass Manager > Induction Variable Users > Canonicalize natural loops > Induction Variable Users > Loop Strength Reduction > Dominance Frontier Construction > Exception handling preparation > Lower Garbage Collection Instructions > Remove unreachable blocks from the CFG > Optimize for code generation > Insert stack protectors > Machine Function Analysis > X86 DAG->DAG Instruction Selection > X86 FP_REG_KILL inserter ... Okay, so the ProfileInfoLoader is working, but when I examine the executions more closely I see that the ProfileInfo generated by the ProfileInfoLoader is immediately discarded, when the SelectionDAGISel kicks in the "No Profile Info"-Implementation is used: > 0x1c1a740 Executing Pass 'Profiling information loader' on Module 'main.c-O0.ll.bc'... > -*- 'Profiling information loader' is the last user of following pass instances. Free these instances > 0x1c1a740 Freeing Pass 'Profiling information loader' on Module 'main.c-O0.ll.bc'... > 0x1c1a740 Executing Pass 'Function Pass Manager' on Module 'main.c-O0.ll.bc'... > 0x1c301a0 Executing Pass 'Preliminary module verification' on Function 'main'... > 0x1c301a0 Executing Pass 'Dominator Tree Construction' on Function 'main'... > 0x1c301a0 Executing Pass 'Module Verifier' on Function 'main'... > 0x1c1ae50 Required Analyses: Preliminary module verification, Dominator Tree Construction > -*- 'Module Verifier' is the last user of following pass instances. Free these instances > 0x1c301a0 Freeing Pass 'Module Verifier' on Function 'main'... > 0x1c301a0 Freeing Pass 'Preliminary module verification' on Function 'main'... > 0x1c301a0 Executing Pass 'Natural Loop Information' on Function 'main'... > 0x1c33000 Required Analyses: Dominator Tree Construction > 0x1c301a0 Executing Pass 'Loop Pass Manager' on Function 'main'... > 0x1c33460 Required Analyses: Natural Loop Information > 0x1c301a0 Executing Pass 'Scalar Evolution Analysis' on Function 'main'... > 0x1c33cb0 Required Analyses: Natural Loop Information > 0x1c301a0 Executing Pass 'Loop Pass Manager' on Function 'main'... > 0x1c359b0 Required Analyses: Natural Loop Information > -*- 'Loop Pass Manager' is the last user of following pass instances. Free these instances > 0x1c301a0 Freeing Pass 'Scalar Evolution Analysis' on Function 'main'... > 0x1c301a0 Freeing Pass 'Natural Loop Information' on Function 'main'... > 0x1c301a0 Executing Pass 'Dominance Frontier Construction' on Function 'main'... > 0x1c370b0 Required Analyses: Dominator Tree Construction > 0x1c301a0 Executing Pass 'Exception handling preparation' on Function 'main'... > 0x1c36c70 Required Analyses: Dominator Tree Construction, Dominance Frontier Construction > 0x1c36c70 Preserved Analyses: Dominator Tree Construction, Dominance Frontier Construction, Load profile information from llvmprof.out > -*- 'Exception handling preparation' is the last user of following pass instances. Free these instances > 0x1c301a0 Freeing Pass 'Exception handling preparation' on Function 'main'... > 0x1c301a0 Freeing Pass 'Dominance Frontier Construction' on Function 'main'... > 0x1c301a0 Freeing Pass 'Dominator Tree Construction' on Function 'main'... > 0x1c301a0 Executing Pass 'Lower Garbage Collection Instructions' on Function 'main'... > 0x1c1cec0 Required Analyses: Create Garbage Collector Module Metadata > 0x1c1cec0 Preserved Analyses: Load profile information from llvmprof.out > -*- 'Lower Garbage Collection Instructions' is the last user of following pass instances. Free these instances > 0x1c301a0 Freeing Pass 'Lower Garbage Collection Instructions' on Function 'main'... > 0x1c301a0 Executing Pass 'Remove unreachable blocks from the CFG' on Function 'main'... > 0x1c36c00 Preserved Analyses: Load profile information from llvmprof.out > -*- 'Remove unreachable blocks from the CFG' is the last user of following pass instances. Free these instances > 0x1c301a0 Freeing Pass 'Remove unreachable blocks from the CFG' on Function 'main'... > 0x1c301a0 Executing Pass 'Optimize for code generation' on Function 'main'... > 0x1c38430 Preserved Analyses: Load profile information from llvmprof.out > -*- 'Optimize for code generation' is the last user of following pass instances. Free these instances > 0x1c301a0 Freeing Pass 'Optimize for code generation' on Function 'main'... > 0x1c301a0 Executing Pass 'Insert stack protectors' on Function 'main'... > 0x1c325a0 Preserved Analyses: Load profile information from llvmprof.out > -*- 'Insert stack protectors' is the last user of following pass instances. Free these instances > 0x1c301a0 Freeing Pass 'Insert stack protectors' on Function 'main'... > 0x1c301a0 Executing Pass 'Machine Function Analysis' on Function 'main'... > 0x1c301a0 Executing Pass 'X86 DAG->DAG Instruction Selection' on Function 'main'... > 0x1c390d0 Required Analyses: No Alias Analysis (always returns 'may' alias), Create Garbage Collector Module Metadata, DWARF Information Writer, Load profile information from llvmprof.out, Machine Function Analysis ... I was under the impression that it is possible to use the results form an Module-wide analysis in the following FunctionPasses, but in this case this is not working. Also, I have modified all passes that run between the ProfileInfoLoader and the SelectionDAGISel to preserve the ProfileInfo, each pass reports this properly. What really puzzles me is that the SelectionDAGISel reports the ProfileInfoLoader as required analysis (last line), so why is the PassManager assuming that the ProfileInfoLoader analysis is not used anymore? I have tried to make the ProfileInfoLoader the default implementation (instead of "No ProfileInfo") but this gives an assertion while creating the passes: > llc:.../include/llvm/PassSupport.h:111: llvm::Pass* llvm::PassInfo::createPass() const: Assertion `NormalCtor && "Cannot call createPass on PassInfo without default ctor!"' failed. Can someone enlighten me please? Andi From samuraileumas at yahoo.com Tue Nov 17 11:32:41 2009 From: samuraileumas at yahoo.com (Samuel Crow) Date: Tue, 17 Nov 2009 09:32:41 -0800 (PST) Subject: [LLVMdev] LLVM target-independent code generator for reconfigurable logic In-Reply-To: <5f72161f0911170448y5cc41909g1f15b268337c89fd@mail.gmail.com> References: <5f72161f0911170448y5cc41909g1f15b268337c89fd@mail.gmail.com> Message-ID: <687755.38477.qm@web62008.mail.re1.yahoo.com> Hello Ether, Yours isn't the first to target reconfigurable logic. I think http://www.c-to-verilog.com/ has a good example of going from a C compiler to reconfigurable logic. The usual way to lower to gate layout is to just lower the math operators to the equivalent use of an ALU and then optimize from there. Unfortunately for you, you'll need a modulo scheduler to make the code compile to raw gate layout with any reasonably acceptable level of optimization. Modulo schedulers are very processor intensive so you'll be adding minutes to the compile time and the results are only moderately good. I hope this helps, --Sam ----- Original Message ---- > From: ether zhhb > To: LLVM Developers Mailing List > Sent: Tue, November 17, 2009 6:48:34 AM > Subject: [LLVMdev] LLVM target-independent code generator for reconfigurable logic > > hi every one, > > i am use LLVM targeting a architecture with a processor and > reconfigurable logic around it. > > now the llvm code generator work fine with the processor, but i am > struggling to make the code generator to generate proper DAGs for the > reconfigurable logic because "The LLVM target-independent code > generator is designed to support efficient and quality code generation > for standard register-based microprocessors.", so i want to insert my > special DAG building code to the code generator. > > should i completely replace SelectionDAGISel, or modify > SelectionDAGISel when necessary like this: > > LowerArguments(BasicBlock *LLVMBB) { > // code for traditional target > ........... > > for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); > I != E; ++I, ++Idx) { > > if (TLI.isStrangeTarget()) { > //code for my strange target > TLI.HandleArgment(...); > continue; > } > // code for traditional target > ....... > } > > // code for traditional target > ............. > > } > > > thank you for any suggestion From timo.lindfors at iki.fi Tue Nov 17 12:25:55 2009 From: timo.lindfors at iki.fi (Timo Juhani Lindfors) Date: Tue, 17 Nov 2009 20:25:55 +0200 Subject: [LLVMdev] linking share libraries when building whole-program bitcode file In-Reply-To: (Nan Zhu's message of "Sat, 7 Nov 2009 11:35:35 +0800") References: Message-ID: <84zl6l3t58.fsf@sauna.l.org> Nan Zhu writes: > llvm-gcc -c -emit-llvm test.c > > llvm-ld test.o -lpthread //here llvm-ld tells me that "Cannot find library > pthread" $ llvm-gcc -c -emit-llvm test.c $ llvm-ld test.o -lpthread $ ./a.out Error opening '/usr/lib/libpthread.a': /usr/lib/libpthread.a: invalid ELF header -load request ignored. Hello world From devang.patel at gmail.com Tue Nov 17 12:35:08 2009 From: devang.patel at gmail.com (Devang Patel) Date: Tue, 17 Nov 2009 10:35:08 -0800 Subject: [LLVMdev] llvm-gcc: missing dbg.declare/dbg.stoppoint at optimization level > O0 In-Reply-To: References: <352a1fb20911161416n477775f3mc40ddb2e4d30963e@mail.gmail.com> Message-ID: <352a1fb20911171035j70baf6a1jef2c128fca75cd22@mail.gmail.com> Hi Martijn, On Tue, Nov 17, 2009 at 3:25 AM, Martijn wrote: >> >> Without mem2reg pass, you're unlikely to get much optimization done on your IR. > > Clear, thanks! I presume the mem2reg pass is also essential in the > CLang frontend, so CLang is not an alternative to llvm-gcc to keep > more debug information? Yes. > For the dbg.stoppoints: many of the stoppoint instructions dissapear > at higher optimization levels. We need these to link back instructions > to original C statements. I guess this is not related to the mem2reg > pass. Is there a way to at least keep the stoppoint instructions? Good news. In mainline svn sources, llvm, llvm-gcc and clang, are not using dbg.stoppoints. Now location info (line, column and scope) is attached directly with llvm instructions. This way, the info is more likely to survive through optimization passes. The optimizer may lose info when it replaces one set of instructions with another set, however that is now easier to track and fix. For example, inliner is now appropriately coping info when it copies function body. This is a recent development. >> >> We're working on the required support to enable variable debug info at -O1+. >> http://nondot.org/~sabre/LLVMNotes/DebugInfoVariableInfo.txt >> Let us know if you'd like to contribute in this area! > > The llvm.dbg.value proposal looks very interesting. We would like to > contribute if possible. I estimate we do not have sufficient llvm > experience to contribute ourselves, but may take up a part of the work > using a contractor. Can you identify a clear part for which we could > hire a contractor? This work can be largely divided into 3 phases. 1) Emit and preserve llvm.dbg.var intrinsic through target independent optimization passes. This requires experience dealing with llvm transformation passes. Victor Hernandez has started working on this phase. 2) Lower llvm.dbg.var and preserve variable info through code generation passes. This requires codegen familiarity. 3) Emit appropriate DWARF entries based on the variable info that survives through optimization and codegen passes. DWARF knowledge is useful here. - Devang From devang.patel at gmail.com Tue Nov 17 12:50:46 2009 From: devang.patel at gmail.com (Devang Patel) Date: Tue, 17 Nov 2009 10:50:46 -0800 Subject: [LLVMdev] PassManager again... In-Reply-To: <4B02D75F.1000401@gmx.at> References: <4B02D75F.1000401@gmx.at> Message-ID: <352a1fb20911171050t7e7703c0l8637fff8131c0b9e@mail.gmail.com> On Tue, Nov 17, 2009 at 9:03 AM, Andreas Neustifter wrote: > > Okay, so the ProfileInfoLoader is working, but when I examine the executions more closely I see that the ProfileInfo generated by the ProfileInfoLoader is immediately discarded, when the SelectionDAGISel kicks in the "No Profile Info"-Implementation is used: > > ?> 0x1c1a740 ? Executing Pass 'Profiling information loader' on Module 'main.c-O0.ll.bc'... > ?> ?-*- 'Profiling information loader' is the last user of following pass instances. Free these instances > ?> 0x1c1a740 ? ?Freeing Pass 'Profiling information loader' on Module 'main.c-O0.ll.bc'... > ?> 0x1c1a740 ? Executing Pass 'Function Pass Manager' on Module 'main.c-O0.ll.bc'... > ?> 0x1c301a0 ? ? Executing Pass 'Preliminary module verification' on Function 'main'... > ?> 0x1c301a0 ? ? Executing Pass 'Dominator Tree Construction' on Function 'main'... ... Did you update all these function passes to preserve profile info ? - Devang From stoklund at 2pi.dk Tue Nov 17 12:51:34 2009 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 17 Nov 2009 10:51:34 -0800 Subject: [LLVMdev] Getting optimization level in getAnalysisUsage() Message-ID: <591E02BC-34B5-46EC-BB73-69C0B3BFEB92@2pi.dk> Hi, Is it possible to access the optimization level in getAnalysisUsage() on a machine function pass? Once the pass is running, it is available through getAnalysis().getOptLevel(). That doesn't work during getAnalysisUsage(), though. /jakob From astifter-llvm at gmx.at Tue Nov 17 13:16:46 2009 From: astifter-llvm at gmx.at (Andreas Neustifter) Date: Tue, 17 Nov 2009 20:16:46 +0100 Subject: [LLVMdev] PassManager again... In-Reply-To: <352a1fb20911171050t7e7703c0l8637fff8131c0b9e@mail.gmail.com> References: <4B02D75F.1000401@gmx.at> <352a1fb20911171050t7e7703c0l8637fff8131c0b9e@mail.gmail.com> Message-ID: <4B02F69E.3080807@gmx.at> Hi, Devang Patel wrote: > On Tue, Nov 17, 2009 at 9:03 AM, Andreas Neustifter > wrote: > >> Okay, so the ProfileInfoLoader is working, but when I examine the executions more closely I see that the ProfileInfo generated by the ProfileInfoLoader is immediately discarded, when the SelectionDAGISel kicks in the "No Profile Info"-Implementation is used: >> >> > 0x1c1a740 Executing Pass 'Profiling information loader' on Module 'main.c-O0.ll.bc'... >> > -*- 'Profiling information loader' is the last user of following pass instances. Free these instances >> > 0x1c1a740 Freeing Pass 'Profiling information loader' on Module 'main.c-O0.ll.bc'... >> > 0x1c1a740 Executing Pass 'Function Pass Manager' on Module 'main.c-O0.ll.bc'... >> > 0x1c301a0 Executing Pass 'Preliminary module verification' on Function 'main'... >> > 0x1c301a0 Executing Pass 'Dominator Tree Construction' on Function 'main'... > ... > > Did you update all these function passes to preserve profile info ? Ja, they are all either PreserveAll or I have updated them to AU.setPreserved(). Andi From ofv at wanadoo.es Tue Nov 17 15:48:54 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Tue, 17 Nov 2009 22:48:54 +0100 Subject: [LLVMdev] windows build References: <24389fb30911170857q2f4803e4ifadd2546f9826f14@mail.gmail.com> Message-ID: <87zl6kbz5l.fsf@telefonica.net> shreyas krishnan writes: > I am building LLVM 2.6 on VC++. I am running into this problem > where even builds without any changes whatsoever causes rebuilding of > certain directories like table gen of intrinsics and x86 target files. > This then leads to build of the x86 codegen. Is this expected ? Any > pointers to how I can avoid this? If you are using the cmake build and can provide more detail (steps to reproduce), please file a bug report and my email to the CC list. -- ?scar From daniel at zuster.org Tue Nov 17 16:12:15 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 17 Nov 2009 14:12:15 -0800 Subject: [LLVMdev] windows build In-Reply-To: <24389fb30911170857q2f4803e4ifadd2546f9826f14@mail.gmail.com> References: <24389fb30911170857q2f4803e4ifadd2546f9826f14@mail.gmail.com> Message-ID: <6a8523d60911171412i55fe61b9yda5ab324a6ddbf4e@mail.gmail.com> There was a bug at some point where this would happen, I've forgotten the details but it is buried in bugzilla somewhere. It has now been fixed, but IIRC the issue would also be resolved if you did a full make clean. The problem was in a particular situation where every build would essentially invalidate the table gen outputs, but not actually update them, so the build never resolved itself. - Daniel On Tue, Nov 17, 2009 at 8:57 AM, shreyas krishnan wrote: > Hi all > ? I am building LLVM 2.6 on VC++. I am running into this problem > where even builds without any changes whatsoever causes rebuilding of > certain directories like table gen of intrinsics and x86 target files. > This then leads to build of the x86 codegen. Is this expected ? Any > pointers to how I can avoid this? > > thanks > shrey > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From ofv at wanadoo.es Tue Nov 17 16:23:31 2009 From: ofv at wanadoo.es (=?windows-1252?Q?=D3scar_Fuentes?=) Date: Tue, 17 Nov 2009 23:23:31 +0100 Subject: [LLVMdev] windows build References: <24389fb30911170857q2f4803e4ifadd2546f9826f14@mail.gmail.com> <6a8523d60911171412i55fe61b9yda5ab324a6ddbf4e@mail.gmail.com> Message-ID: <87vdh8bxjw.fsf@telefonica.net> Daniel Dunbar writes: > There was a bug at some point where this would happen, I've forgotten > the details but it is buried in bugzilla somewhere. It has now been > fixed, but IIRC the issue would also be resolved if you did a full > make clean. The problem was in a particular situation where every > build would essentially invalidate the table gen outputs, but not > actually update them, so the build never resolved itself. IIRC, that bug was resolved before the 2.6 fork, although what the OP says sounds like the same one. >> ? I am building LLVM 2.6 on VC++. I am running into this problem >> where even builds without any changes whatsoever causes rebuilding of >> certain directories like table gen of intrinsics and x86 target files. >> This then leads to build of the x86 codegen. Is this expected ? Any >> pointers to how I can avoid this? -- ?scar From shreyas76 at gmail.com Tue Nov 17 17:01:59 2009 From: shreyas76 at gmail.com (shreyas krishnan) Date: Tue, 17 Nov 2009 15:01:59 -0800 Subject: [LLVMdev] windows build In-Reply-To: <87vdh8bxjw.fsf@telefonica.net> References: <24389fb30911170857q2f4803e4ifadd2546f9826f14@mail.gmail.com> <6a8523d60911171412i55fe61b9yda5ab324a6ddbf4e@mail.gmail.com> <87vdh8bxjw.fsf@telefonica.net> Message-ID: <24389fb30911171501g77a7e36are7b3bd6ccac34439@mail.gmail.com> Just to clarify - I can build successfully except that the following files are always determined to be out of date by VC++ intrinsics_gen - Debug Win32 X86CodeGenTable_gen - Debug Win32 LLVMOxiliCodeGen - Debug Win32 I just need to start a debug build of llc to reproduce this issue and with cmake generated files. If no one else has this problem, then it might be my environment. Otherwise I can open a bug. thanks shrey On Tue, Nov 17, 2009 at 2:23 PM, ?scar Fuentes wrote: > Daniel Dunbar writes: > >> There was a bug at some point where this would happen, I've forgotten >> the details but it is buried in bugzilla somewhere. It has now been >> fixed, but IIRC the issue would also be resolved if you did a full >> make clean. The problem was in a particular situation where every >> build would essentially invalidate the table gen outputs, but not >> actually update them, so the build never resolved itself. > > IIRC, that bug was resolved before the 2.6 fork, although what the OP > says sounds like the same one. > >>> ? I am building LLVM 2.6 on VC++. I am running into this problem >>> where even builds without any changes whatsoever causes rebuilding of >>> certain directories like table gen of intrinsics and x86 target files. >>> This then leads to build of the x86 codegen. Is this expected ? Any >>> pointers to how I can avoid this? > > -- > ?scar > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > From shreyas76 at gmail.com Tue Nov 17 17:03:17 2009 From: shreyas76 at gmail.com (shreyas krishnan) Date: Tue, 17 Nov 2009 15:03:17 -0800 Subject: [LLVMdev] windows build In-Reply-To: <24389fb30911171501g77a7e36are7b3bd6ccac34439@mail.gmail.com> References: <24389fb30911170857q2f4803e4ifadd2546f9826f14@mail.gmail.com> <6a8523d60911171412i55fe61b9yda5ab324a6ddbf4e@mail.gmail.com> <87vdh8bxjw.fsf@telefonica.net> <24389fb30911171501g77a7e36are7b3bd6ccac34439@mail.gmail.com> Message-ID: <24389fb30911171503n7459959k30e6c8d06f65672d@mail.gmail.com> typo intrinsics_gen - Debug Win32 X86CodeGenTable_gen - Debug Win32 LLVMX86CodeGen - Debug Win32 > I just need to start a debug build of llc to reproduce this issue and > with cmake generated files. > > If no one else has this problem, then it might be my environment. > Otherwise I can open a bug. > > thanks > shrey > > > On Tue, Nov 17, 2009 at 2:23 PM, ?scar Fuentes wrote: >> Daniel Dunbar writes: >> >>> There was a bug at some point where this would happen, I've forgotten >>> the details but it is buried in bugzilla somewhere. It has now been >>> fixed, but IIRC the issue would also be resolved if you did a full >>> make clean. The problem was in a particular situation where every >>> build would essentially invalidate the table gen outputs, but not >>> actually update them, so the build never resolved itself. >> >> IIRC, that bug was resolved before the 2.6 fork, although what the OP >> says sounds like the same one. >> >>>> ? I am building LLVM 2.6 on VC++. I am running into this problem >>>> where even builds without any changes whatsoever causes rebuilding of >>>> certain directories like table gen of intrinsics and x86 target files. >>>> This then leads to build of the x86 codegen. Is this expected ? Any >>>> pointers to how I can avoid this? >> >> -- >> ?scar >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > From TELarson at west.com Tue Nov 17 17:18:56 2009 From: TELarson at west.com (Larson, Timothy E.) Date: Tue, 17 Nov 2009 17:18:56 -0600 Subject: [LLVMdev] rpaths in llvm binaries In-Reply-To: <87aaymccya.fsf@telefonica.net> References: <226316B3E1F749498E28ACA66321D5BA4A7A1B32@oma00cexmbx03.corp.westworlds.com> <87aaymccya.fsf@telefonica.net> Message-ID: <226316B3E1F749498E28ACA66321D5BA4A7A1B41@oma00cexmbx03.corp.westworlds.com> > Are you using cmake for building LLVM? > > If the answer is yes, please ask on the cmake mailing list. > > Usually cmake sets the RPATH when building LLVM as shared objects. But > on my Linux box it does not set RPATH when building LLVM as static > libraries. I do not have cmake installed - and when packaging for NetBSD (IIRC) you need to explicitly tell it that cmake is used, which I haven't done - so I'd have to answer "no". I do see LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}" in autoconf/configure.ac, and hardcode_libdir_flag_spec'${wl}-rpath ${wl}$libdir' and hardcode_libdir_flag_spec_ld='-rpath $libdir' in configure, though. Do these need to be there? Tim From zhunansjtu at gmail.com Tue Nov 17 18:54:50 2009 From: zhunansjtu at gmail.com (Nan Zhu) Date: Wed, 18 Nov 2009 08:54:50 +0800 Subject: [LLVMdev] linking share libraries when building whole-program bitcode file In-Reply-To: <84zl6l3t58.fsf@sauna.l.org> References: <84zl6l3t58.fsf@sauna.l.org> Message-ID: my platform is Fedora 11 X86_64, but I have found that llvm-ld will link libpthread as a default action just run llvm-ld test.o and lli test.bc will give the right result 2009/11/18 Timo Juhani Lindfors > Nan Zhu writes: > > llvm-gcc -c -emit-llvm test.c > > > > llvm-ld test.o -lpthread //here llvm-ld tells me that "Cannot find > library > > pthread" > > $ llvm-gcc -c -emit-llvm test.c > $ llvm-ld test.o -lpthread > $ ./a.out > Error opening '/usr/lib/libpthread.a': /usr/lib/libpthread.a: invalid ELF > header > -load request ignored. > Hello world > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091118/5821f439/attachment.html From zhunansjtu at gmail.com Tue Nov 17 19:42:57 2009 From: zhunansjtu at gmail.com (Nan Zhu) Date: Wed, 18 Nov 2009 09:42:57 +0800 Subject: [LLVMdev] Information generated by Bugpoint Message-ID: Hi,all I ran my generated whole-program bitcode file which performs as a bodytrack tool, it can give me the right result but with a stack dump before it exsits Update Error : Model observation failed for time : 1 Error loading observation data terminate called after throwing an instance of 'std::bad_cast' what(): std::bad_cast 0 lli 0x08b713d2 1 lli 0x08b71247 2 0x00d0b400 __kernel_sigreturn + 0 3 0x00d0b424 __kernel_vsyscall + 16 4 libc.so.6 0x00a6d7c1 gsignal + 81 5 libc.so.6 0x00a6f092 abort + 386 6 libstdc++.so.6 0x020b944f __gnu_cxx::__verbose_terminate_handler() + 335 7 libstdc++.so.6 0x020b7385 8 libstdc++.so.6 0x020b73c2 9 libstdc++.so.6 0x020b7501 10 libstdc++.so.6 0x020b5f05 11 libstdc++.so.6 0x0012c0d6 12 libstdc++.so.6 0x020e51e8 vtable for std::basic_filebuf > + 8 Stack dump: 0. Program arguments: lli -load=/usr/lib/libm.so bodytrack.bc ../../../inputs/sequenceB_1/ 4 260 3000 1 I use Bugpoint to check it , Bugpoint gives me the following information: Read input file : 'bodytrack.bc' *** All input ok Initializing execution environment: Found gcc: /usr/lib/ccache/gcc Running the code generator to test for a crash: *** Debugging code generator crash! Error running tool: /usr/local/bin/llc -o bugpoint-test-program.bc.cbe.c -march=c -f bugpoint-test-program.bc llc: CBackend.cpp:487: llvm::raw_ostream&::CWriter::printSimpleType(llvm::formatted_raw_ostream&, const llvm::Type*, bool, const std::string&): Assertion `NumBits <= 128 && "Bit widths > 128 not implemented yet"' failed. 0 llc 0x09017572 1 llc 0x090173e7 2 0x0044a400 __kernel_sigreturn + 0 3 0x0044a424 __kernel_vsyscall + 16 4 libc.so.6 0x00a6d7c1 gsignal + 81 5 libc.so.6 0x00a6f092 abort + 386 6 libc.so.6 0x00a668ee __assert_fail + 238 7 llc 0x0854af1a 8 llc 0x0854b682 9 llc 0x0854be09 10 llc 0x0854d40b 11 llc 0x08555e45 12 llc 0x0855e860 13 llc 0x0855e4fe 14 llc 0x0855dfb6 15 llc 0x0854fc0a 16 llc 0x0854fcb2 17 llc 0x0854fdc7 18 llc 0x0855cab3 19 llc 0x0855cbea 20 llc 0x0855e3ac 21 llc 0x0855de8b 22 llc 0x0854fc0a 23 llc 0x085544bf 24 llc 0x085541fd 25 llc 0x085540ae 26 llc 0x08549d47 27 llc 0x08f93f86 llvm::FPPassManager::runOnFunction(llvm::Function&) + 290 28 llc 0x08f94128 llvm::FPPassManager::runOnModule(llvm::Module&) + 110 29 llc 0x08f94407 llvm::MPPassManager::runOnModule(llvm::Module&) + 385 30 llc 0x08f948b4 llvm::PassManagerImpl::run(llvm::Module&) + 122 31 llc 0x08f94b99 llvm::PassManager::run(llvm::Module&) + 39 32 llc 0x084c4ed1 main + 2180 33 libc.so.6 0x00a58a66 __libc_start_main + 230 34 llc 0x084c3d41 Stack dump: 0. Program arguments: /usr/local/bin/llc -o bugpoint-test-program.bc.cbe.c -march=c -f bugpoint-test-program.bc 1. Running pass 'Function Pass Manager' on module 'bugpoint-test-program.bc'. 2. Running pass 'C backend' on function '@_ZN12BodyGeometryC1Ev' Checking to see if we can delete global inits: What does this information mean? (the ELF executable can be run correctly and even I link the generated object files together one by one manually, the wrong is still there) Is a bug in LLVM?? Nan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091118/5d4ef286/attachment.html From viridia at gmail.com Tue Nov 17 20:45:16 2009 From: viridia at gmail.com (Talin) Date: Tue, 17 Nov 2009 18:45:16 -0800 Subject: [LLVMdev] Proposal: intp type In-Reply-To: References: <400d33ea0911090758p889b240xff996305a70f78a3@mail.gmail.com> <400d33ea0911100824o3b66df92gdd1c658a5cbae2dc@mail.gmail.com> <71C8B418-751A-4FB2-BB9A-F41E22931AD4@apple.com> Message-ID: <4B035FBC.2030205@gmail.com> Chris Lattner wrote: > I'm going to be away on vacation for two weeks so I won't be able to > keep up to date with this thread, if you're interested in pursuing > this work, please write up something in the form of an 'llvmnote' > (e.g. http://nondot.org/sabre/LLVMNotes/IndirectGoto.txt) which > explains in prose the problem it is trying to solve, the tradeoffs, > and a proposed implementation approach (like you have above). Whether > or not you get time to start implementing it, it is a good idea to > document the design tradeoffs considered and the effects of various > decisions (such as neutering constant folding when TD isn't around). > This is also a good way to get others to help out, Just to let you know what's going on, I communicated privately with Kenneth and he said that he was interested in writing up the llvmnote that you requested. -- Talin From yangx2000 at gmail.com Tue Nov 17 23:02:34 2009 From: yangx2000 at gmail.com (Xu Yang) Date: Wed, 18 Nov 2009 00:02:34 -0500 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <4B02562E.6050506@mxc.ca> References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> <4B00FE09.9020008@mxc.ca> <84ws1q63hr.fsf@sauna.l.org> <4B02562E.6050506@mxc.ca> Message-ID: <25a026c60911172102t14653c85xf1b34ce95f761fa9@mail.gmail.com> Hi Nick: Thanks for pointing me to libffi. Recompile LLVM with libffi does solve the problem of printf. But it still has other problems: 1) sinf() returns 0 in the interpreter, but returns correct value in JIT (see hellosin.c) 2) calling pthread_create cause lli to crash in the interpreter mode, but no problem in JIT (see phello.c). My questions are: i) can I call any arbitrary external function in the interpreter? ii) how do I specify the dynamic library (where the external function is implemented), when I call the interpreter? Thanks Xu hellosin.c ======================= #include #include int main(int argc, char** argv){ float f = sinf(0.5235988f); printf("hello sin: %10.2f\n", f); return 0; } ======================== $ llvm-gcc -o hellosin.bc -emit-llvm -c hellosin.c $ lli -force-interpreter=true hellosin.bc hello sin: 0.00 $ lli hellosin.bc hello sin: 0.50 phello.c ======================== #include #include #define NUM_THREADS 4 void *PrintHello(void *threadid) { long tid; tid = (long)threadid; printf("Hello from %ld.\n", tid); pthread_exit(NULL); } int main (int argc, char *argv[]) { pthread_t threads[NUM_THREADS]; int ret; long t; for(t=0; t wrote: > Timo Juhani Lindfors wrote: > >> Nick Lewycky writes: >> >>> The interpreter uses libffi to make external function calls. However, it >>> needs to be detected at LLVM's compile time. If you're using the >>> released packages, we disabled that because we were worried about users >>> who don't have libffi installed. >>> >> >> This seems to be quite a common problem (I too hit it once, thought it >> was a bug and reported it at >> http://llvm.org/bugs/show_bug.cgi?id=5466) how about making lli inform >> the user that LLVM was built without FFI support? >> > > Thanks for the reminder. I recall looking at the patch but I didn't apply > it at the time because I couldn't figure out why the code above it used > errs() in one case and llvm_report_error in another. > > Nick > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091118/585c0a53/attachment.html From yangx2000 at gmail.com Tue Nov 17 23:29:29 2009 From: yangx2000 at gmail.com (Xu Yang) Date: Wed, 18 Nov 2009 00:29:29 -0500 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <25a026c60911172102t14653c85xf1b34ce95f761fa9@mail.gmail.com> References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> <4B00FE09.9020008@mxc.ca> <84ws1q63hr.fsf@sauna.l.org> <4B02562E.6050506@mxc.ca> <25a026c60911172102t14653c85xf1b34ce95f761fa9@mail.gmail.com> Message-ID: <25a026c60911172129x33e65881l8af6c1051382b566@mail.gmail.com> Hi Nick: The first problem have been solved by calling llvm-ld: $ llvm-ld -o hellosin.llvm hellosin.bc -lm $ lli -force-interpreter=true -load=/usr/lib/libm.so hellosin.llvm.bc hello sin: 0.50 The pthread problem remains after llvm-ld: $ lli -force-interpreter=true -load=/lib/libpthread.so.0 phello.llvm.bc 0 lli 0x08796bf8 Segmentation fault For those who are getting "invalid ELF header" error when calling llvm-ld with -lpthread, please change the load module from /usr/lib/pthread.a to /lib/libpthread.so.0. Thanks Xu On Wed, Nov 18, 2009 at 12:02 AM, Xu Yang wrote: > Hi Nick: > > Thanks for pointing me to libffi. > Recompile LLVM with libffi does solve the problem of printf. > But it still has other problems: > 1) sinf() returns 0 in the interpreter, but returns correct value in JIT > (see hellosin.c) > 2) calling pthread_create cause lli to crash in the interpreter mode, but > no problem in JIT (see phello.c). > > My questions are: > i) can I call any arbitrary external function in the interpreter? > ii) how do I specify the dynamic library (where the external function is > implemented), when I call the interpreter? > > Thanks > Xu > > hellosin.c > ======================= > #include > #include > > > int main(int argc, char** argv){ > float f = sinf(0.5235988f); > printf("hello sin: %10.2f\n", f); > return 0; > } > ======================== > $ llvm-gcc -o hellosin.bc -emit-llvm -c hellosin.c > $ lli -force-interpreter=true hellosin.bc > hello sin: 0.00 > $ lli hellosin.bc > hello sin: 0.50 > > phello.c > ======================== > #include > #include > #define NUM_THREADS 4 > > void *PrintHello(void *threadid) > { > long tid; > tid = (long)threadid; > printf("Hello from %ld.\n", tid); > pthread_exit(NULL); > } > > int main (int argc, char *argv[]) > { > pthread_t threads[NUM_THREADS]; > int ret; > long t; > for(t=0; t #ifdef DEBUG > printf("creating thread %ld\n", t); > #endif > ret = pthread_create(&threads[t], NULL, PrintHello, (void *)t); > if (ret){ > printf("pthread_create ERROR: %d\n", ret); > return(-1); > } > } > pthread_exit(NULL); > } > ======================== > $ llvm-gcc -o phello.bc -emit-llvm -c phello.c > $ lli -force-interpreter=true phello.bc > 0 lli 0x08796bf8 > Segmentation fault > $ lli phello.bc > Hello from 0. > Hello from 1. > Hello from 2. > Hello from 3. > > > On Tue, Nov 17, 2009 at 2:52 AM, Nick Lewycky wrote: > >> Timo Juhani Lindfors wrote: >> >>> Nick Lewycky writes: >>> >>>> The interpreter uses libffi to make external function calls. However, it >>>> needs to be detected at LLVM's compile time. If you're using the >>>> released packages, we disabled that because we were worried about users >>>> who don't have libffi installed. >>>> >>> >>> This seems to be quite a common problem (I too hit it once, thought it >>> was a bug and reported it at >>> http://llvm.org/bugs/show_bug.cgi?id=5466) how about making lli inform >>> the user that LLVM was built without FFI support? >>> >> >> Thanks for the reminder. I recall looking at the patch but I didn't apply >> it at the time because I couldn't figure out why the code above it used >> errs() in one case and llvm_report_error in another. >> >> Nick >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091118/e40ace84/attachment.html From shines_tao at 126.com Tue Nov 17 23:15:49 2009 From: shines_tao at 126.com (shines_tao) Date: Wed, 18 Nov 2009 13:15:49 +0800 (CST) Subject: [LLVMdev] help Message-ID: <11283206.568571258521349907.JavaMail.coremail@bj126app53.126.com> hi,i am new here,and i want to know what should i do first if i want to develop a compiler based on llvm? thank you very much! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091118/9af309cc/attachment.html From nicholas at mxc.ca Tue Nov 17 23:40:41 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 17 Nov 2009 21:40:41 -0800 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <25a026c60911172129x33e65881l8af6c1051382b566@mail.gmail.com> References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> <4B00FE09.9020008@mxc.ca> <84ws1q63hr.fsf@sauna.l.org> <4B02562E.6050506@mxc.ca> <25a026c60911172102t14653c85xf1b34ce95f761fa9@mail.gmail.com> <25a026c60911172129x33e65881l8af6c1051382b566@mail.gmail.com> Message-ID: <4B0388D9.7000407@mxc.ca> Xu Yang wrote: > Hi Nick: > > The first problem have been solved by calling llvm-ld: > > $ llvm-ld -o hellosin.llvm hellosin.bc -lm > $ lli -force-interpreter=true -load=/usr/lib/libm.so hellosin.llvm.bc > hello sin: 0.50 Only because the optimizer saw sin(constant) and folded it away. The entire program became 'print constant string'. There is certainly a bug calling sinf() from the interpreter but I don't know what it is yet. > The pthread problem remains after llvm-ld: > > $ lli -force-interpreter=true -load=/lib/libpthread.so.0 phello.llvm.bc > 0 lli 0x08796bf8 > Segmentation fault I don't expect this to work at all. Unlike the JIT, I don't know of any work having been done to make the interpreter thread-safe. By the way, the interpreter can't support many more things, such as qsort() or any method which expects to call a function pointer. Is there a reason you need to use the interpreter? It's been largely undermaintained because it's pretty much useless when you've got a working JIT. Nick > For those who are getting "invalid ELF header" error when calling > llvm-ld with -lpthread, > please change the load module from /usr/lib/pthread.a to > /lib/libpthread.so.0. > > Thanks > Xu > > On Wed, Nov 18, 2009 at 12:02 AM, Xu Yang > wrote: > > Hi Nick: > > Thanks for pointing me to libffi. > Recompile LLVM with libffi does solve the problem of printf. > But it still has other problems: > 1) sinf() returns 0 in the interpreter, but returns correct value in > JIT (see hellosin.c) > 2) calling pthread_create cause lli to crash in the interpreter > mode, but no problem in JIT (see phello.c). > > My questions are: > i) can I call any arbitrary external function in the interpreter? > ii) how do I specify the dynamic library (where the external > function is implemented), when I call the interpreter? > > Thanks > Xu > > hellosin.c > ======================= > #include > #include > > > int main(int argc, char** argv){ > float f = sinf(0.5235988f); > printf("hello sin: %10.2f\n", f); > return 0; > } > ======================== > $ llvm-gcc -o hellosin.bc -emit-llvm -c hellosin.c > $ lli -force-interpreter=true hellosin.bc > hello sin: 0.00 > $ lli hellosin.bc > hello sin: 0.50 > > phello.c > ======================== > #include > #include > #define NUM_THREADS 4 > > void *PrintHello(void *threadid) > { > long tid; > tid = (long)threadid; > printf("Hello from %ld.\n", tid); > pthread_exit(NULL); > } > > int main (int argc, char *argv[]) > { > pthread_t threads[NUM_THREADS]; > int ret; > long t; > for(t=0; t #ifdef DEBUG > printf("creating thread %ld\n", t); > #endif > ret = pthread_create(&threads[t], NULL, PrintHello, (void *)t); > if (ret){ > printf("pthread_create ERROR: %d\n", ret); > return(-1); > } > } > pthread_exit(NULL); > } > ======================== > $ llvm-gcc -o phello.bc -emit-llvm -c phello.c > $ lli -force-interpreter=true phello.bc > 0 lli 0x08796bf8 > Segmentation fault > $ lli phello.bc > Hello from 0. > Hello from 1. > Hello from 2. > Hello from 3. > > > On Tue, Nov 17, 2009 at 2:52 AM, Nick Lewycky > wrote: > > Timo Juhani Lindfors wrote: > > Nick Lewycky> writes: > > The interpreter uses libffi to make external function > calls. However, it > needs to be detected at LLVM's compile time. If you're > using the > released packages, we disabled that because we were > worried about users > who don't have libffi installed. > > > This seems to be quite a common problem (I too hit it once, > thought it > was a bug and reported it at > http://llvm.org/bugs/show_bug.cgi?id=5466) how about making > lli inform > the user that LLVM was built without FFI support? > > > Thanks for the reminder. I recall looking at the patch but I > didn't apply it at the time because I couldn't figure out why > the code above it used errs() in one case and llvm_report_error > in another. > > Nick > > > From nicholas at mxc.ca Tue Nov 17 23:43:40 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 17 Nov 2009 21:43:40 -0800 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <4B0388D9.7000407@mxc.ca> References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> <4B00FE09.9020008@mxc.ca> <84ws1q63hr.fsf@sauna.l.org> <4B02562E.6050506@mxc.ca> <25a026c60911172102t14653c85xf1b34ce95f761fa9@mail.gmail.com> <25a026c60911172129x33e65881l8af6c1051382b566@mail.gmail.com> <4B0388D9.7000407@mxc.ca> Message-ID: <4B03898C.1000805@mxc.ca> Nick Lewycky wrote: > Xu Yang wrote: >> Hi Nick: >> >> The first problem have been solved by calling llvm-ld: >> >> $ llvm-ld -o hellosin.llvm hellosin.bc -lm >> $ lli -force-interpreter=true -load=/usr/lib/libm.so hellosin.llvm.bc >> hello sin: 0.50 > > Only because the optimizer saw sin(constant) and folded it away. The > entire program became 'print constant string'. There is certainly a bug > calling sinf() from the interpreter but I don't know what it is yet. Fixed in r89198. Nick From yangx2000 at gmail.com Wed Nov 18 00:03:43 2009 From: yangx2000 at gmail.com (Xu Yang) Date: Wed, 18 Nov 2009 01:03:43 -0500 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <4B0388D9.7000407@mxc.ca> References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> <4B00FE09.9020008@mxc.ca> <84ws1q63hr.fsf@sauna.l.org> <4B02562E.6050506@mxc.ca> <25a026c60911172102t14653c85xf1b34ce95f761fa9@mail.gmail.com> <25a026c60911172129x33e65881l8af6c1051382b566@mail.gmail.com> <4B0388D9.7000407@mxc.ca> Message-ID: <25a026c60911172203m3e4df5eeyb961a4e44d833183@mail.gmail.com> Hi Nick: Thanks for the response. You are right about sinf. I changed the constant to sscanf(argv[1], ...), and it gave me back 0 again. I also compared the disassembled code, and saw it was indeed the case. The primary reason I use interpreter is because I wish to do runtime checking on memory access pattern in multithreaded C programs. for example, if thread one is in the critical section, I wish to know if there are any other threads accessing the variables in the critical section without first acquiring a lock. I can do it with native code, but I will have to insert memory check function calls before all memory access instructions (load/store...), which is painful. But if I can run the program in interpreter, I can intercept the load and store instruction in the interpreter, and do the memory check there, which is completely transparent to the user program. Do you have any suggestions on how LLVM may help in this case? Thanks Xu On Wed, Nov 18, 2009 at 12:40 AM, Nick Lewycky wrote: > Xu Yang wrote: > >> Hi Nick: >> >> The first problem have been solved by calling llvm-ld: >> >> $ llvm-ld -o hellosin.llvm hellosin.bc -lm >> $ lli -force-interpreter=true -load=/usr/lib/libm.so hellosin.llvm.bc >> hello sin: 0.50 >> > > Only because the optimizer saw sin(constant) and folded it away. The entire > program became 'print constant string'. There is certainly a bug calling > sinf() from the interpreter but I don't know what it is yet. > > > The pthread problem remains after llvm-ld: >> >> $ lli -force-interpreter=true -load=/lib/libpthread.so.0 phello.llvm.bc >> 0 lli 0x08796bf8 >> Segmentation fault >> > > I don't expect this to work at all. Unlike the JIT, I don't know of any > work having been done to make the interpreter thread-safe. > > By the way, the interpreter can't support many more things, such as qsort() > or any method which expects to call a function pointer. Is there a reason > you need to use the interpreter? It's been largely undermaintained because > it's pretty much useless when you've got a working JIT. > > Nick > > For those who are getting "invalid ELF header" error when calling >> llvm-ld with -lpthread, >> please change the load module from /usr/lib/pthread.a to >> /lib/libpthread.so.0. >> >> Thanks >> Xu >> >> On Wed, Nov 18, 2009 at 12:02 AM, Xu Yang > > wrote: >> >> Hi Nick: >> >> Thanks for pointing me to libffi. >> Recompile LLVM with libffi does solve the problem of printf. >> But it still has other problems: >> 1) sinf() returns 0 in the interpreter, but returns correct value in >> JIT (see hellosin.c) >> 2) calling pthread_create cause lli to crash in the interpreter >> mode, but no problem in JIT (see phello.c). >> >> My questions are: >> i) can I call any arbitrary external function in the interpreter? >> ii) how do I specify the dynamic library (where the external >> function is implemented), when I call the interpreter? >> >> Thanks >> Xu >> >> hellosin.c >> ======================= >> #include >> #include >> >> >> int main(int argc, char** argv){ >> float f = sinf(0.5235988f); >> printf("hello sin: %10.2f\n", f); >> return 0; >> } >> ======================== >> $ llvm-gcc -o hellosin.bc -emit-llvm -c hellosin.c >> $ lli -force-interpreter=true hellosin.bc >> hello sin: 0.00 >> $ lli hellosin.bc >> hello sin: 0.50 >> >> phello.c >> ======================== >> #include >> #include >> #define NUM_THREADS 4 >> >> void *PrintHello(void *threadid) >> { >> long tid; >> tid = (long)threadid; >> printf("Hello from %ld.\n", tid); >> pthread_exit(NULL); >> } >> >> int main (int argc, char *argv[]) >> { >> pthread_t threads[NUM_THREADS]; >> int ret; >> long t; >> for(t=0; t> #ifdef DEBUG >> printf("creating thread %ld\n", t); >> #endif >> ret = pthread_create(&threads[t], NULL, PrintHello, (void *)t); >> if (ret){ >> printf("pthread_create ERROR: %d\n", ret); >> return(-1); >> } >> } >> pthread_exit(NULL); >> } >> ======================== >> $ llvm-gcc -o phello.bc -emit-llvm -c phello.c >> $ lli -force-interpreter=true phello.bc >> 0 lli 0x08796bf8 >> Segmentation fault >> $ lli phello.bc >> Hello from 0. >> Hello from 1. >> Hello from 2. >> Hello from 3. >> >> >> On Tue, Nov 17, 2009 at 2:52 AM, Nick Lewycky > > wrote: >> >> Timo Juhani Lindfors wrote: >> >> Nick Lewycky> >> writes: >> >> >> The interpreter uses libffi to make external function >> calls. However, it >> needs to be detected at LLVM's compile time. If you're >> using the >> released packages, we disabled that because we were >> worried about users >> who don't have libffi installed. >> >> >> This seems to be quite a common problem (I too hit it once, >> thought it >> was a bug and reported it at >> http://llvm.org/bugs/show_bug.cgi?id=5466) how about making >> lli inform >> the user that LLVM was built without FFI support? >> >> >> Thanks for the reminder. I recall looking at the patch but I >> didn't apply it at the time because I couldn't figure out why >> the code above it used errs() in one case and llvm_report_error >> in another. >> >> Nick >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091118/f2f4f7ab/attachment-0001.html From eli.friedman at gmail.com Wed Nov 18 00:12:10 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Tue, 17 Nov 2009 22:12:10 -0800 Subject: [LLVMdev] help In-Reply-To: <11283206.568571258521349907.JavaMail.coremail@bj126app53.126.com> References: <11283206.568571258521349907.JavaMail.coremail@bj126app53.126.com> Message-ID: 2009/11/17 shines_tao : > hi,i am new here,and i want to know what should i do first if i want to > develop a compiler based on llvm? > thank you very much! Try starting with http://llvm.org/docs/tutorial/ . -Eli From jyasskin at google.com Wed Nov 18 00:12:35 2009 From: jyasskin at google.com (Jeffrey Yasskin) Date: Tue, 17 Nov 2009 22:12:35 -0800 Subject: [LLVMdev] lli -force-interpreter complains about external function In-Reply-To: <25a026c60911172203m3e4df5eeyb961a4e44d833183@mail.gmail.com> References: <25a026c60911152314p5f4e9d4n12f738d92aea5346@mail.gmail.com> <4B00FE09.9020008@mxc.ca> <84ws1q63hr.fsf@sauna.l.org> <4B02562E.6050506@mxc.ca> <25a026c60911172102t14653c85xf1b34ce95f761fa9@mail.gmail.com> <25a026c60911172129x33e65881l8af6c1051382b566@mail.gmail.com> <4B0388D9.7000407@mxc.ca> <25a026c60911172203m3e4df5eeyb961a4e44d833183@mail.gmail.com> Message-ID: Have you looked at http://code.google.com/p/data-race-test/wiki/ThreadSanitizer or http://valgrind.org/docs/manual/hg-manual.html? They have the advantage of having already been debugged. On Tue, Nov 17, 2009 at 10:03 PM, Xu Yang wrote: > Hi Nick: > Thanks for the response. > You are right about sinf. > I changed the constant to sscanf(argv[1], ...), and it gave me back 0 again. > I also compared the disassembled code, and saw it was indeed the case. > The primary reason I use interpreter is because I wish to do runtime > checking on memory access pattern in multithreaded C programs. for example, > if thread one is in the critical section, I wish to know if there are any > other threads accessing the variables in the critical section without first > acquiring a lock. I can do it with native code, but I will have to insert > memory check function calls before all memory access instructions > (load/store...), which is painful. But if I can run the program in > interpreter, I can intercept the load and store instruction in the > interpreter, and do the memory check there, which is completely transparent > to the user program. > Do you have any suggestions on how LLVM may help in this case? > > Thanks > Xu > > On Wed, Nov 18, 2009 at 12:40 AM, Nick Lewycky wrote: >> >> Xu Yang wrote: >>> >>> Hi Nick: >>> >>> The first problem have been solved by calling llvm-ld: >>> >>> $ llvm-ld -o hellosin.llvm hellosin.bc -lm >>> $ lli -force-interpreter=true -load=/usr/lib/libm.so hellosin.llvm.bc >>> hello sin: ? ? ? 0.50 >> >> Only because the optimizer saw sin(constant) and folded it away. The >> entire program became 'print constant string'. There is certainly a bug >> calling sinf() from the interpreter but I don't know what it is yet. >> >>> The pthread problem remains after llvm-ld: >>> >>> $ lli -force-interpreter=true -load=/lib/libpthread.so.0 phello.llvm.bc >>> 0 ? lli 0x08796bf8 >>> Segmentation fault >> >> I don't expect this to work at all. Unlike the JIT, I don't know of any >> work having been done to make the interpreter thread-safe. >> >> By the way, the interpreter can't support many more things, such as >> qsort() or any method which expects to call a function pointer. Is there a >> reason you need to use the interpreter? It's been largely undermaintained >> because it's pretty much useless when you've got a working JIT. >> >> Nick >> >>> For those who are getting "invalid ELF header" error when calling >>> llvm-ld with -lpthread, >>> please change the load module from /usr/lib/pthread.a to >>> /lib/libpthread.so.0. >>> >>> Thanks >>> Xu >>> >>> On Wed, Nov 18, 2009 at 12:02 AM, Xu Yang >> > wrote: >>> >>> ? ?Hi Nick: >>> >>> ? ?Thanks for pointing me to libffi. >>> ? ?Recompile LLVM with libffi does solve the problem of printf. >>> ? ?But it still has other problems: >>> ? ?1) sinf() returns 0 in the interpreter, but returns correct value in >>> ? ?JIT (see hellosin.c) >>> ? ?2) calling pthread_create cause lli to crash in the interpreter >>> ? ?mode, but no problem in JIT (see phello.c). >>> >>> ? ?My questions are: >>> ? ?i) can I call any arbitrary external function in the interpreter? >>> ? ?ii) how do I specify the dynamic library (where the external >>> ? ?function is implemented), when I call the interpreter? >>> >>> ? ?Thanks >>> ? ?Xu >>> >>> ? ?hellosin.c >>> ? ?======================= >>> ? ?#include >>> ? ?#include >>> >>> >>> ? ?int main(int argc, char** argv){ >>> ? ? ? float f = sinf(0.5235988f); >>> ? ? ? printf("hello sin: %10.2f\n", f); >>> ? ? ? return 0; >>> ? ?} >>> ? ?======================== >>> ? ?$ llvm-gcc -o hellosin.bc -emit-llvm -c hellosin.c >>> ? ?$ lli -force-interpreter=true hellosin.bc >>> ? ?hello sin: ? ? ? 0.00 >>> ? ?$ lli hellosin.bc >>> ? ?hello sin: ? ? ? 0.50 >>> >>> ? ?phello.c >>> ? ?======================== >>> ? ?#include >>> ? ?#include >>> ? ?#define NUM_THREADS ? ? 4 >>> >>> ? ?void *PrintHello(void *threadid) >>> ? ?{ >>> ? ? ? ?long tid; >>> ? ? ? ?tid = (long)threadid; >>> ? ? ? ?printf("Hello from %ld.\n", tid); >>> ? ? ? ?pthread_exit(NULL); >>> ? ?} >>> >>> ? ?int main (int argc, char *argv[]) >>> ? ?{ >>> ? ? ? ?pthread_t threads[NUM_THREADS]; >>> ? ? ? ?int ret; >>> ? ? ? ?long t; >>> ? ? ? ?for(t=0; t>> ? ?#ifdef DEBUG >>> ? ? ? ? ? printf("creating thread %ld\n", t); >>> ? ?#endif >>> ? ? ? ? ? ret = pthread_create(&threads[t], NULL, PrintHello, (void *)t); >>> ? ? ? ? ? if (ret){ >>> ? ? ? ? ? ? ?printf("pthread_create ERROR: %d\n", ret); >>> ? ? ? ? ? ? ?return(-1); >>> ? ? ? ? ? } >>> ? ? ? ?} >>> ? ? ? ?pthread_exit(NULL); >>> ? ?} >>> ? ?======================== >>> ? ?$ llvm-gcc -o phello.bc -emit-llvm -c phello.c >>> ? ?$ lli -force-interpreter=true phello.bc >>> ? ?0 ? lli 0x08796bf8 >>> ? ?Segmentation fault >>> ? ?$ lli phello.bc >>> ? ?Hello from 0. >>> ? ?Hello from 1. >>> ? ?Hello from 2. >>> ? ?Hello from 3. >>> >>> >>> ? ?On Tue, Nov 17, 2009 at 2:52 AM, Nick Lewycky >> ? ?> wrote: >>> >>> ? ? ? ?Timo Juhani Lindfors wrote: >>> >>> ? ? ? ? ? ?Nick Lewycky> >>> ?writes: >>> >>> ? ? ? ? ? ? ? ?The interpreter uses libffi to make external function >>> ? ? ? ? ? ? ? ?calls. However, it >>> ? ? ? ? ? ? ? ?needs to be detected at LLVM's compile time. If you're >>> ? ? ? ? ? ? ? ?using the >>> ? ? ? ? ? ? ? ?released packages, we disabled that because we were >>> ? ? ? ? ? ? ? ?worried about users >>> ? ? ? ? ? ? ? ?who don't have libffi installed. >>> >>> >>> ? ? ? ? ? ?This seems to be quite a common problem (I too hit it once, >>> ? ? ? ? ? ?thought it >>> ? ? ? ? ? ?was a bug and reported it at >>> ? ? ? ? ? ?http://llvm.org/bugs/show_bug.cgi?id=5466) how about making >>> ? ? ? ? ? ?lli inform >>> ? ? ? ? ? ?the user that LLVM was built without FFI support? >>> >>> >>> ? ? ? ?Thanks for the reminder. I recall looking at the patch but I >>> ? ? ? ?didn't apply it at the time because I couldn't figure out why >>> ? ? ? ?the code above it used errs() in one case and llvm_report_error >>> ? ? ? ?in another. >>> >>> ? ? ? ?Nick >>> >>> >>> >> > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu ? ? ? ? http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > From anton at korobeynikov.info Wed Nov 18 00:59:05 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Wed, 18 Nov 2009 09:59:05 +0300 Subject: [LLVMdev] Information generated by Bugpoint In-Reply-To: References: Message-ID: Hello > What does this information mean? As written in the assertion - C backend does not support arbitrary bitwidth integers. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Wed Nov 18 02:04:41 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 18 Nov 2009 09:04:41 +0100 Subject: [LLVMdev] Information generated by Bugpoint In-Reply-To: References: Message-ID: <4B03AA99.9040603@free.fr> Hi Nan Zhu, > I use Bugpoint to check it , Bugpoint gives me the following information: > > > Read input file : 'bodytrack.bc' > *** All input ok > Initializing execution environment: Found gcc: /usr/lib/ccache/gcc > Running the code generator to test for a crash: *** Debugging code > generator crash! > > Error running tool: > /usr/local/bin/llc -o bugpoint-test-program.bc.cbe.c -march=c -f > bugpoint-test-program.bc > llc: CBackend.cpp:487: > llvm::raw_ostream&::CWriter::printSimpleType(llvm::formatted_raw_ostream&, > const llvm::Type*, bool, const std::string&): Assertion `NumBits <= 128 > && "Bit widths > 128 not implemented yet"' failed. try the -llc-safe option. It will use llc to compile code rather than gcc, and llc does handle arbitrary sized integers. Ciao, Duncan. From zhunansjtu at gmail.com Wed Nov 18 02:49:23 2009 From: zhunansjtu at gmail.com (Nan Zhu) Date: Wed, 18 Nov 2009 16:49:23 +0800 Subject: [LLVMdev] Information generated by Bugpoint In-Reply-To: <4B03AA99.9040603@free.fr> References: <4B03AA99.9040603@free.fr> Message-ID: Thank you ,I will try that 2009/11/18 Duncan Sands > Hi Nan Zhu, > > > I use Bugpoint to check it , Bugpoint gives me the following information: >> >> >> Read input file : 'bodytrack.bc' >> *** All input ok >> Initializing execution environment: Found gcc: /usr/lib/ccache/gcc >> Running the code generator to test for a crash: *** Debugging code >> generator crash! >> >> Error running tool: >> /usr/local/bin/llc -o bugpoint-test-program.bc.cbe.c -march=c -f >> bugpoint-test-program.bc >> llc: CBackend.cpp:487: >> llvm::raw_ostream&::CWriter::printSimpleType(llvm::formatted_raw_ostream&, >> const llvm::Type*, bool, const std::string&): Assertion `NumBits <= 128 && >> "Bit widths > 128 not implemented yet"' failed. >> > > try the -llc-safe option. It will use llc to compile code rather than gcc, > and > llc does handle arbitrary sized integers. > > Ciao, > > Duncan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091118/cc3b82df/attachment.html From martijn at martijnrutten.com Wed Nov 18 02:50:28 2009 From: martijn at martijnrutten.com (Martijn) Date: Wed, 18 Nov 2009 09:50:28 +0100 Subject: [LLVMdev] llvm-gcc: missing dbg.declare/dbg.stoppoint at optimization level > O0 In-Reply-To: <352a1fb20911171035j70baf6a1jef2c128fca75cd22@mail.gmail.com> References: <352a1fb20911161416n477775f3mc40ddb2e4d30963e@mail.gmail.com> <352a1fb20911171035j70baf6a1jef2c128fca75cd22@mail.gmail.com> Message-ID: Hi Devang, >> For the dbg.stoppoints: many of the stoppoint instructions dissapear >> at higher optimization levels. We need these to link back instructions >> to original C statements. I guess this is not related to the mem2reg >> pass. Is there a way to at least keep the stoppoint instructions? > > Good news. In mainline svn sources, llvm, llvm-gcc and clang, are not > using dbg.stoppoints. Now location info (line, column and scope) is > attached directly with llvm instructions. This way, the info is more > likely to survive through optimization passes. The optimizer may lose > info when it replaces one set of instructions with another set, > however that is now easier to track and fix. For example, inliner is > now appropriately coping info when it copies function body. This is a > recent development. That is great news, somehow I overlooked this on the mailing list, my bad. I will look into this asap. >>> >>> We're working on the required support to enable variable debug info at -O1+. >>> http://nondot.org/~sabre/LLVMNotes/DebugInfoVariableInfo.txt >>> Let us know if you'd like to contribute in this area! >> > This work can be largely divided into 3 phases. > > 1) Emit and preserve llvm.dbg.var intrinsic through target independent > optimization passes. This requires experience dealing with llvm > transformation passes. Victor Hernandez has started working on this > phase. > 2) Lower llvm.dbg.var and preserve variable info through code > generation passes. This requires codegen familiarity. > 3) Emit appropriate DWARF entries based on the variable info that > survives through optimization and codegen passes. DWARF knowledge is > useful here. Our interest is only in the target independent part 1) since we use something similar to the C backend, i.e. no codegen/dwarf. If this is already work in progress, can we help out in testing preliminary work? Martijn From zhunansjtu at gmail.com Wed Nov 18 02:51:00 2009 From: zhunansjtu at gmail.com (Nan Zhu) Date: Wed, 18 Nov 2009 16:51:00 +0800 Subject: [LLVMdev] Information generated by Bugpoint In-Reply-To: References: Message-ID: Thank you ,but does the information I got when I invoke the compiled BC file is also caused by this? 2009/11/18 Anton Korobeynikov > Hello > > > What does this information mean? > As written in the assertion - C backend does not support arbitrary > bitwidth integers. > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20091118/dfc72651/attachment.html From stephan.reiter at gmail.com Wed Nov 18 06:02:14 2009 From: stephan.reiter at gmail.com (Stephan Reiter) Date: Wed, 18 Nov 2009 13:02:14 +0100 Subject: [LLVMdev] ABCD Example Failure Given Here Message-ID: <135ebb010911180402g202c3641j1d1d44f1858d2e5b@mail.gmail.com> I am trying to employ the ABCD optimization pass to remove unnecessary branches in the code my compiler generates. But in its current form (yesterday's trunk) the pass changes the behavior of the code such that execution yields invalid results, which is obviously not what I want. The switch in the following listing is used to implement a virtual method call, 99999 and 100000 are type identifiers used for this purpose. To give an example: %6 is an object of type 99999 (the type id is stored in the aggregate's first field), allocated on a heap that is emulated on the stack (%3). ---------- %0 = type <{ <{ }>* }> %1 = type <{ i32, <{ }>, %2* }> %2 = type <{ i32, <{ }> }> define void @shade([4 x float]* noalias nocapture, %0* noalias nocapture) nounwind { ;