[llvm-dev] Intrinsic pattern matching

Przemek LeĊ›niak via llvm-dev llvm-dev at lists.llvm.org
Thu Feb 1 06:37:44 PST 2018


Hello,

I have a problem with pattern matching on intrinsics.
I have following code in IntrinsicsX86.td:

```
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
  def int_x86_mpx_bndmk:
        Intrinsic<[llvm_x86bnd_ty], [llvm_ptr_ty, llvm_i64_ty], []>;
}
```

And following instruction that is generated when @llvm.x86.mpx.bndmk is
used in code:


```
let isPseudo = 1 in
let usesCustomInserter = 1 in
  def BNDMK64rm_Int: PseudoI<(outs BNDR:$dst), (ins i64mem:$src,
GR64:$shift),
  [(set BNDR:$dst, (int_x86_mpx_bndmk addr:$src, i64:$shift))]>;
```

Everything works completely fine, intrinsic gets matched. But if I add
"IntrNoMem" attribute to instrinsic like:

```
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
  def int_x86_mpx_bndmk:
        Intrinsic<[llvm_x86bnd_ty], [llvm_ptr_ty, llvm_i64_ty],
[IntrNoMem]>;
}
```

All of sudden pattern doesn't get matched. How should i redefine the
pattern so it gets matched with this attribute?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180201/6c615018/attachment.html>


More information about the llvm-dev mailing list