Ryan Taylor via llvm-dev
2017-Sep-21 20:27 UTC
[llvm-dev] Can I differentiate an imm with an imm used in memory offset in MI pass?
So I'd like to be able to tell the difference between an imm and an imm used in mem offset in MachineInstr. Or, it would be nice to tell the difference between src and dst operands. I must be missing something trivial? For example, int *b, a; b[10] = a + 2; // is there any marker/flag between 2 and 10 to tell the difference? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170921/9f10a4b1/attachment.html>
Matthias Braun via llvm-dev
2017-Sep-21 23:11 UTC
[llvm-dev] Can I differentiate an imm with an imm used in memory offset in MI pass?
The generic code in lib/CodeGen has no knowledge of these semantic differences. This knowledge is only available on a per-target basis. Typical query functions would be X86InstrInfo::getMemOpBaseRegImmOfs(...) or AArch64::getMemOpInfo(...). Doing this in a common way accross targets requires callbacks in TargetInstrInfo, there seem to be some in that direction but they appear to be rarely used so depending on what you want to do you may need to implement more of them. - Matthias> On Sep 21, 2017, at 1:27 PM, Ryan Taylor via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > So I'd like to be able to tell the difference between an imm and an imm used in mem offset in MachineInstr. > > Or, it would be nice to tell the difference between src and dst operands. > > I must be missing something trivial? > > For example, > > int *b, a; > > b[10] = a + 2; // is there any marker/flag between 2 and 10 to tell the difference? > > Thanks. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Ryan Taylor via llvm-dev
2017-Sep-22 13:52 UTC
[llvm-dev] Can I differentiate an imm with an imm used in memory offset in MI pass?
Seems like this information would be readily available in the DAG, at least in as far as outs and ins? I just need to check if the inputs are all registers or not. I was looking at many different ways to do this but basically that's all I need. On Thu, Sep 21, 2017 at 7:11 PM, Matthias Braun <mbraun at apple.com> wrote:> The generic code in lib/CodeGen has no knowledge of these semantic > differences. This knowledge is only available on a per-target basis. > Typical query functions would be X86InstrInfo::getMemOpBaseRegImmOfs(...) > or AArch64::getMemOpInfo(...). > > Doing this in a common way accross targets requires callbacks in > TargetInstrInfo, there seem to be some in that direction but they appear to > be rarely used so depending on what you want to do you may need to > implement more of them. > > - Matthias > > > On Sep 21, 2017, at 1:27 PM, Ryan Taylor via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > > So I'd like to be able to tell the difference between an imm and an imm > used in mem offset in MachineInstr. > > > > Or, it would be nice to tell the difference between src and dst operands. > > > > I must be missing something trivial? > > > > For example, > > > > int *b, a; > > > > b[10] = a + 2; // is there any marker/flag between 2 and 10 to tell the > difference? > > > > Thanks. > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170922/40e41769/attachment.html>
Reasonably Related Threads
- Can I differentiate an imm with an imm used in memory offset in MI pass?
- [LLVMdev] [PATCH] x86: disambiguate unqualified btr, bts
- [PATCH 1/2] nv50/ir: Add support for MAD short+IMM notation
- imm COPY generated by PHI elim not propagated
- fixme:imm:ImmReleaseContext message - what should I do?