[llvm-commits] [llvm] r66515 - /llvm/trunk/lib/Target/X86/README.txt

Dan Gohman gohman at apple.com
Mon Mar 9 17:26:23 PDT 2009


Author: djg
Date: Mon Mar  9 19:26:23 2009
New Revision: 66515

URL: http://llvm.org/viewvc/llvm-project?rev=66515&view=rev
Log:
Add more information to the EFLAGS note.

Modified:
    llvm/trunk/lib/Target/X86/README.txt

Modified: llvm/trunk/lib/Target/X86/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=66515&r1=66514&r2=66515&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/README.txt (original)
+++ llvm/trunk/lib/Target/X86/README.txt Mon Mar  9 19:26:23 2009
@@ -1820,18 +1820,26 @@
 //===---------------------------------------------------------------------===//
 
 Test instructions can be eliminated by using EFLAGS values from arithmetic
-instructions. This is currently not done for and, or, xor, neg, shl, sra,
-srl, shld, shrd, atomic ops, and others. It is also currently not done for
-read-modify-write instructions.
+instructions. This is currently not done for mul, and, or, xor, neg, shl,
+sra, srl, shld, shrd, atomic ops, and others. It is also currently not done
+for read-modify-write instructions. It is also current not done if the
+OF or CF flags are needed.
 
 The shift operators have the complication that when the shift count is
 zero, EFLAGS is not set, so they can only subsume a test instruction if
-the shift count is known to be non-zero.
+the shift count is known to be non-zero. Also, using the EFLAGS value
+from a shift is apparently very slow on some x86 implementations.
 
 In read-modify-write instructions, the root node in the isel match is
 the store, and isel has no way for the use of the EFLAGS result of the
 arithmetic to be remapped to the new node.
 
+Add and subtract instructions set OF on signed overflow and CF on unsiged
+overflow, while test instructions always clear OF and CF. In order to
+replace a test with an add or subtract in a situation where OF or CF is
+needed, codegen must be able to prove that the operation cannot see
+signed or unsigned overflow, respectively.
+
 //===---------------------------------------------------------------------===//
 
 test/CodeGen/X86/2009-03-07-FPConstSelect.ll compiles to:





More information about the llvm-commits mailing list