[PATCH] D35907: [WIP] Update TBAA information in stack coloring pass

Tony Jiang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 13:31:59 PDT 2017

jtony added inline comments.

Comment at: lib/CodeGen/MachineFunction.cpp:338
+    return new (Allocator)
+               MachineMemOperand(MachinePointerInfo(MMO->getValue(),
+                                                    MMO->getOffset()),
If we add a temp variable for the first parameter and assign a different value to it according to the guard `if(MMO->getValue())`, won't the code be simpler? I am talking something like this:

const PseudoSourceValue *Value = MMO->getValue() ?  MMO->getValue() : MMO->getPseudoValue();

return new (Allocator)
             MachineMemOperand(MachinePointerInfo(Value, MMO->getOffset()),
                               MMO->getFlags(), MMO->getSize(),
                               MMO->getBaseAlignment(), AAInfo, 
                               MMO->getRanges(), MMO->getSyncScopeID(),
                               MMO->getOrdering(), MMO->getFailureOrdering());

Comment at: lib/CodeGen/StackColoring.cpp:874
+/// FIXME: These two helper functions are copied from ScheduleDAGInstrs.cpp.
+///        To avoid the duplicated code.
Can we get rid of the `static` key word for these two functions and  and put their declaration into a header and  just keep one copy of the source code? 


More information about the llvm-commits mailing list