[all-commits] [llvm/llvm-project] 13d44b: [LegalizeDAG] Use getMemBasePlusOffset to simplify...

topperc via All-commits all-commits at lists.llvm.org
Sat May 16 01:08:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 13d44b2a0c7ef404b13b16644765977cd5310fe2
      https://github.com/llvm/llvm-project/commit/13d44b2a0c7ef404b13b16644765977cd5310fe2
  Author: Craig Topper <craig.topper at gmail.com>
  Date:   2020-05-16 (Sat, 16 May 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

  Log Message:
  -----------
  [LegalizeDAG] Use getMemBasePlusOffset to simplify some code. Use other signature of getMemBasePlusOffset in another location. NFCI

The code was calculating an offset from a stack pointer SDValue.
This is exactly what getMemBasePlusOffset does. I also replaced
sizeof(int) with a hardcoded 4. We know the type we're operating
on is 4 bytes. But the size of int that the source code is being
compiled with isn't guaranteed to be 4 bytes.

While here replace another use of getMemBasePlusOffset that was
proceeded with a call to getConstant with the other signature
that call getConstant internally.




More information about the All-commits mailing list