Xref: utzoo gnu.gcc:123 comp.lang.c:14648 Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!umn-cs!ns!mark From: mark@ns.UUCP (Mark G. Mendel x2778) Newsgroups: gnu.gcc,comp.lang.c Subject: suggestions for optimization pragmas Message-ID: <970@ns.UUCP> Date: 10 Dec 88 20:59:51 GMT Organization: Network Systems Corp. Mpls MN Lines: 18 Recently, I have been hand-optimizing an interrupt handler starting with the output of the Tektronix 68020 C compiler. Here is a #pragma that I would dearly love to see in a C compiler: #pragma critical (true|false) This indicates the 'usual' result of the next condional statement. The compiler would attempt to arrange instructions along the critical-path sequentially in memory to take advantage of instruct pre-fetch. That is, error conditions would branch off and cause prefetch misses, whereas the critical, non-error execution path would zip along sequentially through memory. In addition, local variables declared in a non-critical block would never steal registers from critical-path variables. Doing this by hand has resulted in a significant gain in speed. Since instruction pre-fetching is pretty universal on state-of-the-art chips, such a pragma would win on most compilers.