[PATCH] D11660: [x86] reassociate integer multiplies using machine combiner pass

Gerolf Hoflehner ghoflehner at apple.com
Thu Jul 30 14:29:58 PDT 2015


Gerolf added a comment.

The machine code verifier used the isDead flag, so my assumption would be that it is safe to assume it is set correctly at the point of use in this code.  If there is a way to assert this that would be even better.


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:6309
@@ -6307,1 +6308,3 @@
 
+  // For binary instructions that have a third source operand (integer ops have
+  // EFLAGS), that operand must be dead.
----------------
The intention of the code is checking for a binary operator with EFLAG. When the flag is dead the function returns false.
I see two things to think about: first, why not having a function that makes it explicit incl. an assertion that the third operand actually is an eflag? In the current implementation the assumptions are implicit, so a function would make them more explicit/clear.
Second, the host function checks whether or not a virtual register is defined in \param Inst. It returns true when that is the case. Why doesn't the code check for virtual defs when eflags is dead? So I think its purpose is to eliminate dead instructions in general and binary operators with eflags is perhaps just a special case. 


http://reviews.llvm.org/D11660







More information about the llvm-commits mailing list