OSDN Git Service

[LegalizeDAG] Use getMemBasePlusOffset to simplify some code. Use other signature...
authorCraig Topper <craig.topper@gmail.com>
Sat, 16 May 2020 08:02:06 +0000 (01:02 -0700)
committerCraig Topper <craig.topper@gmail.com>
Sat, 16 May 2020 08:02:08 +0000 (01:02 -0700)
commit13d44b2a0c7ef404b13b16644765977cd5310fe2
tree2e52b888435bcc7ee53784a3cb295124a4948e4a
parent45c7b3fd9109d7ab13964b1edd4fc1d34db9394f
[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.
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp