[llvm-dev] How to add a pass to do zero check for all DIV instructions

石博文 via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 12 19:14:57 PST 2018


Hi. I'm a new learner for LLVM. I want to write a pass to add some custom
instructions to check zero for DIV. (X86-64 architecture)

before:
```
IDIV EBX
```

after:
```
TEST EBX, EBX
JNZ L1
MOV EBX, 1
L1:
IDIV EBX
```

I think it's need to modify some code in instruction generate pass, but I
don't know where is the relation files.

-- 
*B. W. Shek*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181113/cd207b2b/attachment.html>


More information about the llvm-dev mailing list