This is an archive of the discontinued LLVM Phabricator instance.

[Transforms] Fix a cast to Instruction if CreateLShr() returns a constant
AbandonedPublic

Authored by slydiman on Feb 12 2022, 11:48 AM.

Details

Summary

When X is a constant, CreateLShr() returns a constant instead of an instruction.

Diff Detail

Event Timeline

slydiman created this revision.Feb 12 2022, 11:48 AM
slydiman requested review of this revision.Feb 12 2022, 11:48 AM

Test missing, and i strongly suspect this is dead code, it should already happen automatically.

nikic added a comment.Feb 14 2022, 2:08 AM

I've taken the liberty of deleting this code entirely in https://github.com/llvm/llvm-project/commit/efece08ae27d8ace684c5119d6696b1a18b2150f. We rely on automatic debug loc assignment everywhere else in InstCombine, I don't see any reason why this fold would need special treatement.

slydiman abandoned this revision.Feb 14 2022, 6:40 AM

Thanks. I will close this revision.