[PATCH] D35014: [X86] Improvement in CodeGen instruction selection for LEAs.

Jatin Bhateja via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 23:25:09 PST 2017


jbhateja added inline comments.


================
Comment at: lib/Target/X86/X86OptimizeLEAs.cpp:189
+static inline MemOpKey getMemOpCSEKey(const MachineInstr &MI, unsigned N) {
+  static MachineOperand DummyScale = MachineOperand::CreateImm(1);
+  assert((isLEA(MI) || MI.mayLoadOrStore()) &&
----------------
RKSimon wrote:
> RKSimon wrote:
> > Can we avoid the static?
> Again, can we avoid the static?
Its used bacause we want MemOpKey for LEA factorization to be indipendent of Scale, keeping it as static avoids recreation of dummy scale.


https://reviews.llvm.org/D35014





More information about the llvm-commits mailing list