Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a llvm signed division error for compactsnoop tool
Fix issue iovisor#4182. llvm doesn't support signed division and an assertion error will happen when the IR contains sdiv. The reason is due to code zone - zone_pgdat->node_zones where zone and zone_pgdat->node_zones are pointers to struct zone (with size 1664). So effectively the above is equivalent to ((void *)zone - (void *)zone_pgdat->node_zones)/sizeof(struct zone) which is converted to sdiv insn. llvm11 seems okay and I didn't investigate why. But llvm14 and latest llvm16 failed with compiler fatal error. To fix the issue let us replace the above '(void *)' as '(u64)' and then the udiv will be used for the division. Signed-off-by: Yonghong Song <[email protected]>
- Loading branch information