[llvm-dev] RFC/bikeshedding: Separation of instruction and pattern definitions in LLVM backends

Alex Bradbury via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 22 02:59:18 PDT 2017


On 22 August 2017 at 10:41, ORiordan, Martin <martin.oriordan at intel.com> wrote:
> If no pattern is provided, does the implied 'hasSideEffects' take preference over an explicit 'let hasSideEffects = 0'?
>
> I assume not, but I'd like to be certain.
>
> Knowing about this default for a NULL pattern is important though, I was certainly unaware of this until this discussion and will have to revisit my existing definitions which have NULL patterns in case 'hasSideEffects' doesn't have the value I would expect for the instruction.

The explicit let hasSideEffects=0 takes preference. You can audit this
by looking at build/lib/Target/Mytgt/MytgtGenInstrInfo.inc. Look in
`extern const MCInstrDesc MytgtInsts[]`
You'll see `MCID::UnmodeledSideEffects` for any instruction where
hasSideEffects ended up being true (either explicitly specified or
inferred).

Best,

Alex


More information about the llvm-dev mailing list