lebedev.ri added a comment.

@arsenm are you happy with the test coverage here?

In D108661#2963519 <https://reviews.llvm.org/D108661#2963519>, @craig.topper 
wrote:

> Wild speculation. This may be a historical artifact of LoadInst and StoreInst 
> having their getAlignment() function written like this when this limit was 
> created
>
>   unsigned getAlignment() const {
>     return (1 << (getSubclassDataFromInstruction() >> 1)) >> 1;
>   }
>
> Because "1" is signed int the left shift produced a signed int. The final 
> right shift would be an arithmetic shift. So if the alignment was 1 << 30, 
> the subclass data would be 31, the shift would produce INT_MIN, and the 
> arithmetic right shift would produce 0xc0000000 which would be incorrect.
>
> AllocaInst used 1U instead of 1 so would have been immune.

That does seem plausible :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108661/new/

https://reviews.llvm.org/D108661

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to