[llvm] [NVPTX] Remove redundant addressing mode instrs (PR #128044)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 20 12:04:59 PST 2025
================
@@ -1344,8 +1264,10 @@ bool NVPTXDAGToDAGISel::tryLDGLDU(SDNode *N) {
return false;
SDValue Ops[] = { Addr, Chain };
LD = CurDAG->getMachineNode(*Opcode, DL, InstVTList, Ops);
- } else if (TM.is64Bit() ? SelectADDRri64(Op1.getNode(), Op1, Base, Offset)
- : SelectADDRri(Op1.getNode(), Op1, Base, Offset)) {
+ } else {
+ TM.is64Bit() ? SelectADDRri64(Op1.getNode(), Op1, Base, Offset)
+ : SelectADDRri(Op1.getNode(), Op1, Base, Offset);
----------------
Artem-B wrote:
Right. I could not use new C++ features those days. These days I'd just return an optional tuple of {base, offset}.
I'd switch to a regular `if` here. Ternary suggests that we're interested in the return value of SelectAddr*
https://github.com/llvm/llvm-project/pull/128044
More information about the llvm-commits
mailing list