[llvm-commits] [llvm-gcc-4.2] r91350 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h

Jim Grosbach grosbach at apple.com
Mon Dec 14 16:36:25 PST 2009


On Dec 14, 2009, at 4:01 PM, Anton Korobeynikov wrote:

>> -  EmitMemoryBarrier(true, true, true, true);
>> +#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
>> +  EmitMemoryBarrier(true, true, true, true, false);
>> +#else
>> +  EmitMemoryBarrier(true, true, true, true, true);
>> +#endif
> Could this be moved to some target hook? I don't think we'd want a
> chain of target ifdef's here.
>

Maybe? I agree having a bunch of ifdef stuff there is pretty ugly. I'm  
not sure how best to do target-specific bits in the front end, though,  
so I added these bits in the same manner the current PowerPC-specific  
portions are done. Likewise, the whole sequence for the atomics is  
conditionalized on whether the target is known to support the  
intrinsics, which is suboptimal. Much better would be to always create  
the intrinsics, then the legalizer (probably) could check if the back  
end explicitly supports them, and insert the library support calls if  
it doesn't.

That sort of refactoring is beyond the scope of what I was looking to  
do here, though, so I just stayed with the current scheme. I'd  
wholeheartedly support it if someone with more frontend expertise than  
I wanted to make something like that happen, though.

-Jim



More information about the llvm-commits mailing list