[PATCH] D18213: Add a module Hash in the bitcode and the combined index.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 16:25:49 PDT 2016

joker.eph added a comment.

Thanks for the review Teresa, I updated accordingly (but for the FileCheck, see comment below).

Comment at: test/Bitcode/module_hash.ll:6
@@ +5,3 @@
+; RUN: llvm-bcanalyzer -dump %t | FileCheck %s --check-prefix=MOD1
+; MOD1: <HASH op0=4294068846 op1=628906511 op2=4294967218 op3=4294967275 op4=4294967289/>
+; RUN: llvm-bcanalyzer -dump %t2 | FileCheck %s --check-prefix=MOD2
tejohnson wrote:
> Won't these values change frequently as the compiler changes and generates slightly different bitcode? How about just checking if the per module values match the combined index values via FileCheck variables/pattern matching?
The hope is that a "void foo()" won't change much, but yeah it's absolutely not nice.
What you suggest is fine for testing that we correctly read and propagate to the combined index. 
HoweverI'm not comfortable not checking a value, because we lose coverage for the production of the hash. I.e. writing only zero in the first place would make the test pass :(
Would it be enough to add a comment here saying that is fine updating the value is someone change the IR/bitcode?
I'm gonna CC Duncan for an opinion on this.


More information about the llvm-commits mailing list