OSDN Git Service

Add more information to the EFLAGS note.
authorDan Gohman <gohman@apple.com>
Tue, 10 Mar 2009 00:26:23 +0000 (00:26 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 10 Mar 2009 00:26:23 +0000 (00:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66515 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README.txt

index 7713316..5d0446f 100644 (file)
@@ -1820,18 +1820,26 @@ LBB1_1: ## bb1
 //===---------------------------------------------------------------------===//
 
 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: