Files
llvm-project/llvm/lib/Analysis/InstructionSimplify.cpp
David Sherwood 8fd0b3f553 [InstSimplify] Fix invalid dereference in simplifyBinaryIntrinsic (#194825)
For the simplifyBinaryIntrinsic interface the `Call` argument passed in
may be null, which differs from other interfaces such as
simplifyIntrinsic and simplifyUnaryIntrinsic which require `Call` to be
non-null. See FoldBinaryIntrinsic in InstSimplifyFolder.h where the
`Call` argument has a default value of null.

That means for all uses of `Call` in simplifyBinaryIntrinsic we must
first check the pointer is not null to avoid an invalid dereference.
This PR fixes the case for the get.active.lane.mask intrinsic.

There isn't currently an easy way to test this fix because the only
place I can see where FoldBinaryIntrinsic is called without a null
`Call` is VPlanTransforms.cpp and we don't currently invoke the function
for get.active.lane.mask intrinsics.
2026-04-29 13:05:11 +01:00

290 KiB