If machines did become self aware and develop a desire to eliminate our species I suspect that they’d stick to using biological or chemical weapons on us. Explosives and projectile weapons are awfully messy and require a lot of clean up.
I’m not worried about machines gaining sentience and then deciding to wipe out humanity. Maybe if machines could think they’d decide that we should be exterminated. Or ruthlessly dominated. Maybe they would have other ideas. We won’t know until it happens.
I’m more worried about programming machines to act as soldiers or as law enforcement. Programming has limitations and those limitations will get innocent people killed. The excuse for the tragedy will be, “We couldn’t have foreseen … “