[llvm-commits] [llvm] r171879 - in /llvm/trunk: lib/Target/X86/CMakeLists.txt lib/Target/X86/X86.h lib/Target/X86/X86.td lib/Target/X86/X86PadShortFunction.cpp lib/Target/X86/X86Subtarget.cpp lib/Target/X86/X86Subtarget.h lib/Target/X86/X86TargetMa...

Zhang, Andy andy.zhang at intel.com
Wed Jan 9 08:58:19 PST 2013


On January 09, 2013 1:59 AM, Evan Cheng wrote:

>> Is it necessary to explicitly check for -Oz? Doesn't -Oz also set the
>> optforsize attribute?
> 
> It's a different attribute that you need to check.

Ok, I'll check for that attribute too.

>> The code will only walk the CFG until the cycle count threshold is
>> reached (currently 4 cycles). I didn't think it was necessary to track
>> which BBs were visited given how few instructions are examined.
> 
> I don't think that's a good excuse for poor algorithm design. The code is
> reusable for other CPUs, right? What if some other CPUs needs the same
> padding but with a much higher threshold?

I can cache the blocks that were visited previously to avoid visiting them again.

> You need to check for cases where there are trailing DEBUG_LOC instructions
> following the terminator.

I will do that.

> In that case the entry BB is the exit BB. It still seems to me that the
> pass can simply look at the entry and exit blocks and avoid the scanning
> completely.

I'm not sure I understand your approach. Are you saying that we can just count the number of instructions in the entry block, and in each of the exit blocks? The branch may not be directly from the entry block to an exit block.


Regards,
Andy




More information about the llvm-commits mailing list