[PATCH] D61560: [TargetLowering] Handle multi depth GEPs w/ inline asm constraints

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 03:24:31 PDT 2019


t.p.northover added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:3512
+    ConstantSDNode *C;
+    int64_t Offset = 0;
+
----------------
I think this needs to be `uint64_t` since the arithmetic SDNodes naturally have 2s-complement behaviour. The final value will still be interpreted in a signed manner, but intermediate calculations need to be define when wrapping.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:3524
+                 ConstraintLetter != 's') {
+        Ops.push_back(DAG.getTargetConstant(Offset + C->getSExtValue(),
                                             SDLoc(C), MVT::i64));
----------------
With the above suggestion, I think you'll need to make sure this extension happens properly. You probably do anyway -- the code below for combining constants can do strange things to the high bits if pointer size is less than i64.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61560/new/

https://reviews.llvm.org/D61560





More information about the llvm-commits mailing list